develooper Front page | perl.perl5.porters | Postings from February 2003

RE: [perl #20613] Perl_magic_setsig/clearsig problems (patch included)

Nick Ing-Simmons
February 1, 2003 03:22
RE: [perl #20613] Perl_magic_setsig/clearsig problems (patch included)
Message ID:
Anders Johnson <> writes:
>Incidentally, there are some related issues that I've recently
>+ If a signal is received just as you're changing its disposition from a
>handler to DEFAULT, then the signal could get deferred until after the
>disposition changes, which generally results in badness. (I already have
>a patch for this one.)

If the signal had arrived slightly later (machine busier)
it would have gone to DEFAULT handler - so changing handlers when 
signals maybe in the pipe is source of the "badness".

>+ It's still not safe for a signal handler to die() (which is otherwise
>very useful), because it can prevent a DESTROY method from doing its
>job. (This is analogous to the "destructors must never, ever throw" rule
>in C++. See .)

Can you explain some more?

>I think that fixing the second issue requires adding some
>critical-section support to Perl itself. (Perhaps a $^E variable that
>inhibits signal sampling and is automatically set locally for any
>DESTROY and STORE methods that get called on behalf of a block exiting.)
>If such a thing were to exist, then you could certainly call my test
>case contrived, since you could then use "local $^E=1;" to accomplish
>basically the same thing.
>Of course, I'm all ears if you have any better ideas. I'm particularly
>fond of any solution that doesn't require modifying the Perl core, so
>long as it's clean and robust.
Nick Ing-Simmons Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About