Skip Menu |

This queue is for tickets about the POE CPAN distribution.

Report information
The Basics
Id: 91406
Status: resolved
Priority: 0/
Queue: POE

People
Owner: RCAPUTO [...] cpan.org
Requestors: perl [...] pied.nu
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: __DIE__ can be unpredictable
Verious versions of perl and Test::More set $SIG{__DIE__} differently. This was causing one regression test to fail. This patch fixes that failure
Subject: Philip_Gwyn-POE-__DIE__01.patch
diff --git a/lib/POE/Kernel.pm b/lib/POE/Kernel.pm index a1fb948..32db1d9 100644 --- a/lib/POE/Kernel.pm +++ b/lib/POE/Kernel.pm @@ -1057,10 +1057,11 @@ sub _dispatch_event { # Quiet SIGDIE if it's DEFAULT. If it's something special, then # someone had better know what they're doing. + # 'DEFAULT', undef and '' are all the same my $old_sig_die = $SIG{__DIE__}; $SIG{__DIE__} = \&_dummy_sigdie_handler if ( - not defined $old_sig_die or $old_sig_die eq 'DEFAULT' + not defined $old_sig_die or $old_sig_die eq 'DEFAULT' or $old_sig_die eq '' ); eval { diff --git a/t/90_regression/leolo-sig-die.t b/t/90_regression/leolo-sig-die.t index 648c2b7..4d70f31 100644 --- a/t/90_regression/leolo-sig-die.t +++ b/t/90_regression/leolo-sig-die.t @@ -71,7 +71,7 @@ POE::Session->create( is( $ret, 42, 'scalar_ctx3 return value' ); # Undefine SIGDIE handler to cause a hard death. - $SIG{__DIE__} = undef; + $SIG{__DIE__} = ''; my @ret = $poe_kernel->call( $_[SESSION], 'array_ctx3' ); fail( 'array_ctx3 returned unexpectedly' ); }, @@ -84,7 +84,7 @@ POE::Session->create( array_ctx3 => sub { # now we throw an execption up to our __DIE__ handler - is($SIG{__DIE__}, undef, 'array_ctx3'); + is($SIG{__DIE__}, '', 'array_ctx3'); $WANT = "array_ctx3"; die "$WANT\nmore\n"; return ( 1..17 );
On Fri Dec 13 15:44:50 2013, GWYN wrote: Show quoted text
> Verious versions of perl and Test::More set $SIG{__DIE__} differently. > This was causing one regression test to fail. This patch fixes that > failure
Why isn't this pushed upstream?
Le Lun 07 Jui 2014 22:38:10, RCAPUTO a écrit : Show quoted text
> Why isn't this pushed upstream?
Upstream to who? The problem is various versions of Perl have different default values for __DIE__. Even if they fix it in future releases, we still have to work around the previous versions that are out in the wild. Or am I missing somthing obvious?
On Tue Jul 08 12:35:25 2014, GWYN wrote: Show quoted text
> Le Lun 07 Jui 2014 22:38:10, RCAPUTO a écrit :
> > Why isn't this pushed upstream?
> > Upstream to who?
Upstream to POE's public repository. I see by the format of the patch that it's in git, but I didn't see it in my working copy after I pulled changes.
I've committed this on your behalf: commit 90d04a311e463749dfeb10f3032866a723e7ca82 Author: Philip Gwyn <gwyn@cpan.org> Date: Fri Oct 31 11:12:11 2014 -0400 [rt.cpan.org 91406] Use empty string instead of undef for __DIE__ handler. The rt.cpan.org bug alleges that the empty string is more compatible. It doesn't seem to make a difference for contemporary versions of Perl, so why not?