[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: RFC: sigaction module
From: |
Eric Blake |
Subject: |
Re: RFC: sigaction module |
Date: |
Tue, 17 Jun 2008 19:26:09 -0600 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.14) Gecko/20080421 Thunderbird/2.0.0.14 Mnenhy/0.7.5.666 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
According to Bruno Haible on 6/17/2008 7:17 PM:
|> @@ -96,11 +98,10 @@ init_fatal_signals (void)
|> struct sigaction action;
|>
|> if (sigaction (fatal_signals[i], NULL, &action) >= 0
|> + && (action.sa_flags & SA_SIGINFO) == 0
|> && action.sa_handler == SIG_IGN)
|> fatal_signals[i] = -1;
|> }
|
| What does this SA_SIGINFO business mean? Why do you need to check whether
| (sa_flags & SA_SIGINFO) == 0 when sa_handler is known to be SIG_IGN?
Pre-existing bug. POSIX states that sa_handler and sa_siginfo may, but
not must, occupy overlapping space, and that sa_handler must not be
accessed if sa_flags includes SA_SIGINFO. Therefore, it is conceivable to
have an implementation where action.sa_handler is garbage and happens to
be SIG_IGN, because only action.sa_siginfo was valid to access. (In
reality, all implementations I am aware of, including my replacement, use
a union and let the two function definitions overlap, so this is more of a
theoretical bug fix.) Should I use a separate commit for this bug fix?
- --
Don't work too hard, make some time for fun as well!
Eric Blake address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkhYZDEACgkQ84KuGfSFAYBpeQCgwAlcZfCBTAXgN1xEw17L4cfE
eQcAnRjn08ozxDAxn4vzP0JjkZ9puxD3
=Q2J+
-----END PGP SIGNATURE-----
- RFC: sigaction module, Eric Blake, 2008/06/16
- Re: RFC: sigaction module, Paul Eggert, 2008/06/16
- Re: RFC: sigaction module, Bruno Haible, 2008/06/17
- Re: RFC: sigaction module,
Eric Blake <=
- Re: sigaction, SA_SIGINFO, and SIG_IGN, Bruno Haible, 2008/06/17
- Re: sigaction, SA_SIGINFO, and SIG_IGN, Eric Blake, 2008/06/17
- Re: sigaction, SA_SIGINFO, and SIG_IGN, Bruno Haible, 2008/06/18
- RE: sigaction, SA_SIGINFO, and SIG_IGN, Jason Zions, 2008/06/18
- Re: sigaction, SA_SIGINFO, and SIG_IGN, Bruno Haible, 2008/06/19
- Re: Interix, Bruno Haible, 2008/06/19
- Re: sigaction, SA_SIGINFO, and SIG_IGN, Paul Eggert, 2008/06/19
- Re: sigaction, SA_SIGINFO, and SIG_IGN, Bruno Haible, 2008/06/19
- Re: sigaction, SA_SIGINFO, and SIG_IGN, Paul Eggert, 2008/06/20
- Re: sigaction, SA_SIGINFO, and SIG_IGN, Eric Blake, 2008/06/20