In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/95f567513aaa04ffb8bb9d148aff1a85b1eff161?hp=e2bd2e2b51a3690b0515d3ac5d5d7e350cb446be>
- Log ----------------------------------------------------------------- commit 95f567513aaa04ffb8bb9d148aff1a85b1eff161 Author: Father Chrysostomos <spr...@cpan.org> Date: Sun Oct 3 10:46:52 2010 -0700 Avoid downgrading GVs during global destruction Recently weâve been getting assertions from gv.t like this: Assertion failed: (SvTYPE(sv) != SVTYPEMASK), function Perl_sv_clear, file sv.c, line 5783. This only happens in non-threaded builds and with PERL_DESTRUCT_LEVEL set to 2 (as in make test). These started with 13be902 (lvalue-to-glob assignment), but only because of the tests it added. The real cause turns out to be f746176, which introduced gv_try_downgrade. If a subroutine contains an op that references a downgradable GV, then gv_try_downgrade, if called on that GV during global destruction, *might* leave dangling pointers elsewhere; where exactly I wot not. Since memory-saving operations such as this downgrading are questiona- ble anyway durng global destruction, skip it, at least for now. ----------------------------------------------------------------------- Summary of changes: gv.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/gv.c b/gv.c index 11f82a2..db9617f 100644 --- a/gv.c +++ b/gv.c @@ -2593,6 +2593,11 @@ Perl_gv_try_downgrade(pTHX_ GV *gv) HEK *namehek; SV **gvp; PERL_ARGS_ASSERT_GV_TRY_DOWNGRADE; + + /* XXX Why and where does this leave dangling pointers during global + destruction? */ + if (PL_dirty) return; + if (!(SvREFCNT(gv) == 1 && SvTYPE(gv) == SVt_PVGV && !SvFAKE(gv) && !SvOBJECT(gv) && !SvREADONLY(gv) && isGV_with_GP(gv) && GvGP(gv) && -- Perl5 Master Repository