This is the mail archive of the cygwin-patches mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Try to remove possible race pinfo::init


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]