Runtime crashes when mixing _GLIBCXX_DEBUG settings

Jonathan Wakely jwakely.gcc@gmail.com
Wed Oct 10 23:16:00 GMT 2012


On 10 October 2012 23:39, Evan Driscoll wrote:
> 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

Mangled names don't include function return types, so it's entirely
possible to get crashes still, the system isn't foolproof.

To know if you've found a real problem or not we'd need a testcase.

> 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.)

I already answered that part on Stackoverflow.



More information about the Libstdc++ mailing list