Skip Menu |

This queue is for tickets about the Net-DNS CPAN distribution.

Report information
The Basics
Id: 8483
Status: resolved
Priority: 0/
Queue: Net-DNS

People
Owner: OLAF [...] cpan.org
Requestors: sebastiaan [...] kantoor.nederhost.nl
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.48
Fixed in: 0.49



Subject: eval tests for DNS::RR::SIG fail when using a die handler
Dear developers, I use Net-DNS-0.48 using Perl 5.8, but I have seen the same behaviour as I describe here in Perl 5.005 and Perl 5.6. When using a handler to catch die's (setting $SIG{'__DIE__'} to some subroutine reference) eval does not work as expected; instead of continuing the program when the evalled expression causes an exception the die-handler is called, resulting in the script to die. Net::DNS uses this construct at two places to check for DNS::RR::SIG; when this check fails and there is a custom die handler installed the script dies. This can easily be solved by localising $SIG{'__DIE__'}. Lines 44-46 of Net/DNS.pm currently read: BEGIN { $DNSSEC = eval { require Net::DNS::RR::SIG; 1 } ? 1 : 0; } To solve this bug this could be changed to: BEGIN { $DNSSEC = eval { local $SIG{'__DIE__'} = 'DEFAULT'; require Net::DNS::RR::SIG; 1 } ? 1 : 0; } Similarly, line 82 of Net/DNS/RR.pm which currently reads: eval { require Net::DNS::RR::SIG; }; could be changed to: eval { local $SIG{'__DIE__'} = 'DEFAULT'; require Net::DNS::RR::SIG; }; (But, in this last case, you might rather want to just check the $Net::DNS::DNSSEC variable you set earlier?) Kind regards, Sebastiaan Hoogeveen
Thanks for the suggestion Sebastian, This will be included in the next release (which might take a while to appear). STALLING the ticket until the the patch is in a publically available release. --Olaf