Subject: | AnyEvent DIEs if $SIG{__DIE__} is used |
AnyEvent die if $SIG{__DIE__} defined.
Attached test-case.pl dies with message:
DIE: Can't locate Async/Interrupt.pm in @INC (@INC contains:
/usr/local/lib/perl5/5.10.1/BSDPAN
/usr/local/lib/perl5/site_perl/5.10.1/mach
/usr/local/lib/perl5/site_perl/5.10.1 /usr/local/lib/perl5/5.10.1/mach
/usr/local/lib/perl5/5.10.1 /usr/local/vega/lib/perl5/5.10.1/mach
/usr/local/vega/lib/perl5/5.10.1 /usr/local/vega/lib/perl5 .) at (eval
21) line 1.
But it works as need if string
local $SIG{__DIE__} = sub { warn 'DIE: '.$_[0]; exit };
commented out.
Path to fix this bug attached.
----
version info:
This is perl, v5.10.1 (*) built for amd64-freebsd
AnyEvent 5.271
Subject: | test-case.pl |
#!/usr/bin/perl
use warnings;
use strict;
use AnyEvent;
local $SIG{__DIE__} = sub { warn 'DIE: '.$_[0]; exit };
my $done = AnyEvent->condvar;
my $pid = fork or exit 5;
my $w = AnyEvent->child (
pid => $pid,
cb => sub {
my ($pid, $status) = @_;
warn "pid $pid exited with status $status";
$done->send;
},
);
# do something else, then wait for process exit
$done->recv;
Subject: | eval.patch |
--- /usr/local/lib/perl5/site_perl/5.10.1/AnyEvent.pm.orig 2010-09-10 15:30:09.000000000 +0000
+++ /usr/local/lib/perl5/site_perl/5.10.1/AnyEvent.pm 2010-09-10 15:31:53.000000000 +0000
@@ -1513,7 +1513,8 @@ sub sig2name($) { &$_sig_name_init; &sig
sub signal {
eval q{ # poor man's autoloading {}
- # probe for availability of Async::Interrupt
+ local $SIG{__DIE__};
+ # probe for availability of Async::Interrupt
if (_have_async_interrupt) {
warn "AnyEvent: using Async::Interrupt for race-free signal handling.\n" if $VERBOSE >= 8;