[1.7] sigwait bug (SIGCHLD delayed to a next regular signal)

Waldemar Rachwal waldemar.rachwal@gmail.com
Mon Sep 21 18:02:00 GMT 2009


Christopher Faylor <cgf-use-the-mailinglist-please <at> cygwin.com> writes:

> >
> >To satisfy the condition (quoted from posix) "action is anything other
> >than to ignore", SIGCHLD (and all other signals which default action is
> >to ignore) must be setup a handler even if it seems "not useful".
> >Being blocked is not sufficient.
> 
> Ok.  Yes, I was wrong about the meaning of action but, as I said, this
> works fine on Linux without setting a dummy handler.  The reason for that
> is that SIGCHLD is, by default, set to SIG_DFL not SIG_IGN.

I knew that. My understanding of "action is anything to ignore" was
(and still is): either SIG_DFL + "default action to ignore"
or forcibly ignored by a user by means of SIG_IGN.

> To quote from Roland McGrath (one of the glibc maintainers):
> 
> "When a signal is set to SIG_IGN, it's true that the signal may be
> dropped at generation time and never recorded.  But POSIX does not allow
> this for signals set to SIG_DFL, even when the default action for the
> signal is to ignore it. In this case, the rule when the signal is
> blocked is that it must become pending--this allows a sigaction call
> before unblocking the signal to change its action."


So then, how would you interpret the following statement (from POSIX)?

(2.4.3 Signal Actions / SIG_DFL, 6th paragraph)
http://www.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_04_03_01

"Setting a signal action to SIG_DFL for a signal that is pending,
and whose default action is to ignore the signal (for example, SIGCHLD),
shall cause the pending signal to be discarded,
whether or not it is blocked."

Interesting, isn't it? ;)

> 
> This comment comes from a bug report which eventually resulted in a fix
> to the linux kernel.
>

Linux is useful, but isn't any proof. From the fact they change it,
one of the implementation may be wrong, and nobody says newer is better :)
Sorry, I am not a guru and may be wrong, but still trying to understand
the subject while reading the standard.

Regards,
Waldemar.


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple



More information about the Cygwin mailing list