This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
RE: ICE for AutoGen-5.1.3
- To: 'Alexandre Duret-Lutz' <duret_g at lrde dot epita dot fr>, Bruce Korb <bkorb at allegronetworks dot com>, "'gcc at gcc dot gnu dot org'" <gcc at gcc dot gnu dot org>
- Subject: RE: ICE for AutoGen-5.1.3
- From: Bruce Korb <bkorb at allegronetworks dot com>
- Date: Thu, 8 Mar 2001 10:29:56 -0800
- Cc: "'Marc dot La-France at ualberta dot ca'" <Marc dot La-France at ualberta dot ca>
> Bruce> Outstanding detective work! The problem with GCC,
> then, is that it
> Bruce> is depending on being able to receive SIGCHLD (via
> wait4()), but
> Bruce> does not ensure its delivery by checking to see if it
> has been set
> Bruce> to SIG_IGN.
>
> Wow, I didn't understand this until I read
> http://www.uwsg.iu.edu/hypermail/linux/kernel/9606.3/0216.html
> It's horrible to think that all wait() callers have to ensure
> their SIGCHLD signal is not ignored on Linux.
>
> What about the Solaris compiler? You said it had a similar
> problem in the vicinity...
It is SCO's cc on Open Server. Well, I'm convinced from the
above letter that POSIX is out in the far reaches of left field.
The practical consequence is that all programs should automatically
invoke:
signal( SIGCHLD, SIG_DFL );
before doing anything else. It makes most sense to me to have
the signal handling state made consistent upon exec(). As Marc
pointed out, it is rather silly to use SIG_IGN/SIG_DFL as some
sort of passable boolean that a parent process can pass to a
child. In any event, GCC *MUST* invoke the above to avoid
spurious problems from inadvertently passed state.
You know what is really fun about this? The default state for
SIGCHLD is listed as "Ignore", but it is a lie:
SIGCHLD 18 Ignore Child Status Changed
[...]
Ignore When it gets the signal, the receiving process is to
ignore it. This is identical to setting the dispo-
sition to SIG_IGN.
I recommend a run time library change that pays attention
to an environment variable:
export BROKEN_POSIX_SIGCHLD_PASSING=true
to enable brain-damaged behavior :-(
Others may prefer:
export SIGCHLD_DEFAULT=true