This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: ICE for AutoGen-5.1.3




>  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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]