--On Sunday, July 29, 2001 4:02 AM -0400 Mike Alexander <mta(a)arbortext.com>
wrote:
This crash is, in my opinion, going to be hard to fix. It is a race
condition if a subprocess goes away at about the same time
mswindows_need_event is called. The handle for the subprocess may be in
the vector of things it waits on even though the subprocess is gone. The
only real way to fix this is to treat mswindows_need_event and the code
that manipulates mswindows_waitable_handles as a critical section using a
semaphore to control access to mswindows_waitable_handles.
After thinking about this some more, I don't think we can fix it even by
making a critical section of mswindows_need_event and the code that
manipulates mswindows_waitable_handles. Even if we know the list of
handles is valid immediately before the call to MsgWaitForMultipleObjects,
it might contain an stale handle by the time the operating system gets
around to looking at it. That's probably why there is a specific return
code for this case since it's hard to avoid passing a stale handle in all
cases.
Mike Alexander <mailto:mtaï¼ arbortext.com>
Arbortext, Inc. +1-734-997-0200