On Thu, Feb 24, 2005 at 01:32:25PM +0000, Steve Hay wrote: > Stas Bekman wrote: > > >The following scalar leak is reproduced under any perl 5.8+ w/ithreads: > > > >#!/usr/bin/perl -T > >use Devel::Peek; > >use threads; > > > >local $0 = "test"; # <== XXX: leaks scalar > >my $thr = threads->new(sub { Dump $0 }); > >$thr->join; # <== XXX: triggers the leak > > > >[...] > >Scalars leaked: 1 > >leaked: sv=0x816dc1c flags=0x084046007 refcnt=0, Perl interpreter: 0x8102770 > > > >As the dump shows that leaked scalar is MG_OBJ = 0x816dc1c. This magic > >object is a taint magic (and it happens under -T). > > > Is this anything to do with the following comment found in > scope.c::S_save_scalar_at() > > /* XXX SvMAGIC() is *shared* between osv and sv. This can > * lead to coredumps when both SVs are destroyed without one > * of their SvMAGIC() slots being NULLed. */
Looks like the leak has been fixed by my change #24942, which fixed local() and magic (and specifically removed the code related to that XXX comment above) -- "Do not dabble in paradox, Edward, it puts you in danger of fortuitous wit." -- Lady Croom - Arcadia