Bug#511589: foreach loop with lexically scoped variable result in segmentation fault

Niko Tyni ntyni at debian.org
Mon Jan 12 20:28:36 UTC 2009


On Mon, Jan 12, 2009 at 03:28:26PM +0100, Peter Makholm wrote:
> Package: libdevel-repl-perl
> Version: 1.002001-2
> Severity: normal
> 
> Using the same lexically scoped variable in a foreach loop twice, makes re.pl
> crash with a segmentation fault:  

This looks like memory corruption in the Perl core, triggered by
Lexical::Persistence:

% perl -MLexical::Persistence
my $lp = Lexical::Persistence->new;
$lp->call(\&func);
$lp->call(\&func);
sub func {
    for my $foo ( 0 ) { print "/dir/$foo\n" }
}
/dir/0
/dir/0
Attempt to free unreferenced scalar: SV 0x9f20d00, Perl interpreter: 0x9e55008.

I'll reassign to perl once I have a core-only testcase.
-- 
Niko Tyni   ntyni at debian.org





More information about the pkg-perl-maintainers mailing list