snapshot 20050114 race (on list)

Pierre A. Humblet
Sat Jan 22 18:51:00 GMT 2005

At 01:00 PM 1/22/2005 -0500, Christopher Faylor wrote:
>On Wed, Jan 19, 2005 at 10:30:12AM -0500, Pierre A. Humblet wrote:
>>A similar issue of Cygwin vs.  Windows process termination time occurs
>>when proc_waiter calls maybe_set_exit_code_from_windows().
>>GetExitCodeProcess might well return STILL_ACTIVE.  It's unsafe to poll
>>until that value changes, so there should be a WaitFor(hProcess).  No
>>further WaitFor is necessary when calling set_exit_code when exiting
>>after a spawn.
>I've lost track.  Have you actually demonstrated that there is a race
>due to the closing of the pipe on process termination?

I have shown in
that determining process termination from parent_alert(0) can cause problems.

I just removed parent_alert(0) from :exit, so that process termination is
determined from pipe closure. Now I can't trigger the rmdir problem on my
system (with exim). It's reasonable that Windows would close the pipe at
about the same time as the cwd...

Whether GetExitCodeProcess might still return STILL_ACTIVE when the pipe
is closed has not been investigated.
I don't plan to try, it might be system dependent. For example I was unable to
reproduce the original problem reported by Eric Blake.


More information about the Cygwin-developers mailing list