This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Re: How to debug "*** glibc detected *** double free or corruption" bugs?
- From: Nix <nix at esperi dot org dot uk>
- To: Gregoire Banderet <gregoire dot banderet at ge dot com>
- Cc: libc-help at sourceware dot org
- Date: Sun, 23 Nov 2008 23:35:12 +0000
- Subject: Re: How to debug "*** glibc detected *** double free or corruption" bugs?
- References: <49185673.3050302@ge.com>
On 10 Nov 2008, Gregoire Banderet told this:
> The core file seems to be useless as the libs uses abort() in this case. E.g.:
> (gdb) bt
> #0 0xb7fbd424 in __kernel_vsyscall ()
> #1 0xb7d53640 in raise () from /lib/i686/cmov/libc.so.6
> #2 0xb7d55018 in abort () from /lib/i686/cmov/libc.so.6
> #3 0xb7d903dd in ?? () from /lib/i686/cmov/libc.so.6
> #4 0x00000004 in ?? ()
> ...
>
> But, using the backtrace information from the libc, I have a good idea of where is the problem in my code.
>
> The issue is when your target as no backtrace() function. Mine is a DaVinci ARM from TI. On this platform (with a libc version
> 2.3.3), there is no backtrace infos after the message "*** glibc detected ***".
>
> And, as the core file does not say anything about the bt, how can I debug the memory corruption?
If you link with the debugging C library, -lc_g, you'll get debugging
info back past abort().
(Might it not be a good idea to compile abort() with debugging
information at all times, even when compiling the normal shared libcs?)
--
`Not even vi uses vi key bindings for its command line.' --- PdS