Signal handling tune up.

Christopher Faylor
Tue Aug 19 01:58:00 GMT 2003

On Mon, Aug 18, 2003 at 08:17:36PM -0400, Pierre A. Humblet wrote:
>        movl    $0,%0                   # zero the signal number as a   \n\
>                                        # flag to the signal handler thread\n\
>                                        # that it is ok to set up sigsave\n\
>                                                                        \n\
>       call    _set_process_mask@4
>There is a race where the sigthread can start a handler for a signal that
>should be blocked.
>Simply interchanging the order still allows the sigthread to try to launch 
>a handler (before the mask is set), discovers that sigsave is busy and takes 
>cumbersome actions (e.g. Sleep).
>The patch moves set_process_mask all the way up to interrupt_setup(), so
>it is set in the sigthread itself.

I only applied the reversal of the movl with the call above since I'm
not convinced that moving the set_process_mask into interrupt_setup
doesn't introduce a race.  It seems like your code could be setting the
signal mask in interrupt_setup while it is also being restured in
sigreturn.  That would end up with the signal mask being indeterminate.


More information about the Cygwin-patches mailing list