__DIE__ handler not disabled when called from signal handler
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
perl (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: perl
$SIG{__DIE__} is supposed to be disabled before the handler is entered, so that the handler can call die without causing recursion.
However this is not happening when the original die was in the context of a signal handler AND if the die call in the __DIE__ handler includes the original die call's message within the inner die message.
What happens is that the original die invokes the __DIE__ handler as it should, but the __DIE__ handler is re-entered recursively when die is called again; the recursion occurs only the first time.
$ perl -we '$SIG{__DIE__}=sub{ die "__DIE__ handler (@_)\n Added text here\n"; }; $SIG{'INT'}=sub{die "SIGINT handler(
__DIE__ handler (__DIE__ handler (SIGINT handler(INT)
)
Added text here
)
Added text here
Attached is a somewhat more elaborate demo program.
ProblemType: Bug
Architecture: amd64
Date: Tue Mar 23 15:34:26 2010
DistroRelease: Ubuntu 9.10
NonfreeKernelMo
Package: perl-base 5.10.0-24ubuntu4
ProcEnviron:
PATH=(custom, user)
LANG=en_US.UTF-8
SHELL=/bin/bash
ProcVersionSign
SourcePackage: perl
Uname: Linux 2.6.31-20-generic x86_64