bug-gnulib
[Top][All Lists]
Advanced

[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-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]