Subject: | Core dump in each_array iterator |
This ticket was opened by mistake as a Perlbug ticket. It appears it
should have been opened here instead. It was ticket #39650: require and
List::MoreUtils seg fault.
Example code:
#!/usr/bin/perl
use strict;
use warnings;
require List::MoreUtils;
# use List::MoreUtils ();
my @v1 = qw(4 0 0 3);
my @v2 = qw(4 0 0 3);
my $ea = List::MoreUtils::each_array(@v1, @v2);
while (my ($v, $t) = $ea->())
{
}
__END__
When running the above, I get a seg fault. Switch out the require to
use, and the seg fault goes away. This has been confirmed on 5.8.7 on
XP as well in this thread: http://www.perlmonks.org/index.pl?node_id=557894
Later in the ticket...
A backtrace gives this :
#0 0xb7eb6142 in Perl_av_fetch () from
/usr/lib/perl5/5.8.8/i386-linux/CORE/libperl.so
#1 0xb7c531ec in XS_List__MoreUtils__array_iterator ()
from
/usr/lib/perl5/vendor_perl/5.8.8/i386-linux/auto/List/MoreUtils/MoreUtils.so
#2 0xb7ebd73d in Perl_pp_entersub () from
/usr/lib/perl5/5.8.8/i386-linux/CORE/libperl.so
#3 0xb7eb6ae5 in Perl_runops_standard () from /usr/lib/perl5/5.8.8/i386-
\ #linux/CORE/libperl.so
#4 0xb7e63503 in perl_run () from
/usr/lib/perl5/5.8.8/i386-linux/CORE/libperl.so
#5 0x080490d1 in main ()
So the problem probably comes from the implementation of
List::MoreUtils::each_array (the _array_iterator function being
instantiated as a closure at run-time) and is not related to core perl
(although it's still a bit obscure for me)