Project

General

Profile

Actions

Backport #2642

closed

PTY.check is broken

Added by nobu (Nobuyoshi Nakada) about 14 years ago. Updated almost 8 years ago.

Status:
Rejected
[ruby-dev:40141]

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

Actions #1

Updated by matz (Yukihiro Matsumoto) about 14 years ago

=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 writes:

|* r20298によると PTY.check(pid) to poll program termination. と
| いうことなのに終了まで待ち続ける
|* メソッド本体なのにint statusを返している
|* pid_tを期待するraise_from_check()にVALUEを渡している

コミットしてください。

=end

Actions #2

Updated by nobu (Nobuyoshi Nakada) about 14 years ago

  • 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

Updated by metanest (Makoto Kishimoto) over 12 years ago

  • Status changed from Closed to Open
  • Target version set to 2.0.0

この修正以後、PTY.check の第二引数が真値のとき、対象のプロセスが
まだ動いていても、いきなり ChildExited が上がってくるようになって
しまっています。

Actions #4

Updated by nobu (Nobuyoshi Nakada) over 12 years ago

  • 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]
Actions #5

Updated by nobu (Nobuyoshi Nakada) over 12 years ago

  • 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にも必要そうです。

Actions #6

Updated by kosaki (Motohiro KOSAKI) over 12 years ago

  • 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]

Updated by kosaki (Motohiro KOSAKI) over 12 years ago

  • Status changed from Closed to Assigned

I've commited r33468 into ruby_1_9_3 as r34183.

Actions #8

Updated by kosaki (Motohiro KOSAKI) over 12 years ago

  • Project changed from Backport193 to Backport192
Actions #9

Updated by naruse (Yui NARUSE) almost 8 years ago

  • Status changed from Assigned to Rejected
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0