This is the mail archive of the cygwin-patches@cygwin.com 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: Signal handling tune up.


On Mon, Aug 18, 2003 at 08:17:36PM -0400, Pierre A. Humblet wrote:
>*********************************************************************
>2)
>        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.

cgf


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