Backport #2642
closed
Added by nobu (Nobuyoshi Nakada) over 14 years ago.
Updated almost 8 years ago.
Description
=begin
なかだです。
PTY.checkがいろいろと壊れているような気がします。
- r20298によると PTY.check(pid) to poll program termination. と
いうことなのに終了まで待ち続ける
- メソッド本体なのにint statusを返している
- pid_tを期待するraise_from_check()にVALUEを渡している
Index: ext/pty/pty.c
--- ext/pty/pty.c (revision 26395)
+++ ext/pty/pty.c (working copy)
@@ -606,9 +606,9 @@ pty_check(int argc, VALUE *argv, VALUE s
rb_scan_args(argc, argv, "11", &pid, &exc);
- cpid = rb_waitpid(NUM2PIDT(pid), &status, WUNTRACED);
- cpid = rb_waitpid(NUM2PIDT(pid), &status, WNOHANG|WUNTRACED);
if (cpid == -1) return Qnil;
- if (!RTEST(exc)) return status;
- raise_from_check(pid, status);
- if (!RTEST(exc)) return rb_last_status_get();
- raise_from_check(cpid, status);
return Qnil; /* not reached */
}
--
--- 僕の前にBugはない。
--- 僕の後ろにBugはできる。
中田 伸悦
=end
=begin
まつもと ゆきひろです
In message "Re: [ruby-dev:40141] [Bug:1.9] PTY.check is broken"
on Mon, 25 Jan 2010 17:07:53 +0900, Nobuyoshi Nakada nobu@ruby-lang.org writes:
|* r20298によると PTY.check(pid) to poll program termination. と
| いうことなのに終了まで待ち続ける
|* メソッド本体なのにint statusを返している
|* pid_tを期待するraise_from_check()にVALUEを渡している
コミットしてください。
=end
- Status changed from Open to Closed
- % Done changed from 0 to 100
=begin
This issue was solved with changeset r26402.
Nobuyoshi, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.
=end
- Status changed from Closed to Open
- Target version set to 2.0.0
この修正以後、PTY.check の第二引数が真値のとき、対象のプロセスが
まだ動いていても、いきなり ChildExited が上がってくるようになって
しまっています。
- Status changed from Open to Closed
This issue was solved with changeset r33468.
Nobuyoshi, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.
- ext/pty/pty.c (pty_check): should return nil until the child
terminates or stops. [ruby-dev:44600] [Bug #2642]
- Tracker changed from Bug to Backport
- Project changed from Ruby master to Backport193
- Status changed from Closed to Assigned
- Assignee set to yugui (Yuki Sonoda)
- Target version deleted (
2.0.0)
r33468は1.9.2と1.9.3にも必要そうです。
- Status changed from Assigned to Closed
This issue was solved with changeset r34183.
Nobuyoshi, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.
merge revision(s) 33468:
* ext/pty/pty.c (pty_check): should return nil until the child
terminates or stops. [ruby-dev:44600] [Bug #2642]
- Status changed from Closed to Assigned
I've commited r33468 into ruby_1_9_3 as r34183.
- Project changed from Backport193 to Backport192
- Status changed from Assigned to Rejected
Also available in: Atom
PDF
Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0