Re: Interpret object causing crash in __cxa_finalize (have core)

Jan Kratochvil
2011-08-24T20:34:42Z

On Wed, 24 Aug 2011 22:18:45 +0200, Jeffrey Walton wrote:
> We are also interested in memory leaks - other libraries affect our integrity.

Then please do not complain on too many messages, the mails said Boost is not
conforming to memory leak checkers (that does not mean it really leaks).
This mail thread is about memory corruption, not about memory leaks.

> Yes, we have -g3 -ggdb.

-ggdb in fact has no effect.

> But we seem to be missing diagnostic
> information from __do_global_dtors_aux and __cxa_finalize.

You have full debug info from __cxa_finalize, what more info would you like?

__do_global_dtors_aux just executes all the destructors, there isn't anything
interesting inside. It is assembled from gcc sources some special ways so its
debug info is missing.

> OK, I' seem to have a misconception. Is there no debug information
> associated with global constructors and destructors?

Global destructor is __cxa_finalize which has debug info. It runs destructors
for all the existing instances, for instance 0x83dfc0 is run the destructor
~map, it also has debug info.

> how does one determine the problematic object destructor?

There probably isn't any problematic object destructor. Just some code before
corrupted memory so the correct object destructor crashes on it later.

Please read more about memory corruption debugging, there is a wide range of
tools for it, GDB is not one of them. I have written one brief list of such
tools in the part 1 of:
http://people.redhat.com/jkratoch/DeveloperConference2011-debug.pdf

Regards,
Jan