Skip Menu |
 

This queue is for tickets about the Devel-Symdump CPAN distribution.

Report information
The Basics
Id: 43675
Status: open
Priority: 0/
Queue: Devel-Symdump

People
Owner: Nobody in particular
Requestors: jmmills [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 2.08
Fixed in: (no value)



Subject: Segfault bug in rnew->packages from Test::Class+Moose+Test::WWW::Mechanize::Catalyst
Download (untitled) / with headers
text/plain 2.7k
It seems their is something going on in Devel::Symdump::_symdump under rnew() (recursive) that is causing a segfault. The stack trace shows Test::Class uses Devel::Symdump to discover packages that are "tests". The usage is trivial and I suspect Devel::Symdump shouldn't segfault no matter what packages have been loaded :) Below (and attached) is the code I'm using - the versions of relivant package - my system id (ubuntu) and the strack trace output from the perldebugger. Sorry, I couldn't give you more but I'm not very handy with gdb+perl. -- cut -- package Mech; use Moose; use Scalar::Util 'blessed'; use Test::XML::RPC::Catalyst; use Test::WWW::Mechanize::JSON; extends qw[Test::WWW::Mechanize::Catalyst]; 1; package Case; BEGIN { use Moose; use Mech; extends qw[Test::Class Moose::Object]; } has 'mech' => ( is => 'ro', isa => 'Mech', lazy_build => 1, ); has uri => ( is => 'ro', isa => 'Str', builder => 'build_uri', lazy => 1, required => 1 ); sub _build_mech { return Mech->new(); }; 1; package ATest; BEGIN { use self; use Moose; extends 'Case'; } sub build_uri { '/test/abc/'; } sub t1_foo : Tests { self->builder->ok(1); self->builder->ok(1); self->builder->ok(1); self->builder->ok(1); } 1; # $Moose::VERSION == 0.68 # $Test::XML::RPC::Catalyst::VERSION == 0.01 # $Scalar::Util::VERSION == 1.19 # $Test::WWW::Mechanize::JSON::VERSION == 0.2 # $Test::WWW::Mechanize::Catalyst::VERSION == 0.50 # $Test::Class::VERSION == 0.31 # $Devel::Symdump::VERSION == 2.08 /tmp$ perl -MATest -d -e 'ATest->runtests();' Loading DB routines from perl5db.pl version 1.3 Editor support available. Enter h or `h h' for help, or `man perldebug' for more help. Attribute::Handlers::CODE(0x9938358)(/usr/share/perl/5.10/Attribute/Handlers.pm:221): 221: $global_phase++; DB<1> c Signal SEGV at /usr/local/share/perl/5.10.0/Devel/Symdump.pm line 114 Devel::Symdump::_symdump('Devel::Symdump=HASH(0x99d2478)', 'version', 'namespace', 'Case', 'Tie', 'Devel', 'U64', 'Encode', 'Regexp', ...) called at /usr/local/share/perl/5.10.0/Devel/Symdump.pm line 114 Devel::Symdump::_symdump('Devel::Symdump=HASH(0x99d2478)', 'main') called at /usr/local/share/perl/5.10.0/Devel/Symdump.pm line 43 Devel::Symdump::_doit('Devel::Symdump=HASH(0x99d2478)') called at /usr/local/share/perl/5.10.0/Devel/Symdump.pm line 30 Devel::Symdump::rnew('Devel::Symdump') called at /usr/local/share/perl/5.10.0/Test/Class.pm line 309 Test::Class::_test_classes('ATest') called at /usr/local/share/perl/5.10.0/Test/Class.pm line 318 Test::Class::runtests('ATest') called at -e line 1 Aborted /tmp$ cat /proc/version Linux version 2.6.27-12-generic (buildd@palmer) (gcc version 4.3.2 (Ubuntu 4.3.2-1ubuntu12) ) #1 SMP Thu Feb 5 09:26:35 UTC 2009
Subject: debug.out
Download debug.out
application/octet-stream 2.1k

Message body not shown because it is not plain text.

Download (untitled) / with headers
text/plain 103b
Also it case it matters: # $WWW::Mechanize::VERSION == 1.54 # $Test::WWW::Mechanize::VERSION == 1.20
Download (untitled) / with headers
text/plain 4.2k
Ok, did some more tracing (fyi this is ubuntu vender perl 5.10.0) And it seems that if you break before local(*ENTRY) = $val (in Devel::Symdump::_symdump) and step in from their the segv is happing at ret_backtrace() inside Carp::Heavy. I'm not sure why local(*ENTRY) = $val is jumping to Carp... Here is my perldebug output: DB<1> c Devel::Symdump::_symdump(/home/jason/.cpanplus/5.10.0/build/Devel-Symdump-2.08/lib//Devel/Symdump.pm:55): 55: my $gotone = 0; DB<1> DB<1> n Devel::Symdump::_symdump(/home/jason/.cpanplus/5.10.0/build/Devel-Symdump-2.08/lib//Devel/Symdump.pm:56): 56: local(*ENTRY) = $val; DB<1> Devel::Symdump::_symdump(/usr/share/perl/5.10/Carp.pm:28): 28: sub longmess { goto &longmess_jmp } DB<1> s Carp::longmess_real(/usr/share/perl/5.10/Carp/Heavy.pm:39): 39: my $call_pack = caller(); DB<1> n Carp::longmess_real(/usr/share/perl/5.10/Carp/Heavy.pm:40): 40: if ($Internal{$call_pack} or $CarpInternal{$call_pack}) { DB<1> n Carp::longmess_real(/usr/share/perl/5.10/Carp/Heavy.pm:44): 44: local $CarpLevel = $CarpLevel + 1; DB<1> n Carp::longmess_real(/usr/share/perl/5.10/Carp/Heavy.pm:45): 45: return longmess_heavy(@_); DB<1> s Carp::longmess_heavy(/usr/share/perl/5.10/Carp/Heavy.pm:174): 174: return @_ if ref($_[0]); # don't break references as exceptions DB<1> n Carp::longmess_heavy(/usr/share/perl/5.10/Carp/Heavy.pm:175): 175: my $i = long_error_loc(); DB<1> n Carp::longmess_heavy(/usr/share/perl/5.10/Carp/Heavy.pm:176): 176: return ret_backtrace($i, @_); DB<1> s Carp::ret_backtrace(/usr/share/perl/5.10/Carp/Heavy.pm:182): 182: my ($i, @error) = @_; DB<1> n Carp::ret_backtrace(/usr/share/perl/5.10/Carp/Heavy.pm:183): 183: my $mess; DB<1> Carp::ret_backtrace(/usr/share/perl/5.10/Carp/Heavy.pm:184): 184: my $err = join '', @error; DB<1> Carp::ret_backtrace(/usr/share/perl/5.10/Carp/Heavy.pm:185): 185: $i++; DB<1> Carp::ret_backtrace(/usr/share/perl/5.10/Carp/Heavy.pm:187): 187: my $tid_msg = ''; DB<1> Carp::ret_backtrace(/usr/share/perl/5.10/Carp/Heavy.pm:188): 188: if (defined &threads::tid) { DB<1> Carp::ret_backtrace(/usr/share/perl/5.10/Carp/Heavy.pm:193): 193: my %i = caller_info($i); DB<1> Carp::ret_backtrace(/usr/share/perl/5.10/Carp/Heavy.pm:194): 194: $mess = "$err at $i{file} line $i{line}$tid_msg\n"; DB<1> Carp::ret_backtrace(/usr/share/perl/5.10/Carp/Heavy.pm:196): 196: while (my %i = caller_info(++$i)) { DB<1> Carp::ret_backtrace(/usr/share/perl/5.10/Carp/Heavy.pm:197): 197: $mess .= "\t$i{sub_name} called at $i{file} line $i{line}$tid_msg\n"; DB<1> Carp::ret_backtrace(/usr/share/perl/5.10/Carp/Heavy.pm:197): 197: $mess .= "\t$i{sub_name} called at $i{file} line $i{line}$tid_msg\n"; DB<1> Carp::ret_backtrace(/usr/share/perl/5.10/Carp/Heavy.pm:197): 197: $mess .= "\t$i{sub_name} called at $i{file} line $i{line}$tid_msg\n"; DB<1> Carp::ret_backtrace(/usr/share/perl/5.10/Carp/Heavy.pm:197): 197: $mess .= "\t$i{sub_name} called at $i{file} line $i{line}$tid_msg\n"; DB<1> Carp::ret_backtrace(/usr/share/perl/5.10/Carp/Heavy.pm:197): 197: $mess .= "\t$i{sub_name} called at $i{file} line $i{line}$tid_msg\n"; DB<1> Carp::ret_backtrace(/usr/share/perl/5.10/Carp/Heavy.pm:197): 197: $mess .= "\t$i{sub_name} called at $i{file} line $i{line}$tid_msg\n"; DB<1> Carp::ret_backtrace(/usr/share/perl/5.10/Carp/Heavy.pm:200): 200: return $mess; DB<1> Signal SEGV at /home/jason/.cpanplus/5.10.0/build/Devel-Symdump-2.08/lib//Devel/Symdump.pm line 115 Devel::Symdump::_symdump('Devel::Symdump=HASH(0xac84940)', 'version', 'Tie', 'Devel', 'U64', 'Encode', 'Regexp', 'UNIVERSAL', 'Tk', ...) called at /home/jason/.cpanplus/5.10.0/build/Devel-Symdump-2.08/lib//Devel/Symdump.pm line 115 Devel::Symdump::_symdump('Devel::Symdump=HASH(0xac84940)', 'main') called at /home/jason/.cpanplus/5.10.0/build/Devel-Symdump-2.08/lib//Devel/Symdump.pm line 43 Devel::Symdump::_doit('Devel::Symdump=HASH(0xac84940)') called at /home/jason/.cpanplus/5.10.0/build/Devel-Symdump-2.08/lib//Devel/Symdump.pm line 30 Devel::Symdump::rnew('Devel::Symdump') called at /usr/local/share/perl/5.10.0/Test/Class.pm line 309 Test::Class::_test_classes('Foo') called at /usr/local/share/perl/5.10.0/Test/Class.pm line 318 Test::Class::runtests('Foo') called at -e line 1 Aborted (core dumped)
Download (untitled) / with headers
text/plain 191b
So some further digging has show that the "local *ENTITY = $val" code blows up (segv's) when it comes across the Compress::Zlib's GZIP_NULL_TYPE constant which make $val eq a GLOB reference.
I've attached a test case that should show configurations that have this bug...
use strict; use warnings; use Test::More 'no_plan'; use English; diag("OS == $^O"); use_ok('Compress::Zlib'); use_ok('Devel::Symdump'); diag('$Devel::Symdump::VERSION == '.$Devel::Symdump::VERSION); diag('$Compress::Zlib::VERSION == '.$Compress::Zlib::VERSION); diag("Perl == $]"); my $glob_ref = eval { no strict 'refs'; ${*{"Compress::Zlib::"}}{GZIP_NULL_BYTE}; }; ok(!$@,'reference assignment'); diag('ref($glob_ref) == "'.ref($glob_ref).'"'); _check_child(sub { local *ENTRY; diag "Checking GLOB assignment to reference..."; *ENTRY = $glob_ref; }); _check_child(sub { diag "Checking Devel::Symdump->rnew->packages..."; Devel::Symdump->rnew->packages; }); sub _check_child { local *CHILD; my $code = shift; my $pid = open(CHILD, "|-"); unless ($pid) { $code->(); exit 0; } else { my $w = waitpid($pid,0); ok($w != -1 && $w == $pid,'waitpid()'); my $e = $? >> 8; my $s = $? & 127; my $c = $? & 128; diag "exit value = $e"; diag "exit with signal = $s"; diag "dumped core? $c"; ok($s != 11,'child did not SEGV'); ok($e == 0 && $s == 0,'child exited properly'); } }
Subject: Re: [rt.cpan.org #43675] Segfault bug in rnew->packages from Test::Class+Moose+Test::WWW::Mechanize::Catalyst
Date: Sun, 01 Mar 2009 10:32:39 +0100
To: bug-Devel-Symdump [...] rt.cpan.org
From: andreas.koenig.7os6VVqR [...] franz.ak.mind.de (Andreas J. Koenig)
Download (untitled) / with headers
text/plain 306b
Show quoted text
>>>>> On Sun, 01 Mar 2009 01:08:52 -0500, "Jason M. Mills via RT" <bug-Devel-Symdump@rt.cpan.org> said:
Show quoted text
> I've attached a test case that should show configurations that have this > bug...
Excellent! New release 2.08_51 is uploaded to cpan. We'll see what comes back from the cpantesters. Thank you!
Download (untitled) / with headers
text/plain 100b
http://search.cpan.org/dist/Devel-Symdump/ does not show the new release. Has something gone astray?
Subject: Re: [rt.cpan.org #43675] Segfault bug in rnew->packages from Test::Class+Moose+Test::WWW::Mechanize::Catalyst
Date: Tue, 31 Mar 2009 18:45:33 +0200
To: bug-Devel-Symdump [...] rt.cpan.org
From: andreas.koenig.7os6VVqR [...] franz.ak.mind.de (Andreas J. Koenig)
Download (untitled) / with headers
text/plain 142b
Show quoted text
> http://search.cpan.org/dist/Devel-Symdump/ does not show the new > release. Has something gone astray?
Which new release? -- andreas
Download (untitled) / with headers
text/plain 851b
I'm encountering the same segfault issue with other CPAN modules. In this case, PDF::API2. For example, on RHEL4, PDF::API2 v0.72, Devel::SymDump 2.08: perl -MDevel::Symdump -MPDF::API2 -e 'Devel::Symdump->rnew->packages' Signal SEGV at /home/jeff/lib/perl5/site_perl/5.10.0/Devel/Symdump.pm line 114 Devel::Symdump::_symdump('Devel::Symdump=HASH(0x269bf68)', 'version', 'Tie', 'Devel', 'U64', 'Encode', 'Regexp', 'UNIVERSAL', 'Tk', ...) called at /home/jeff/lib/perl5/site_perl/5.10.0/Devel/Symdump.pm line 114 Devel::Symdump::_symdump('Devel::Symdump=HASH(0x269bf68)', 'main') called at /home/jeff/lib/perl5/site_perl/5.10.0/Devel/Symdump.pm line 43 Devel::Symdump::_doit('Devel::Symdump=HASH(0x269bf68)') called at /home/jeff/lib/perl5/site_perl/5.10.0/Devel/Symdump.pm line 30 Devel::Symdump::rnew('Devel::Symdump') called at -e line 1.
Download (untitled) / with headers
text/plain 217b
On Tue Mar 31 09:45:50 2009, andreas.koenig.7os6VVqR@franz.ak.mind.de wrote: Show quoted text
> Which new release?
You announced: Show quoted text
>Excellent! New release 2.08_51 is uploaded to cpan. We'll see what >comes back from the cpantesters.
Download (untitled) / with headers
text/plain 305b
On Wed Apr 01 17:06:47 2009, RYBSKEJ wrote: Show quoted text
> I'm encountering the same segfault issue with other CPAN modules. In > this case, PDF::API2.
This is because PDF::API2 depends on Compress::Zlib perl -MDevel::Symdump -MCompress::Zlib -e 'Devel::Symdump->rnew->packages' also segfaults in a similar manner
On Sun Mar 01 01:08:51 2009, JMMILLS wrote: Show quoted text
> I've attached a test case that should show configurations that have this > bug...
$ perl t/glob_to_local_typeglob.t # OS == linux ok 1 - use Compress::Zlib; ok 2 - use Devel::Symdump; # $Devel::Symdump::VERSION == 2.08 # $Compress::Zlib::VERSION == 2.008 # Perl == 5.010000 ok 3 - reference assignment # ref($glob_ref) == "GLOB" # Checking GLOB assignment to reference... ok 4 - waitpid() # exit value = 0 # exit with signal = 11 # dumped core? 0 not ok 5 - child did not SEGV # Failed test 'child did not SEGV' # at t/glob_to_local_typeglob.t line 52. not ok 6 - child exited properly # Failed test 'child exited properly' # at t/glob_to_local_typeglob.t line 53. # Checking Devel::Symdump->rnew->packages... ok 7 - waitpid() # exit value = 0 # exit with signal = 11 # dumped core? 0 not ok 8 - child did not SEGV # Failed test 'child did not SEGV' # at t/glob_to_local_typeglob.t line 52. not ok 9 - child exited properly # Failed test 'child exited properly' # at t/glob_to_local_typeglob.t line 53. 1..9 # Looks like you failed 4 tests of 9.
Download (untitled) / with headers
text/plain 240b
On Thu Feb 26 16:37:23 2009, JMMILLS wrote: Show quoted text
> And it seems that if you break before local(*ENTRY) = $val (in > Devel::Symdump::_symdump) and step in from their the segv is happing
For me, it is defined *ENTRY{ARRAY} that is calling carp.
Download (untitled) / with headers
text/plain 2.7k
And it crashes the debugger too when I try to look at $val: $ perl -d -MDevel::Symdump -MCompress::Zlib -e 'Devel::Symdump->rnew->packages' Loading DB routines from perl5db.pl version 1.3 Editor support available. Enter h or `h h' for help, or `man perldebug' for more help. main::(-e:1): Devel::Symdump->rnew->packages DB<1> s Devel::Symdump::rnew(/home/jeff/lib/perl5/site_perl/5.10.0/Devel/Symdump.pm:26): 26: my($class,@packages) = @_; DB<1> b 114 DB<2> c Devel::Symdump::_symdump(/home/jeff/lib/perl5/site_perl/5.10.0/Devel/Symdump.pm:114): 114: return (@todo && $self->{RECURS}) DB<2> s Devel::Symdump::_symdump(/home/jeff/lib/perl5/site_perl/5.10.0/Devel/Symdump.pm:48): 48: my($self,@packages) = @_ ; DB<2> c Devel::Symdump::_symdump(/home/jeff/lib/perl5/site_perl/5.10.0/Devel/Symdump.pm:114): 114: return (@todo && $self->{RECURS}) DB<2> s Devel::Symdump::_symdump(/home/jeff/lib/perl5/site_perl/5.10.0/Devel/Symdump.pm:48): 48: my($self,@packages) = @_ ; DB<2> b 54 $key eq 'GZIP_NULL_BYTE' DB<3> c Devel::Symdump::_symdump(/home/jeff/lib/perl5/site_perl/5.10.0/Devel/Symdump.pm:54): 54: my $gotone = 0; DB<3> x $val 0 GLOB(0xc00f68) -> Signal SEGV at /home/jeff/lib/perl5/5.10.0/dumpvar.pl line 299 dumpvar::unwrap('GLOB(0xc00f68)', 3, -2) called at /home/jeff/lib/perl5/5.10.0/dumpvar.pl line 144 dumpvar::DumpElem('GLOB(0xc00f68)', 3, -2) called at /home/jeff/lib/perl5/5.10.0/dumpvar.pl line 270 dumpvar::unwrap('ARRAY(0xe4f5b8)', 0, -1) called at /home/jeff/lib/perl5/5.10.0/dumpvar.pl line 34 main::dumpValue('ARRAY(0xe4f5b8)', -1) called at /home/jeff/lib/perl5/5.10.0/perl5db.pl line 5545 DB::dumpit('GLOB(0x6adef0)', 'ARRAY(0xe4f5b8)') called at /home/jeff/lib/perl5/5.10.0/perl5db.pl line 667 DB::eval called at /home/jeff/lib/perl5/5.10.0/perl5db.pl line 3434 DB::DB called at /home/jeff/lib/perl5/site_perl/5.10.0/Devel/Symdump.pm line 54 Devel::Symdump::_symdump('Devel::Symdump=HASH(0x646588)', 'Tie::Hash', 'Class::ISA', 'Devel::Peek', 'Devel::Symdump', 'File::BSDGlob', 'File::Spec', 'File::Glob', 'File::Basename', ...) called at /home/jeff/lib/perl5/site_perl/5.10.0/Devel/Symdump.pm line 114 Devel::Symdump::_symdump('Devel::Symdump=HASH(0x646588)', 'version', 'Tie', 'Class', 'Cwd', 'Devel', 'U64', 'Encode', 'Regexp', ...) called at /home/jeff/lib/perl5/site_perl/5.10.0/Devel/Symdump.pm line 114 Devel::Symdump::_symdump('Devel::Symdump=HASH(0x646588)', 'main') called at /home/jeff/lib/perl5/site_perl/5.10.0/Devel/Symdump.pm line 43 Devel::Symdump::_doit('Devel::Symdump=HASH(0x646588)') called at /home/jeff/lib/perl5/site_perl/5.10.0/Devel/Symdump.pm line 30 Devel::Symdump::rnew('Devel::Symdump') called at -e line 1 Aborted
GZIP_NULL_BYTE is a string - it shouldn't identified as a globref.
Download (untitled) / with headers
text/plain 4.1k
Looks like this issue is specific to perl 5.10.0. Something has changed in core perl regarding typeglobs, and it's breaking code that either tries typeglob ref assignment or $typeglob{THING} notation. Comparing identical stack traces of below for different perl versions, note that perl 5.10.0 returns a GLOB ref instead of a literal GLOB string (i.e. GLOB(0x895770) vs. '*Compress::Zlib::GZIP_NULL_BYTE'). ========== perl 5.10.0 ==========: perl -MDevel::Symdump -MCompress::Zlib -d -e 'Devel::Symdump->rnew->packages' Loading DB routines from perl5db.pl version 1.3 Editor support available. Enter h or `h h' for help, or `man perldebug' for more help. main::(-e:1): Devel::Symdump->rnew->packages DB<1> s Devel::Symdump::rnew(/opt/local/lib/perl5/site_perl/5.10.0/Devel/Symdump.pm:26): 26: my($class,@packages) = @_; DB<1> n Devel::Symdump::rnew(/opt/local/lib/perl5/site_perl/5.10.0/Devel/Symdump.pm:28): 28: my $self = bless {%${"$class\::Defaults"}}, $class; DB<1> n Devel::Symdump::rnew(/opt/local/lib/perl5/site_perl/5.10.0/Devel/Symdump.pm:28): 28: my $self = bless {%${"$class\::Defaults"}}, $class; DB<1> n Devel::Symdump::rnew(/opt/local/lib/perl5/site_perl/5.10.0/Devel/Symdump.pm:29): 29: $self->{RECURS}++; DB<1> n Devel::Symdump::rnew(/opt/local/lib/perl5/site_perl/5.10.0/Devel/Symdump.pm:30): 30: $self->_doit(@packages); DB<1> s Devel::Symdump::_doit(/opt/local/lib/perl5/site_perl/5.10.0/Devel/Symdump.pm:41): 41: my($self,@packages) = @_; DB<1> n Devel::Symdump::_doit(/opt/local/lib/perl5/site_perl/5.10.0/Devel/Symdump.pm:42): 42: @packages = ("main") unless @packages; DB<1> n Devel::Symdump::_doit(/opt/local/lib/perl5/site_perl/5.10.0/Devel/Symdump.pm:43): 43: $self->{RESULT} = $self->_symdump(@packages); DB<1> s Devel::Symdump::_symdump(/opt/local/lib/perl5/site_perl/5.10.0/Devel/Symdump.pm:48): 48: my($self,@packages) = @_ ; DB<1> n Devel::Symdump::_symdump(/opt/local/lib/perl5/site_perl/5.10.0/Devel/Symdump.pm:49): 49: my($key,$val,$num,$pack,@todo,$tmp); DB<1> n Devel::Symdump::_symdump(/opt/local/lib/perl5/site_perl/5.10.0/Devel/Symdump.pm:50): 50: my $result = {}; DB<1> n Devel::Symdump::_symdump(/opt/local/lib/perl5/site_perl/5.10.0/Devel/Symdump.pm:51): 51: foreach $pack (@packages){ DB<1> n Devel::Symdump::_symdump(/opt/local/lib/perl5/site_perl/5.10.0/Devel/Symdump.pm:53): 53: while (($key,$val) = each(%{*{"$pack\::"}})) { DB<1> n Devel::Symdump::_symdump(/opt/local/lib/perl5/site_perl/5.10.0/Devel/Symdump.pm:53): 53: while (($key,$val) = each(%{*{"$pack\::"}})) { DB<1> n Devel::Symdump::_symdump(/opt/local/lib/perl5/site_perl/5.10.0/Devel/Symdump.pm:53): 53: while (($key,$val) = each(%{*{"$pack\::"}})) { DB<1> n Devel::Symdump::_symdump(/opt/local/lib/perl5/site_perl/5.10.0/Devel/Symdump.pm:54): 54: my $gotone = 0; DB<1> w $key eq 'GZIP_NULL_BYTE' DB<2> c Watchpoint 0: $key eq 'GZIP_NULL_BYTE' changed: old value: '' new value: '1' Devel::Symdump::_symdump(/opt/local/lib/perl5/site_perl/5.10.0/Devel/Symdump.pm:54): 54: my $gotone = 0; DB<2> p $val GLOB(0x895770) DB<3> p *{$val} DB<4> ========== Perl 5.8.8 ==========: DB<1> w $key eq 'GZIP_NULL_BYTE' DB<2> c p $vWatchpoint 0: $key eq 'GZIP_NULL_BYTE' changed: old value: '' new value: '1' Devel::Symdump::_symdump(/Library/Perl/5.8.8/Devel/Symdump.pm:54): 54: my $gotone = 0; DB<2> p $val *Compress::Zlib::GZIP_NULL_BYTE DB<3> p *{$val} *Compress::Zlib::GZIP_NULL_BYTE DB<4>
Download (untitled) / with headers
text/plain 4.2k
For reference, *foo{THING} notation is documented here: http://www.perl.com/doc/manual/html/pod/perlref.html It's also interesting to note is that constant subroutines (like those defined by 'use constant') show up in perl 5.10.0 as SCALAR refs instead of literal GLOB string in Devel::Symdump, as seen below. This is harmless in the case of Devel::Symdump, due to the local(*ENTRY)=$val; assignment, but does break the standard *foo{THING} notation, i.e. *{$val} works in perl 5.8.8, but dies with "Not a GLOB reference" in perl 5.10.0. Seems appropriate to elevate this issue to perl5-porters. ========== perl 5.10.0 ========== # /opt/local/bin/perl5.10 -MDevel::Symdump -d -e 'use constant MAX32 => 2**32; Devel::Symdump->rnew->packages' Loading DB routines from perl5db.pl version 1.3 Editor support available. Enter h or `h h' for help, or `man perldebug' for more help. main::(-e:1): use constant MAX32 => 2**32; Devel::Symdump->rnew->packages DB<1> s Devel::Symdump::rnew(/opt/local/lib/perl5/site_perl/5.10.0/Devel/Symdump.pm:26): 26: my($class,@packages) = @_; DB<1> n Devel::Symdump::rnew(/opt/local/lib/perl5/site_perl/5.10.0/Devel/Symdump.pm:28): 28: my $self = bless {%${"$class\::Defaults"}}, $class; DB<1> n Devel::Symdump::rnew(/opt/local/lib/perl5/site_perl/5.10.0/Devel/Symdump.pm:28): 28: my $self = bless {%${"$class\::Defaults"}}, $class; DB<1> n Devel::Symdump::rnew(/opt/local/lib/perl5/site_perl/5.10.0/Devel/Symdump.pm:29): 29: $self->{RECURS}++; DB<1> n Devel::Symdump::rnew(/opt/local/lib/perl5/site_perl/5.10.0/Devel/Symdump.pm:30): 30: $self->_doit(@packages); DB<1> s Devel::Symdump::_doit(/opt/local/lib/perl5/site_perl/5.10.0/Devel/Symdump.pm:41): 41: my($self,@packages) = @_; DB<1> n Devel::Symdump::_doit(/opt/local/lib/perl5/site_perl/5.10.0/Devel/Symdump.pm:42): 42: @packages = ("main") unless @packages; DB<1> n Devel::Symdump::_doit(/opt/local/lib/perl5/site_perl/5.10.0/Devel/Symdump.pm:43): 43: $self->{RESULT} = $self->_symdump(@packages); DB<1> s Devel::Symdump::_symdump(/opt/local/lib/perl5/site_perl/5.10.0/Devel/Symdump.pm:48): 48: my($self,@packages) = @_ ; DB<1> n Devel::Symdump::_symdump(/opt/local/lib/perl5/site_perl/5.10.0/Devel/Symdump.pm:49): 49: my($key,$val,$num,$pack,@todo,$tmp); DB<1> n Devel::Symdump::_symdump(/opt/local/lib/perl5/site_perl/5.10.0/Devel/Symdump.pm:50): 50: my $result = {}; DB<1> n Devel::Symdump::_symdump(/opt/local/lib/perl5/site_perl/5.10.0/Devel/Symdump.pm:51): 51: foreach $pack (@packages){ DB<1> n Devel::Symdump::_symdump(/opt/local/lib/perl5/site_perl/5.10.0/Devel/Symdump.pm:53): 53: while (($key,$val) = each(%{*{"$pack\::"}})) { DB<1> n Devel::Symdump::_symdump(/opt/local/lib/perl5/site_perl/5.10.0/Devel/Symdump.pm:53): 53: while (($key,$val) = each(%{*{"$pack\::"}})) { DB<1> n Devel::Symdump::_symdump(/opt/local/lib/perl5/site_perl/5.10.0/Devel/Symdump.pm:53): 53: while (($key,$val) = each(%{*{"$pack\::"}})) { DB<1> n Devel::Symdump::_symdump(/opt/local/lib/perl5/site_perl/5.10.0/Devel/Symdump.pm:54): 54: my $gotone = 0; DB<1> w $key eq 'MAX32' DB<2> c Watchpoint 0: $key eq 'MAX32' changed: old value: '' new value: '1' Devel::Symdump::_symdump(/opt/local/lib/perl5/site_perl/5.10.0/Devel/Symdump.pm:54): 54: my $gotone = 0; DB<2> p $val SCALAR(0x89f540) DB<3> x $val 0 SCALAR(0x89f540) -> 4294967296 DB<4> ========== perl 5.8.8 ========== DB<1> w $key eq 'MAX32' DB<2> c Watchpoint 0: $key eq 'MAX32' changed: old value: '' new value: '1' Devel::Symdump::_symdump(/Library/Perl/5.8.8/Devel/Symdump.pm:54): 54: my $gotone = 0; DB<2> p $val *main::MAX32 DB<3> x $val 0 *main::MAX32 DB<4>
Download (untitled) / with headers
text/plain 161b
Hi, Although Andreas said 2.08_51 was released, I cannot see it :( Anyway, I wrote a patch to fix this problem. Regards, -- Goro Fuji (gfx) GFUJI at CPAN.org
Download fix-segv.patch
text/x-diff 520b
--- Symdump.pm~ 2007-06-25 15:07:38.000000000 +0900 +++ Symdump.pm 2009-07-03 15:02:55.451240000 +0900 @@ -49,8 +49,10 @@ my($key,$val,$num,$pack,@todo,$tmp); my $result = {}; foreach $pack (@packages){ - no strict; - while (($key,$val) = each(%{*{"$pack\::"}})) { + no strict 'refs'; + my $stash = \%{$pack .'::'}; + while (($key,$val) = each(%{$stash})) { + next if ref(\$val) ne 'GLOB'; # stubs and constants are not type-globs my $gotone = 0; local(*ENTRY) = $val; #### SCALAR ####
Download (untitled) / with headers
text/plain 725b
I'd like to find out where we stand with this. I apologize that I haven't been too helpful with this bug so far. I recall that I did release 2.08_51 with a new test and later deleted it. It's still on backpan: http://backpan.cpan.org/authors/id/A/AN/ANDK/Devel-Symdump-2.08_51.tar.gz Cpantesters have the results: http://matrix.cpantesters.org/?dist=Devel-Symdump&maxver= The reason I deleted it was because I had the impression that we are chasing a perl bug not a Devel-Symdump bug and we don't help anybody by changing Devel-Symdump. For future directions I welcome suggestions. One option is to release a 1.08_52 just for the sake of getting cpantesters results. Hmmm. I might just do that. Any other suggestsions?


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.