in reply to Re: How "safe" is die() in %SIG?
in thread How "safe" is die() in %SIG?

Thanks. I was referring to calling die() in a SIG{INT}... I tried it in 5.6, and as expected, sometimes it works as advertised, sometimes it causes a core dump, and sometimes it just "goes away". I guess it's really time to go to 5.8.

Replies are listed 'Best First'.
Re: Re: Re: How "safe" is die() in %SIG?
by Elian (Parson) on May 22, 2003 at 18:55 UTC
    Calling die() inside a $SIG{INT} handler is definitely asking for trouble. Perl can and will segfault, as you've found. die allocates memory, which is a no-no inside an interrupt handler, hence the problem. 5.8 takes care of this, though there are downsides to that related to alarm and blocking system calls.