Try to remove possible race pinfo::init

Christopher Faylor cgf-no-personal-reply-please@cygwin.com
Fri Jul 29 14:32:00 GMT 2005


On Fri, Jul 29, 2005 at 01:39:14PM +0300, Arto Huusko wrote:
>On some systems, I was frequent segmentation faults on fork(), and
>I was able to track it down to the patch I just sent. However, my
>scripts don't run much better, because they now fail only a bit
>more cleanly with "fork: Resource temporarily unavailable".
>
>Since my previous patch transformed seg faults to EAGAIN errors,
>I tried to find potential races or other errors in pinfo::init.
>I didn't really take the time to try to understand the code, but
>if I'm guessing right, the MapViewOfFileEx() call is doing something
>that depends on the child. If that's right, then it seems to me
>that the retry loop in open_shared() failure case is a bit too
>tight.
>
>
>2005-07-29  Arto Huusko  <arto.huusko@wmdata.fi>
>
>	* pinfo.cc (pinfo::init): Sleep before retrying open_shared().

I've applied this, although it's difficult for me to see how it could
have actually been a real problem since the loop in question iterates
for 20 times and this condition is only supposed to happen when the
address space set aside for the pinfo structure is already in use.

Thanks.

cgf



More information about the Cygwin-patches mailing list