Runtime crashes when mixing _GLIBCXX_DEBUG settings

Evan Driscoll
Wed Oct 10 22:40:00 GMT 2012

I have a library (builds to a shared library) and a client program, both
under "my" control. I built a debug version of the library, forgetting
that doing so turns on _GLIBCXX_DEBUG to get the debug version of the
STL and such. (Doing this implicitly is probably a mistake, but that's
somewhat beside the point.) I then built the client program without
_GLIBCXX_DEBUG. It complied and linked successfully, but experienced
runtime crashes. Compiling the library without _GLIBCXX_DEBUG set or
compiling the client program with it set will cause it to work properly.

My understanding from the documentation of the debug feature of the
library is that this shouldn't be able to happen: mixed _GLIBCXX_DEBUG
settings should either work or cause a linker error. Is this true? If
so, should I try to reduce the broken example to get something that's
reportable as a bug? Or is this just one of those "don't do that"
things? (And in the latter case, any suggestions for how to detect the
problem? With MSVC, I'd use a '#pragma detect_mismatch' in their setup
to prevent intermixing of the debug and release library, though I am
unsure of what happens when you introduce libraries to the picture.)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 554 bytes
Desc: OpenPGP digital signature
URL: <>

More information about the Libstdc++ mailing list