How to debug "*** glibc detected *** double free or corruption" bugs?

Carlos O'Donell carlos@systemhalted.org
Tue Nov 25 13:43:00 GMT 2008


On Mon, Nov 24, 2008 at 6:01 PM, Nix <nix@esperi.org.uk> wrote:
>> On ARM you must compile all of your application and shared libraries
>> with unwind tables for the debugger to be able to unwind the stack
>> e.g. -funwind-tables -fasynchronous-unwind-tables.
>>
>> The backtrace() function has not yet been implemented for ARM under
>> the new EABI.
>
> Using DWARF2 unwinding is likely preferable anyway, isn't it?

In GCC the unwind tables are DWARF2 call frame information, and the
implementation of backtrace() for some targets, including x86, use
this information to correctly unwind the stack. However, the later
requires that your distribution build all the system shared libraries
with unwind information.

>>> (Might it not be a good idea to compile abort() with debugging
>>> information at all times, even when compiling the normal shared libcs?)
>>
>> This is not a decision for the project to make. Distributions should
>> make this decision, they understand their users requirements better,
>> and can customize CFLAGS accordingly for all or a subset of the
>> library.
>
> True. I was just wondering if this might be a more sensible
> default. Right now the default yields a library in which abort() is
> basically useless...

I do not believe that is as useful as you think, and if you do, then
patch glibc.

What most users really want is the entire library compiled with debug
information, which is what debian already provides.

Cheers,
Carlos.



More information about the Libc-help mailing list