On Thu, Jan 25, 2007 at 11:18:02AM -0500, mirod@xmltwig.com via RT wrote:
Show quoted text>
> <URL:
http://rt.cpan.org/Ticket/Display.html?id=24548 >
>
> Emile Aben via RT wrote:
>
> > I seem to have a problem with perl core dumping when using XML::Twig.
> > The shortest version I could come up with that demonstrates the problem is:
> >
> > perl -MXML::Twig -e'open(F,"<","./bus_error.xml"); my $t=XML::Twig->new() ; $t->parse(*F)'
> >
> > where I get the error:
> > Bus error (core dumped)
> >
> > And a core dump is created (perl.core).
> >
> > The bus_error.xml this occurs on is at:
> >
http://www.caida.org/~emile/bus_error.xml
> >
> > I've tried this with an older version (3.22) on the same system, and it looks like
> > that has the same problem. I've also tried this on another freebsd system, with the
> > same symptoms.
> >
> > I've not encountered perl core dumps on this system before (and used perl quite a lot on it)
> >
> > I've worked around the problems with this file by splitting it up in smaller pieces and
> > processing it that way, but I thought it might be good to let the maintainer know of
> > this potential problem.
>
> Hi,
>
> This is weird. Of course I cannot reproduce the bug on my machine (linux).
>
> Could you replace XML::Twig by XML::Parser and see if you get the same
> problem? If not we'll know that the problem is with XML::Twig, otherwise
> it comes from XML::Parser.
perl -MXML::Parser -e'open(F,"<","./bus_error.xml"); my $t=XML::Parser->new() ; $t->parse(*F)'
doesn't result in a core dump/bus error message.
A gdb backtrace shows this:
(gdb) bt
#0 0x280e49cb in Perl_hv_fetch_ent () from /usr/local/lib/perl5/5.8.7/mach/CORE/libperl.so
#1 0x280f1c7b in S_method_common () from /usr/local/lib/perl5/5.8.7/mach/CORE/libperl.so
#2 0x280f1971 in Perl_pp_method_named () from /usr/local/lib/perl5/5.8.7/mach/CORE/libperl.so
#3 0x280e98fd in Perl_runops_standard () from /usr/local/lib/perl5/5.8.7/mach/CORE/libperl.so
#4 0x2809886f in S_call_body () from /usr/local/lib/perl5/5.8.7/mach/CORE/libperl.so
#5 0x280985e5 in Perl_call_sv () from /usr/local/lib/perl5/5.8.7/mach/CORE/libperl.so
#6 0x280f9042 in Perl_sv_clear () from /usr/local/lib/perl5/5.8.7/mach/CORE/libperl.so
#7 0x280f96a9 in Perl_sv_free () from /usr/local/lib/perl5/5.8.7/mach/CORE/libperl.so
#8 0x280f93c1 in Perl_sv_clear () from /usr/local/lib/perl5/5.8.7/mach/CORE/libperl.so
#9 0x280f96a9 in Perl_sv_free () from /usr/local/lib/perl5/5.8.7/mach/CORE/libperl.so
#10 0x280e6055 in Perl_hv_free_ent () from /usr/local/lib/perl5/5.8.7/mach/CORE/libperl.so
#11 0x280e645c in S_hfreeentries () from /usr/local/lib/perl5/5.8.7/mach/CORE/libperl.so
#12 0x280e64be in Perl_hv_undef () from /usr/local/lib/perl5/5.8.7/mach/CORE/libperl.so
#13 0x280f92d2 in Perl_sv_clear () from /usr/local/lib/perl5/5.8.7/mach/CORE/libperl.so
#14 0x280f96a9 in Perl_sv_free () from /usr/local/lib/perl5/5.8.7/mach/CORE/libperl.so
#15 0x280f93c1 in Perl_sv_clear () from /usr/local/lib/perl5/5.8.7/mach/CORE/libperl.so
#16 0x280f96a9 in Perl_sv_free () from /usr/local/lib/perl5/5.8.7/mach/CORE/libperl.so
#17 0x280e6055 in Perl_hv_free_ent () from /usr/local/lib/perl5/5.8.7/mach/CORE/libperl.so
#18 0x280e645c in S_hfreeentries () from /usr/local/lib/perl5/5.8.7/mach/CORE/libperl.so
#19 0x280e64be in Perl_hv_undef () from /usr/local/lib/perl5/5.8.7/mach/CORE/libperl.so
#20 0x280f92d2 in Perl_sv_clear () from /usr/local/lib/perl5/5.8.7/mach/CORE/libperl.so
#21 0x280f96a9 in Perl_sv_free () from /usr/local/lib/perl5/5.8.7/mach/CORE/libperl.so
#22 0x280f93c1 in Perl_sv_clear () from /usr/local/lib/perl5/5.8.7/mach/CORE/libperl.so
#23 0x280f96a9 in Perl_sv_free () from /usr/local/lib/perl5/5.8.7/mach/CORE/libperl.so
#24 0x280e6055 in Perl_hv_free_ent () from /usr/local/lib/perl5/5.8.7/mach/CORE/libperl.so
... (seems the same 7 lines loop here)
#19807 0x280e645c in S_hfreeentries () from /usr/local/lib/perl5/5.8.7/mach/CORE/libperl.so
#19808 0x280e64be in Perl_hv_undef () from /usr/local/lib/perl5/5.8.7/mach/CORE/libperl.so
#19809 0x280f92d2 in Perl_sv_clear () from /usr/local/lib/perl5/5.8.7/mach/CORE/libperl.so
#19810 0x280f96a9 in Perl_sv_free () from /usr/local/lib/perl5/5.8.7/mach/CORE/libperl.so
#19811 0x280fd150 in Perl_sv_unref_flags () from /usr/local/lib/perl5/5.8.7/mach/CORE/libperl.so
#19812 0x280f7d5e in Perl_sv_force_normal_flags () from /usr/local/lib/perl5/5.8.7/mach/CORE/libperl.so
#19813 0x28111aa3 in Perl_leave_scope () from /usr/local/lib/perl5/5.8.7/mach/CORE/libperl.so
#19814 0x2810f9e4 in Perl_pop_scope () from /usr/local/lib/perl5/5.8.7/mach/CORE/libperl.so
#19815 0x280ee704 in Perl_pp_leave () from /usr/local/lib/perl5/5.8.7/mach/CORE/libperl.so
#19816 0x280e98fd in Perl_runops_standard () from /usr/local/lib/perl5/5.8.7/mach/CORE/libperl.so
#19817 0x28097eb6 in S_run_body () from /usr/local/lib/perl5/5.8.7/mach/CORE/libperl.so
#19818 0x28097b41 in perl_run () from /usr/local/lib/perl5/5.8.7/mach/CORE/libperl.so
#19819 0x0804905c in main ()
A 'ktrace/kdump' (strace for freebsd) shows:
# ktrace perl -MXML::Twig -e'open(F,"<","./bus_error.xml"); my $t=XML::Twig->new() ; $t->parse(*F)'
# kdump
...
12106 perl RET break 0
12106 perl CALL break(0x88d8000)
12106 perl RET break 0
12106 perl CALL break(0x88d8800)
12106 perl RET break 0
12106 perl CALL break(0x88d9800)
12106 perl RET break 0
12106 perl PSIG SIGBUS SIG_DFL
12106 perl NAMI "perl.core"
If there is anything else I can to help debug the problem please let me know.
Emile
PS: hmmm I just realized that this debugging output was all generated with XML::Twig 3.23,
I could generate 3.29 output if it's useful.