# New Ticket Created by "Ãvar Arnfjörð Bjarmason" # Please include the string: [perl #76138] # in the subject line of all future correspondence about this issue. # <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=76138 > As of f746176000 (Bareword sub lookups) by Zefram there's a regression in how perl handles signals: After f746176000: $ echo 'package Moo;sub x {Y::SIG->z};1' > /tmp/Moo.pm; perl -le'print $]; @INC = "/tmp"; $SIG{INT} = sub { warn "foo\n" }; require Moo; sleep 30' 5.013002 ^CSignal SIGINT received, but no signal handler set. Before: $ echo 'package Moo;sub x {Y::SIG->z};1' > /tmp/Moo.pm; /usr/bin/perl -le'print $]; @INC = "/tmp"; $SIG{INT} = sub { warn "foo\n" }; require Moo; sleep 30' 5.010001 ^Cfoo Compiling Y::SIG->z is inadvertently overwriting %SIG. This might also apply to some other symbols, but didn't with @INC and %ENV when I tried them. This bug was discovered in the wild when using signal handlers with Net::DNS. When 'Net::DNS::RR::SIG->create..' was compiled the user's signal handler was destroyed: lib/Net/DNS/Packet.pm 677:SIG0 support is provided through the Net::DNS::RR::SIG class. This class is not part 685:SIG0 support is experimental see Net::DNS::RR::SIG for details. 687:The method will call C<Carp::croak()> if Net::DNS::RR::SIG cannot be found. 701: if ( UNIVERSAL::isa($arg,'Net::DNS::RR::SIG') ) { 705: $sig0 = Net::DNS::RR::SIG->create('', $arg); 707: } elsif ( UNIVERSAL::isa($arg,'Net::DNS::RR::SIG::Private') ) { 709: $sig0 = Net::DNS::RR::SIG->create('', $arg); 717: $sig0 = Net::DNS::RR::SIG->create('', $arg);Thread Previous | Thread Next