New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
perl5db.pl corrupts $SIG{__DIE__} in BEGIN blocks #9579
Comments
From siracusa@gmail.comThis is a bug report for perl from siracusa@gmail.com, Much of this report is copied and pasted from the following URL: http://stackoverflow.com/questions/322173 Consider the following code: BEGIN sub new { bless {}, shift } package main; eval { die MyEx->new }; if($@) print "OK\n"; Run it and it prints "OK" as expected. Run it in the debugger, however, Can't call method "isa" without a package or object reference ... The upshot is that $@ is not an object when the code runs under the " at somefile.pl line 9 (Internal newlines and spacing preserved. That's the literal text of the Setting dieLevel to 0, either through the use of a ~/.perldb file containing: parse_options('dieLevel=0') or by setting the PERLDB_OPT environment variablt to "dieLevel=0", did not local()izing $SIG{__DIE__} inside the eval block is a workaround, but Here's an explanation of the bug from brian d foy: This is a problem with perl5db.pl creating __DIE__ handlers. If I localize eval If you don't do that, you're getting the handler from DB::dbdie, which uses You're supposed to turn this off with: PERLDB_OPT="dieLevel=0" perl5.10.0 -d program But there is still a code reference in $SIG{__DIE__} after that, and it's a # perl5db.pl dieLevel, around line 7777 But notice that after restoring $SIG{__DIE__}, it keeps the previous value So, that's as far as I got before I didn't want to think about perl5db.pl It seems like another workaround could be to change the default dieLevel BTW, the "perldoc perldebug" documentation seems to imply that the default "By default, the debugger leaves your exceptions and warnings alone, so apparently that patch in 2001 that brian refers to only updated the -John Flags: Site configuration information for perl 5.10.0: Configured by john at Sat Sep 20 20:27:53 EDT 2008. Summary of my perl5 (revision 5 version 10 subversion 0) configuration: Locally applied patches: @INC for perl 5.10.0: Environment for perl 5.10.0: |
From @rgs2008/11/28 via RT John Siracusa <perlbug-followup@perl.org>:
Here's a pointer to the patch : I don't know what defaults are preferable for dielevel and warnlevel |
The RT System itself - Status changed from 'new' to 'open' |
From @kevindawsonbrian d foy++ looks like no one has checked this recently either! well all is now well in perl5db.pl version 1.42 that is what I used to test with. I suspect this is another item fixed by shlom-fish wake :) PERLDB_OPTS="dieLevel=0" #works or we could just reset the default to 0 as suggested by brian as that imho we should close this and discuss else whare wether 0 should be the |
From [Unknown Contact. See original ticket]brian d foy++ looks like no one has checked this recently either! well all is now well in perl5db.pl version 1.42 that is what I used to test with. I suspect this is another item fixed by shlom-fish wake :) PERLDB_OPTS="dieLevel=0" #works or we could just reset the default to 0 as suggested by brian as that imho we should close this and discuss else whare wether 0 should be the |
Migrated from rt.perl.org#60890 (status was 'open')
Searchable as RT60890$
The text was updated successfully, but these errors were encountered: