Skip Menu |

This queue is for tickets about the mysubs CPAN distribution.

Report information
The Basics
Id: 76619
Status: open
Priority: 0/
Queue: mysubs

People
Owner: CHOCOLATE [...] cpan.org
Requestors: SREZIC [...] cpan.org
Cc:
AdminCc:

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



Subject: Test failure with bleadperl
On two systems (a freebsd and a linux system) the test suite fails with perl-v5.15.9-134-g8aed2c6. See http://matrix.cpantesters.org/?dist=mysubs-1.14 for an overview of test results. I see some PASSes for other 5.15.9, but this could be an earlier version. Regards, Slaven
RT-Send-CC: andk [...] cpan.org
On Tue Apr 17 02:19:27 2012, SREZIC wrote: Show quoted text
> On two systems (a freebsd and a linux system) the test suite fails with > perl-v5.15.9-134-g8aed2c6. See > http://matrix.cpantesters.org/?dist=mysubs-1.14 for an overview of test > results. I see some PASSes for other 5.15.9, but this could be an > earlier version.
In that list, the latest PASS is v5.15.9-20-g15d94df. The earlier FAIL is v5.15.9-131-g2653c1e. Andreas König, could you do a binary search?
v5.15.9-131-g2653c1e. It still fails with v5.15.9-142-g65c512c, my current;y latest bleadperl
In mysubs.pm:import_for, I see this: on_scope_end { my $hints = my_hints; # refresh the %^H reference - doesn't work without this my $installed = $hints->{$MYSUBS}; The problem here is that on_scope_end is called when %^H is being freed. It is only supposed to be freed when nothing refers to it any more. But the sub passed to on_scope_end expects to be able to refer to it and retrieve information from inside it. It was only by accident that it wasn’t already crashing. You should probably store the extra information in a tied field hash keyed by \%^H. That way you can do your cleanup inside the field hash’s DELETE method, which will have access to that information. See namespace::clean’s lib/namespace/clean/_PP_OSE.pm, pasted here, since it’s so short: package # hide from the pauses namespace::clean::_PP_OSE; use warnings; use strict; use Tie::Hash; use Hash::Util::FieldHash 'fieldhash'; # Here we rely on a combination of several behaviors: # # * %^H is deallocated on scope exit, so any references to it disappear # * A lost weakref in a fieldhash causes the corresponding key to be deleted # * Deletion of a key on a tied hash triggers DELETE # # Therefore the DELETE of a tied fieldhash containing a %^H reference will # be the hook to fire all our callbacks. fieldhash my %hh; { package # hide from pause too namespace::clean::_TieHintHashFieldHash; use base 'Tie::StdHash'; sub DELETE { my $ret = shift->SUPER::DELETE(@_); $_->() for @$ret; $ret; } } sub on_scope_end (&) { $^H |= 0x020000; tie(%hh, 'namespace::clean::_TieHintHashFieldHash') unless tied %hh; push @{ $hh{\%^H} ||= [] }, shift; } 1;