This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #70748] threads panic in del_backref
authorFather Chrysostomos <sprout@cpan.org>
Tue, 22 Dec 2009 13:03:49 +0000 (14:03 +0100)
committerRafael Garcia-Suarez <rgs@consttype.org>
Tue, 22 Dec 2009 13:03:49 +0000 (14:03 +0100)
commit27bca3226281a592aed848b7e68ea50f27381dac
tree1f612fa141096d89c960810e0933cfb4a4d6c644
parent0111a78fcc993bdfaa4b46112924c3a9751ecfa5
[perl #70748] threads panic in del_backref

This was caused by change 34210/41fae7a, which simply reveals a bug that
already existed.

A sub returned from a thread brings a lot of baggage with it, including
some globs. There is this comment near the top of Perl_sv_dup in the
if(param->flags & CLONEf_JOIN_IN) block that reads:
        /** don't clone stashes if they already exist **/

Then later on, under case SVt_PVGV:
        /* Don't call sv_add_backref here as it's going to be
           created as part of the magic cloning of the symbol
           table. */

So what’s happening is that there is a glob with no back-reference in its
stash, which glob is sometimes freed after the stash, so it induces the
panic.
sv.c
t/op/threads.t