On Fri, Sep 22, 2006 at 03:32:28PM +0100, Oliver Rees wrote:
> I have been looking at your Event module to see if it might solve a
> problem I am experiencing with signal handling using perl 5.8.0 on Red
> Hat AS 3.
>
> I have a module which forks a number of processes and captures the
> exit codes via a handler defined for $SIG{CHLD}. I have listed the
> reaper handler below. 99% of the time it works fine - but every so
> often, a process exitcode is recorded as 255 and the signal that
> apparently terminated it as 127 - which I do not believe is accurate.
> I have restricted my waitpid() calls to specific process IDs.
Hrm, here's some info from the perl FAQ:
Perl versions before 5.8 had in its C source code signal handlers
which
would catch the signal and possibly run a Perl function that you
had
set in %SIG. This violated the rules of signal handling at that
level
causing perl to dump core. Since version 5.8.0, perl looks at
%SIG
*after* the signal has been caught, rather than while it is being
caught.
> Is there an obvious/common explanation for this behaviour? If so, how
> does the Event module handle it?
If the above is true, I don't think Event does it any less correctly
than perl.