Project

General

Profile

This project is closed and read-only.

Actions

Backport #2642

closed

PTY.check is broken

Backport #2642: PTY.check is broken

Added by nobu (Nobuyoshi Nakada) over 16 years ago. Updated over 10 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

Updated by matz (Yukihiro Matsumoto) over 16 years ago Actions #1

=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

Updated by nobu (Nobuyoshi Nakada) over 16 years ago Actions #2

  • 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) almost 15 years ago Actions #3 [ruby-dev:44600]

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

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

Updated by nobu (Nobuyoshi Nakada) almost 15 years ago Actions #4

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

Updated by nobu (Nobuyoshi Nakada) almost 15 years ago Actions #5

  • Tracker changed from Bug to Backport
  • Project changed from Ruby to 13
  • 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にも必要そうです。

Updated by kosaki (Motohiro KOSAKI) over 14 years ago Actions #6

  • 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 14 years ago Actions #7 [ruby-dev:45076]

  • Status changed from Closed to Assigned

I've commited r33468 into ruby_1_9_3 as r34183.

Updated by kosaki (Motohiro KOSAKI) over 14 years ago Actions #8

  • Project changed from 13 to 12

Updated by naruse (Yui NARUSE) over 10 years ago Actions #9

  • Status changed from Assigned to Rejected
Actions

Also available in: PDF Atom