Bug#624759: segfault in libperl5.10

Niko Tyni ntyni at debian.org
Mon May 2 10:08:00 UTC 2011


retitle 624759 perl: segfaults when freeing deeply nested structures
reassign 624759 perl 5.10.1-17
tag 624759 upstream
forwarded 624759 http://rt.perl.org/rt3/Public/Bug/Display.html?id=44225
thanks

On Sun, May 01, 2011 at 03:55:45PM +0400, vlakhadzhi wrote:

> Perl segfaults while clean up before exiting from test script:
> 
> my $t = XML::Twig->new;
> $t->set_root(my $root = XML::Twig::Elt->new('root'));
> 
> for(my $i=0; $i<20000; $i++) {
>         print "$i\n" unless $i%1000;
>         $root->insert_new_elt('child');
> }

This is a long standing upstream bug [perl #44225], "a stack overflow
caused by the recursive implementation of the reference counting scheme".

for (my $len=1; ; $len<<=1) {
    my $list;
    print STDERR "list length $len\n";
    foreach (1..$len) { $list={ next => $list, }; }
}

You can work around it by raising the stacksize limit, but there's 
no real fix ATM.
-- 
Niko Tyni   ntyni at debian.org






More information about the Perl-maintainers mailing list