__DIE__ handler not disabled when called from signal handler

Bug #545574 reported by jimav
6
This bug affects 1 person
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(@_)\n"};kill 2,$$;'
__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
NonfreeKernelModules: fglrx
Package: perl-base 5.10.0-24ubuntu4
ProcEnviron:
 PATH=(custom, user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.31-20.58-generic
SourcePackage: perl
Uname: Linux 2.6.31-20-generic x86_64

Revision history for this message
jimav (james-avera) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.