Weird signal handling bug 221635

Scott James Remnant scott at canonical.com
Fri May 2 16:39:56 BST 2008


On Thu, 2008-05-01 at 20:24 +0100, Colin Watson wrote:

> > My only guess would be some sloppy handling of a struct sigaction somewhere
> > which led to it being re-used with old data.  I noticed the code saves and
> > restores the SIGCHLD action a few times...
> 
> True, but that's done with:
> 
> #ifdef SA_RESTART
>         /* We rely on getting EINTR from select. */
>         sigaction (SIGCHLD, NULL, &sa);
>         sa.sa_flags &= ~SA_RESTART;
>         sigaction (SIGCHLD, &sa, NULL);
> #endif
> 
> [...]
> 
> #ifdef SA_RESTART
>         sigaction (SIGCHLD, NULL, &sa);
>         sa.sa_flags |= SA_RESTART;
>         sigaction (SIGCHLD, &sa, NULL);
> #endif
> 
This will give you a race condition, but won't cause the bug you're
seeing that I know of.

Scott
-- 
Scott James Remnant
scott at canonical.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/ubuntu-devel/attachments/20080502/29ee1136/attachment.pgp 


More information about the ubuntu-devel mailing list