Project

General

Profile

Feature #7082

Process.kill 0 in windows can return spurious success

Added by Roger Pack over 3 years ago. Updated over 3 years ago.

Status:
Assigned
Priority:
Normal
[ruby-core:47719]

Description

a = IO.popen('ls "."', 'w')
=> #
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

History

#1 [ruby-core:47720] Updated by Roger Pack over 3 years ago

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-

#2 [ruby-core:47721] Updated by Usaku NAKAMURA over 3 years ago

  • Tracker changed from Bug to Feature

#3 [ruby-core:49913] Updated by Yusuke Endoh over 3 years ago

  • Status changed from Open to Assigned
  • Assignee set to Usaku NAKAMURA
  • Target version set to next minor

Also available in: Atom PDF