Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Random corrupted double-linked list

by ghenry (Vicar)
on Feb 13, 2012 at 17:34 UTC ( [id://953501]=perlquestion: print w/replies, xml ) Need Help??

ghenry has asked for the wisdom of the Perl Monks concerning the following question:

Hi all,

Where do I start with debugging something like this? Do I re-compile with debugging symbols and see what's in the backtrace?

*** glibc detected *** t/03create_customer.t: corrupted double-linked +list: 0x0db445f8 *** ======= Backtrace: ========= /lib/i686/nosegneg/libc.so.6[0xa617f6] /lib/i686/nosegneg/libc.so.6[0xa63a67] /lib/i686/nosegneg/libc.so.6[0xa6549e] /lib/i686/nosegneg/libc.so.6(realloc+0xed)[0xa6614d] /home/ghenry/perl5/perlbrew/perls/perl-5.10.1/lib/5.10.1/i686-linux-th +read-multi/CORE/libperl.so(Perl_safesysrealloc+0x47)[0xbe32c7] /home/ghenry/perl5/perlbrew/perls/perl-5.10.1/lib/5.10.1/i686-linux-th +read-multi/CORE/libperl.so(Perl_sv_grow+0x74)[0xc10744] /home/ghenry/perl5/perlbrew/perls/perl-5.10.1/lib/5.10.1/i686-linux-th +read-multi/CORE/libperl.so(Perl_sv_catpvn_flags+0x11a)[0xc1150a] /home/ghenry/perl5/perlbrew/perls/perl-5.10.1/lib/5.10.1/i686-linux-th +read-multi/CORE/libperl.so(Perl_sv_catsv_flags+0xf8)[0xc167b8] /home/ghenry/perl5/perlbrew/perls/perl-5.10.1/lib/5.10.1/i686-linux-th +read-multi/CORE/libperl.so(Perl_pp_require+0x14ce)[0xc30a3e] /home/ghenry/perl5/perlbrew/perls/perl-5.10.1/lib/5.10.1/i686-linux-th +read-multi/CORE/libperl.so(Perl_runops_standard+0x1f)[0xbf8f5f] /home/ghenry/perl5/perlbrew/perls/perl-5.10.1/lib/5.10.1/i686-linux-th +read-multi/CORE/libperl.so(Perl_call_sv+0x46d)[0xb9867d] /home/ghenry/perl5/perlbrew/perls/perl-5.10.1/lib/5.10.1/i686-linux-th +read-multi/CORE/libperl.so(Perl_sv_clear+0xb7)[0xc0cca7] /home/ghenry/perl5/perlbrew/perls/perl-5.10.1/lib/5.10.1/i686-linux-th +read-multi/CORE/libperl.so(Perl_sv_free2+0x58)[0xc0d4e8] /home/ghenry/perl5/perlbrew/perls/perl-5.10.1/lib/5.10.1/i686-linux-th +read-multi/CORE/libperl.so(Perl_sv_free+0xd6)[0xc0d606] /home/ghenry/perl5/perlbrew/perls/perl-5.10.1/lib/5.10.1/i686-linux-th +read-multi/CORE/libperl.so[0xc0ddc0] /home/ghenry/perl5/perlbrew/perls/perl-5.10.1/lib/5.10.1/i686-linux-th +read-multi/CORE/libperl.so[0xc028e0] /home/ghenry/perl5/perlbrew/perls/perl-5.10.1/lib/5.10.1/i686-linux-th +read-multi/CORE/libperl.so(Perl_sv_clean_objs+0x3a)[0xc0294a] /home/ghenry/perl5/perlbrew/perls/perl-5.10.1/lib/5.10.1/i686-linux-th +read-multi/CORE/libperl.so(perl_destruct+0x11c8)[0xb9d2a8] t/03create_customer.t(main+0xd7)[0x80489d7] /lib/i686/nosegneg/libc.so.6(__libc_start_main+0xdc)[0xa0ee9c] t/03create_customer.t[0x8048841]

Thanks.

Walking the road to enlightenment... I found a penguin and a camel on the way.....
Fancy a yourname@perl.me.uk? Just ask!!!

Replies are listed 'Best First'.
Re: Random corrupted double-linked list
by dave_the_m (Monsignor) on Feb 13, 2012 at 18:44 UTC
    Well, here are some random observations.

    The backtrace in question shows that a destructor is being called during global destruction; that destructor is calling require - not illegal, but unusal; require is creating a string of some sort, and while trying to grow it, the system malloc detects some internal corruption. This usually means that something corrupted it earlier; either due to a bug in perl, or a bug in an XS module that was earlier loaded.

    Building with debugging symbols will get you line numbers and function arguments, while building with Configure -DDEBUGGING may trigger an earlier assertion. But if you're on a system that supports it, you'll be best off using valgrind to see what's happening.

    Finally, 5.10.1 is quite old; it may be that a bug is already fixed in 5.12.4 or 5.14.2.

    Dave

      OK, great. I only chose 5.10.1 as that is what comes with Debian Squeeze and installed 5.10.1 on CentOS which is the Devel VM.

      I control all ENVs so there's no reason I can't go to 5.14.2

      I'll do that in case something else comes along, then use valgrind. Both prod, test and dev will then get the same everything.

      Thanks.

      Walking the road to enlightenment... I found a penguin and a camel on the way.....
      Fancy a yourname@perl.me.uk? Just ask!!!

      That's 5.14.2 in and all my Catalyst app requirements installed.

      Just running script/surevoip_api_server.pl produces a Segmentation fault....

      Walking the road to enlightenment... I found a penguin and a camel on the way.....
      Fancy a yourname@perl.me.uk? Just ask!!!

        It sounds like you have found a bug in perl. Kudos to you, especially if no one else has found and reported it before you.

        Two things you might try:

        • Is the bug reproducible in the latest development release of perl? (5.15.7 I think). The easiest way to compile and install a dev release of perl is with perlbrew.
        • Can you produce a minimal script that shows the bug that is as small as possible with a few dependencies as possible? Catalyst apps have a notoriously large number of dependences, so the perl maintainers won't enjoy digging through that mountain to find the module that is causing the trouble. The usual method is to start commenting out blocks of your code until you find the smallest script that will cause the bug.
Re: Random corrupted double-linked list
by ghenry (Vicar) on Feb 16, 2012 at 19:38 UTC

    Looks like this was my issue with local::lib and perlbrew with XS things mixed between versions.

    Don't use local::lib, XS modules and different perlbrew perls!

    Walking the road to enlightenment... I found a penguin and a camel on the way.....
    Fancy a yourname@perl.me.uk? Just ask!!!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://953501]
Approved by Corion
Front-paged by tye
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2024-04-19 22:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found