Signal handler not executed

Christopher Faylor
Mon Aug 13 20:44:00 GMT 2007

On Mon, Aug 13, 2007 at 12:25:49PM -0700, Peter Rehley wrote:
> On Aug 9, 2007, at 10:19 AM, Christopher Faylor wrote:
>>On Thu, Aug 09, 2007 at 01:09:48PM -0400, Ernie Coskrey wrote:
>>>There's a very small window of vulnerability in _sigbe, which can lead
>>>to signal handlers not being executed.  In _sigbe, the _cygtls lock is
>>>released before incyg is decremented.  If setup_handler acquires the
>>>lock just after _sigbe releases it, but before incyg is decremented,
>>>setup_handler will mistakenly believe that the thread is in Cygwin
>>>code, and will set up the interrupt using the tls stack.
>>>_sigbe should decrement incyg before releasing the lock.
>>I'll apply this but are you saying that this actually fixes your
>>problem or that you think it fixes your problem?
>I noticed in the cvs log that at one point you changed from what the
>patch applied to releasing incyg later.  (version 1.22 to 1.23 of
>gendef).  Do you remember why you did this change?  and could this
>patch break what you tried fixing earlier?

No, I don't, unfortunately.  The fact that this has moved back and forth
in the code is one of the reasons I'm not handing out attaboys or
issuing gold stars.  Experience has shown that usually when someone
makes a change in the signal code or the cygwin startup code, I'll
usually have to go in and heavily tweak it later.

That's not a reflection on anybody's skill.  It's just very complicated
and error prone section of the code.  It is amazing that anyone can
understand it at all since I have to relearn it every time I make a


More information about the Cygwin-patches mailing list