diff options
author | Nicholas Clark <nick@ccl4.org> | 2009-11-08 22:04:10 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2009-11-08 22:04:10 +0000 |
commit | b327b36f413e77afd7eed00e6517a0e8cb961c48 (patch) | |
tree | c805356ec3f6c3d1976eeab360b4bb64afb0991c /Porting/Maintainers.pl | |
parent | 70938cb944714e91b284c1fcdab01a6ab2f49034 (diff) | |
download | perl-b327b36f413e77afd7eed00e6517a0e8cb961c48.tar.gz |
Tweak the GV downgrading of f7461760 to avoid free or nearly freed GVs.
It's possible during global destruction that the GV is freed before the
optree. Whilst the SvREFCNT_inc is happy to bump from 0 to 1 on a freed SV,
the corresponding SvREFCNT_dec from 1 to 0 will trigger an assertion
failure, because the entry to sv_clear checks that the scalar is not already
freed. A check of for !SvIS_FREED(gv) turns out to be invalid, because
during global destruction the reference count can be forced down to zero
(with SVf_BREAK set). In which case raising to 1 and then dropping to 0
triggers cleanup before it should happen. I *think* that this might
actually be a general, systematic, weakness of the whole idea of SVf_BREAK,
in that code *is* allowed to raise and lower references during global
destruction, so any *valid* code that happens to do this during global
destruction might well trigger premature cleanup.
Diffstat (limited to 'Porting/Maintainers.pl')
0 files changed, 0 insertions, 0 deletions