Skip Menu |

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

Report information
The Basics
Id: 92290
Status: resolved
Priority: 0/
Queue: Devel-MAT

People
Owner: Nobody in particular
Requestors: ribasushi [...] leporine.io
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 0.17



Subject: Unable to load dump back: Can't bless non-reference value
Attached is an xzip of a dump made on a stock non-threaded 5.18.0 (no -D args), all latest deps. Loading it results in: Can't bless non-reference value at /home/rabbit/perl5/perlbrew/perls/5.16.2/lib/site_perl/5.16.2/x86_64-linux-thread-multi-ld/Devel/MAT/SV.pm line 1234. Cheers
Subject: 0x3f58eb0.mat.xz
Download 0x3f58eb0.mat.xz
application/octet-stream 1.8m

Message body not shown because it is not plain text.

On Mon Jan 20 05:22:40 2014, RIBASUSHI wrote: Show quoted text
> Attached is an xzip of a dump made on a stock non-threaded 5.18.0 (no > -D args), all latest deps. Loading it results in: Can't bless non- > reference value at > /home/rabbit/perl5/perlbrew/perls/5.16.2/lib/site_perl/5.16.2/x86_64- > linux-thread-multi-ld/Devel/MAT/SV.pm line 1234.
Ah yes. Curious. This is a padlist that contains undefs in some of the pad slots. Fixing the actual bug and putting a warning in yields: UNDEF PAD IN CODE(PP) at 0x318e110 UNDEF PAD IN CODE(PP) at 0x31a8ae8 UNDEF PAD IN CODE(PP,C) at 0x385cb30 UNDEF PAD IN CODE(PP) at 0x31a8ba8 UNDEF PAD IN CODE(PP) at 0x15aa398 Looking at one of those in more detail: $ perl -Mblib bin/pmat-show-sv 0x3f58eb0.mat 0x31a8ba8 UNDEF PAD IN CODE(PP) at 0x15aa398 UNDEF PAD IN CODE(PP) at 0x31a8ba8 UNDEF PAD IN CODE(PP,C) at 0x385cb30 UNDEF PAD IN CODE(PP) at 0x31a8ae8 UNDEF PAD IN CODE(PP) at 0x318e110 CODE(PP) at 0x31a8ba8 with refcount 1 name=&Storable::_freeze stash=STASH(62) at 0x1825728 glob=GLOB(&*) at 0x31a8a58 location=/home/rabbit/perl5/perlbrew/perls/5.18.0_nt/lib/5.18.0/x86_64-linux/Storable.pm line 332 scope=CODE() at 0x3016c70 no padlist padnames=PADNAMES(11) at 0x31a8bd8 pad[0]=PAD(11) at 0x31a8bc0 pad[1]=PAD(11) at 0x24642b0 pad[2]=PAD(11) at 0x2463e18 pad[3]=PAD(11) at 0x31f08e0 pad[4]=PAD(11) at 0x31f0dd8 pad[5]=PAD(11) at 0x31f1670 Referenced globs: GLOB(&*) at 0x315a548, GLOB(@I) at 0xe10f20, GLOB(&*) at 0x315a548, GLOB($%*) at 0xe10f50, GLOB($%*) at 0xe10f50, GLOB($%*) at 0xe10f50, GLOB(&*) at 0x315a548, GLOB($%*) at 0xe10f50 I suspect this may just be a simple case that the padlist was longer, but invocations have now returned and these are still being dumped. Hmm. Easily fixed. -- Paul Evans
Fixed in attached patch. -- Paul Evans
Subject: rt92290.patch
=== modified file 'bin/pmat-show-sv' --- bin/pmat-show-sv 2014-01-15 17:27:58 +0000 +++ bin/pmat-show-sv 2014-01-21 00:13:05 +0000 @@ -64,6 +64,7 @@ my @pads = $sv->pads; foreach my $depth ( 0 .. $#pads ) { + next unless $pads[$depth]; say " pad[$depth]=" . $pads[$depth]->desc_addr; } === modified file 'lib/Devel/MAT/SV.pm' --- lib/Devel/MAT/SV.pm 2014-01-15 18:21:16 +0000 +++ lib/Devel/MAT/SV.pm 2014-01-21 00:13:05 +0000 @@ -1231,8 +1231,10 @@ bless $padnames, "Devel::MAT::SV::PADNAMES"; $padnames->_set_padcv_at( $self->addr ); - bless $_, "Devel::MAT::SV::PAD" for @pads; - $_->_set_padcv_at( $self->addr ) for @pads; + foreach my $pad ( @pads ) { + bless $pad, "Devel::MAT::SV::PAD"; + $pad->_set_padcv_at( $self->addr ); + } $self->{pads} = \@pads;
On Tue Jan 21 01:13:37 2014, PEVANS wrote: Show quoted text
> Fixed in attached patch.
This seems to be insufficient, I am still getting the error, patches applied... I am attaching the current dump I am playing with as well, perhaps something sufficiently different from the old one ~/devel/dbic/dbgit$ perl -MDevel::MAT\ 999 Devel::MAT version 999 required--this is only version 0.16. BEGIN failed--compilation aborted. ~/devel/dbic/dbgit$ sed -n '64,72p' $(which pmat-show-sv) say $sv->scope ? " scope=" . $sv->scope->desc_addr : " no scope"; say $sv->padlist ? " padlist=" . $sv->padlist->desc_addr : " no padlist"; say $sv->padnames ? " padnames=" . $sv->padnames->desc_addr : " no padnames"; my @pads = $sv->pads; foreach my $depth ( 0 .. $#pads ) { next unless $pads[$depth]; say " pad[$depth]=" . $pads[$depth]->desc_addr; } ~/devel/dbic/dbgit$ sed -n '1231,1242p' $(perldoc -l Devel::MAT::SV) bless $padnames, "Devel::MAT::SV::PADNAMES"; $padnames->_set_padcv_at( $self->addr ); foreach my $pad ( @pads ) { bless $pad, "Devel::MAT::SV::PAD"; $pad->_set_padcv_at( $self->addr ); } $self->{pads} = \@pads; # Under ithreads, constants are actually stored in the first padlist if( $df->ithreads ) { ~/devel/dbic/dbgit$ pmat-show-sv leaked_0xa6fbc50_pid10673.pmat 0xa6fbc50 Can't bless non-reference value at /home/rabbit/perl5/perlbrew/perls/5.18.1/lib/site_perl/5.18.1/x86_64-linux-thread-multi/Devel/MAT/SV.pm line 1235.
Subject: leaked_0xa6fbc50_pid10673.pmat.xz
Download leaked_0xa6fbc50_pid10673.pmat.xz
application/octet-stream 1.8m

Message body not shown because it is not plain text.

On Wed Jan 22 12:40:28 2014, RIBASUSHI wrote: Show quoted text
> On Tue Jan 21 01:13:37 2014, PEVANS wrote:
> > Fixed in attached patch.
> > This seems to be insufficient, I am still getting the error, patches > applied... I am attaching the current dump I am playing with as well, > perhaps something sufficiently different from the old one
Huh. Oops. I managed to fix the bug, then remove half the bugfix from the code before committing it and building the .patch file... Find attached now the other half, though I'll also be CPAN'ing it momentarily. (this one can correctly load your attached dumpfile) -- Paul Evans
Subject: rt92290-pt2.patch
=== modified file 'lib/Devel/MAT/SV.pm' --- lib/Devel/MAT/SV.pm 2014-01-22 21:25:15 +0000 +++ lib/Devel/MAT/SV.pm 2014-01-22 21:39:51 +0000 @@ -1232,6 +1232,8 @@ $padnames->_set_padcv_at( $self->addr ); foreach my $pad ( @pads ) { + next unless $pad; + bless $pad, "Devel::MAT::SV::PAD"; $pad->_set_padcv_at( $self->addr ); } @@ -1252,7 +1254,7 @@ # Clear the obviously unused elements of lexnames and padlists foreach my $ix ( @$idxes ) { $padnames->_clear_elem( $ix ); - $_->_clear_elem( $ix ) for @pads; + $_ and $_->_clear_elem( $ix ) for @pads; } } }
Fixed in 0.17 -- Paul Evans