[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Seg fault with HTML::Parser



Gisle Aas <gisle@ActiveState.com> writes:
>Kenneth Pronovici <pronovic@debian.org> writes:
>
>> > I'm now down to the following test case and no real idea what is
>> > going on.  Probably something wrong going on inside HTML::Parser.
>> 
>> Oddly enough, this test case does *not* segfault on my Debian system.
>
>I get segfaults on both 5.8.1 and bleadperl for the script.  This is
>what valgrind says.  Anybody have any suggestions for what to look
>for?
>
>
>==22164== valgrind-1.0.1, a memory error detector for x86 GNU/Linux.
>==22164== Copyright (C) 2000-2002, and GNU GPL'd, by Julian Seward.
>==22164== Estimated CPU clock rate is 351 MHz
>==22164== For more details, rerun with: -v
>==22164== 
>==22164== Invalid read of size 1
>==22164==    at 0x80D63C0: S_visit (sv.c:337)
>==22164==    by 0x80D6736: Perl_sv_clean_objs (sv.c:431)
>==22164==    by 0x805FCEA: perl_destruct (perl.c:383)
>==22164==    by 0x805E75E: main (perlmain.c:88)
>==22164==    Address 0x43609D0C is 4 bytes after a block of size 2032 alloc'd
>==22164==    at 0x40045A04: malloc (vg_clientfuncs.c:100)
>==22164==    by 0x80B513A: Perl_safesysmalloc (util.c:70)
>==22164==    by 0x80C8174: Perl_av_extend (av.c:130)
>==22164==    by 0x80FB57B: Perl_stack_grow (scope.c:56)

What exactly is on line 337 of sv.c (I am not sure my copy is exactly 5.8.1)?

As the bad addresses vary this looks like something trampling on SVs - 
e.g. XS code doing off-by-one on PV or similar.



>==22164== 
>==22164== Invalid read of size 4
>==22164==    at 0x80D63CE: S_visit (sv.c:337)
>==22164==    by 0x80D6736: Perl_sv_clean_objs (sv.c:431)
>==22164==    by 0x805FCEA: perl_destruct (perl.c:383)
>==22164==    by 0x805E75E: main (perlmain.c:88)
>==22164==    Address 0x43609D08 is 0 bytes after a block of size 2032 alloc'd
>==22164==    at 0x40045A04: malloc (vg_clientfuncs.c:100)
>==22164==    by 0x80B513A: Perl_safesysmalloc (util.c:70)
>==22164==    by 0x80C8174: Perl_av_extend (av.c:130)
>==22164==    by 0x80FB57B: Perl_stack_grow (scope.c:56)
>==22164== 
>==22164== Invalid read of size 1
>==22164==    at 0x80D63C0: S_visit (sv.c:337)
>==22164==    by 0x80D6736: Perl_sv_clean_objs (sv.c:431)
>==22164==    by 0x805FCEA: perl_destruct (perl.c:383)
>==22164==    by 0x805E75E: main (perlmain.c:88)
>==22164==    Address 0x43609D18 is not stack'd, malloc'd or free'd
>==22164== 
>==22164== Invalid read of size 4
>==22164==    at 0x80D63CE: S_visit (sv.c:337)
>==22164==    by 0x80D6736: Perl_sv_clean_objs (sv.c:431)
>==22164==    by 0x805FCEA: perl_destruct (perl.c:383)
>==22164==    by 0x805E75E: main (perlmain.c:88)
>==22164==    Address 0x43609D14 is 12 bytes after a block of size 2032 alloc'd
>==22164==    at 0x40045A04: malloc (vg_clientfuncs.c:100)
>==22164==    by 0x80B513A: Perl_safesysmalloc (util.c:70)
>==22164==    by 0x80C8174: Perl_av_extend (av.c:130)
>==22164==    by 0x80FB57B: Perl_stack_grow (scope.c:56)
>==22164== 
>==22164== Invalid read of size 4
>==22164==    at 0x80D63CE: S_visit (sv.c:337)
>==22164==    by 0x80D6736: Perl_sv_clean_objs (sv.c:431)
>==22164==    by 0x805FCEA: perl_destruct (perl.c:383)
>==22164==    by 0x805E75E: main (perlmain.c:88)
>==22164==    Address 0x43609D20 is not stack'd, malloc'd or free'd
>==22164== 
>==22164== Invalid read of size 4
>==22164==    at 0x80D645E: do_clean_objs (sv.c:383)
>==22164==    by 0x80D63E2: S_visit (sv.c:338)
>==22164==    by 0x80D6736: Perl_sv_clean_objs (sv.c:431)
>==22164==    by 0x805FCEA: perl_destruct (perl.c:383)
>==22164==    Address 0x4360A558 is not stack'd, malloc'd or free'd
>==22164== 
>==22164== Invalid read of size 4
>==22164==    at 0x80D6471: do_clean_objs (sv.c:383)
>==22164==    by 0x80D63E2: S_visit (sv.c:338)
>==22164==    by 0x80D6736: Perl_sv_clean_objs (sv.c:431)
>==22164==    by 0x805FCEA: perl_destruct (perl.c:383)
>==22164==    Address 0x4360A580 is not stack'd, malloc'd or free'd
>==22164== 
>==22164== Invalid read of size 4
>==22164==    at 0x80D6476: do_clean_objs (sv.c:383)
>==22164==    by 0x80D63E2: S_visit (sv.c:338)
>==22164==    by 0x80D6736: Perl_sv_clean_objs (sv.c:431)
>==22164==    by 0x805FCEA: perl_destruct (perl.c:383)
>==22164==    Address 0x0 is not stack'd, malloc'd or free'd



Reply to: