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

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

Thread Previous | Thread Next
From:
Nick Ing-Simmons
Date:
February 1, 2003 03:22
Subject:
RE: [perl #20613] Perl_magic_setsig/clearsig problems (patch included)
Message ID:
20030201112212.1872.9@bactrian.ni-s.u-net.com
Anders Johnson <ajohnson@wischip.com> writes:
>Incidentally, there are some related issues that I've recently
>discovered:
>
>+ 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 http://www.gotw.ca/gotw/047.htm .)

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.
>
>Thanks,
>&ers
-- 
Nick Ing-Simmons
http://www.ni-s.u-net.com/


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About