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
Safe compartments with shared symbols causes Perl debugger to croak #15924
Comments
From @djeriusCreated by @djeriusI'm using Perl 5.22.1. Safe 2.39 I'm debugging a program which incidentally runs code in a Safe Here's test code: use warnings; use Safe; sub MyPkg::foo { 33; } my $safe= Safe->new; When run directly, I get the expected output: % perl tdebug.pl However, when run under the Perl debugger, the debugger is very unhappy: % perl -d tdebug.pl Loading DB routines from perl5db.pl version 1.49 Enter h or 'h h' for help, or 'man perldebug' for more help. main::(tdebug.pl:8): my $safe= Safe->new; Undefined subroutine &MyPkg::foo called at [...]/lib/5.22.1/perl5db.pl line 4183. Bug?, feature?, or am I forgetting some special sauce? Thanks, Perl Info
|
From @jkeenanOn Fri, 17 Mar 2017 19:11:35 GMT, djerius@cfa.harvard.edu wrote:
Well, buggy (at the very least). Note that the program's behavior depends in part upon the context in which $safe->reval('foo') is called. The attachment, as provided, is pretty much the same as your original post. When I run it through the debugger built on Perl 5 blead, I get: ##### <Undefined subroutine &MyPkg::foo called at lib/perl5db.pl line 4214.
I.e., I get a fatal error. The 'print' statement enforces list context. But suppose that I comment out the 'print' statement, then assign the return value of $safe->reval('foo') to a variable, then print the variable. The call to $safe->reval('foo') is no longer in list context. I now get: ##### Debugged program terminated. Use q to quit or R to restart, I no longer get a fatal error, just an uninitialized value warning. The plot thickens! Thank you very much. |
The RT System itself - Status changed from 'new' to 'open' |
From @jkeenanOn Sat, 30 Sep 2017 23:36:33 GMT, jkeenan wrote:
Error: The attachment as provided is the original post modified to demonstrate the non-list-context farther below. To get the program as the OP intended, uncomment the first 'print' statement and comment out the next two lines.
-- |
Migrated from rt.perl.org#131013 (status was 'open')
Searchable as RT131013$
The text was updated successfully, but these errors were encountered: