1.3.6: bug in fork(): kill(pid,0) does not always find child

Christopher Faylor cgf@redhat.com
Sat Jan 19 12:32:00 GMT 2002


On Fri, Jan 18, 2002 at 01:04:42PM +0100, Michael Haubenwallner wrote:
>There is a problem in fork(), in combination with kill(pid, 0)
>to check if the child is alive:
>
>When a fork() returned the pid to the parent, and the parent
>does a kill(pid, 0) to check if the child is alive, the kill
>sometimes return -1 and errno=ESRCH (No such process).

This should be fixed in the next release.

Basically, the problem was that the process was not considered to
actually "exist" since it couldn't respond to signals yet.  It
was still in the initialization phase.

I've removed that consideration from the "does the process exist"
part of cygwin.  Hopefully, this won't screw something else up.

Thanks much for the test case.

cgf

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list