Forum: Ruby-core [ruby-trunk - Bug #7082][Open] Process.kill 0 in windows can return spurious success

Posted by Roger Pack (rogerdpack)
on 2012-09-28 09:29
(Received via mailing list)
Issue #7082 has been reported by rogerdpack (Roger Pack).

----------------------------------------
Bug #7082: Process.kill 0 in windows can return spurious success
https://bugs.ruby-lang.org/issues/7082

Author: rogerdpack (Roger Pack)
Status: Open
Priority: Normal
Assignee:
Category:
Target version:
ruby -v: ruby 1.9.3p194 (2012-04-20) [i386-mingw32]


>> a = IO.popen('ls "."', 'w')
=> #<IO:fd 4>
>> a.pid
=> 2104
>> Process.kill 0, 2104
=> 1 # should raise an exception since that process is dead now, 
shouldn't it? [it can be checked with GetExitCodeProcess != 
STILL_ACTIVE) ?

Thanks!
-r
Posted by Roger Pack (rogerdpack)
on 2012-09-28 09:44
(Received via mailing list)
Issue #7082 has been updated by rogerdpack (Roger Pack).


I see that the current way in windows somewhat mimic's how it operates 
in Unix (process is a zombie, so still responds to signals).  If so, 
perhaps it would be nice to create a new method

Process.alive?(pid)

that would be useful in certain cases, like checking if a process is 
dead before closing streams to it.

So maybe change this to a feature request, if anybody can confirm the 
above.

Thanks.
-roger-
----------------------------------------
Bug #7082: Process.kill 0 in windows can return spurious success
https://bugs.ruby-lang.org/issues/7082#change-29770

Author: rogerdpack (Roger Pack)
Status: Open
Priority: Normal
Assignee:
Category:
Target version:
ruby -v: ruby 1.9.3p194 (2012-04-20) [i386-mingw32]


>> a = IO.popen('ls "."', 'w')
=> #<IO:fd 4>
>> a.pid
=> 2104
>> Process.kill 0, 2104
=> 1 # should raise an exception since that process is dead now, 
shouldn't it? [it can be checked with GetExitCodeProcess != 
STILL_ACTIVE) ?

Thanks!
-r
Posted by usa (Usaku NAKAMURA) (Guest)
on 2012-09-28 09:59
(Received via mailing list)
Issue #7082 has been updated by usa (Usaku NAKAMURA).

Tracker changed from Bug to Feature


----------------------------------------
Feature #7082: Process.kill 0 in windows can return spurious success
https://bugs.ruby-lang.org/issues/7082#change-29771

Author: rogerdpack (Roger Pack)
Status: Open
Priority: Normal
Assignee:
Category:
Target version:


>> a = IO.popen('ls "."', 'w')
=> #<IO:fd 4>
>> a.pid
=> 2104
>> Process.kill 0, 2104
=> 1 # should raise an exception since that process is dead now, 
shouldn't it? [it can be checked with GetExitCodeProcess != 
STILL_ACTIVE) ?

Thanks!
-r
Posted by mame (Yusuke Endoh) (Guest)
on 2012-11-24 00:38
(Received via mailing list)
Issue #7082 has been updated by mame (Yusuke Endoh).

Status changed from Open to Assigned
Assignee set to usa (Usaku NAKAMURA)
Target version set to next minor


----------------------------------------
Feature #7082: Process.kill 0 in windows can return spurious success
https://bugs.ruby-lang.org/issues/7082#change-33672

Author: rogerdpack (Roger Pack)
Status: Assigned
Priority: Normal
Assignee: usa (Usaku NAKAMURA)
Category:
Target version: next minor


>> a = IO.popen('ls "."', 'w')
=> #<IO:fd 4>
>> a.pid
=> 2104
>> Process.kill 0, 2104
=> 1 # should raise an exception since that process is dead now, 
shouldn't it? [it can be checked with GetExitCodeProcess != 
STILL_ACTIVE) ?

Thanks!
-r
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.