This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Runtime crashes when mixing _GLIBCXX_DEBUG settings
- From: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- To: Evan Driscoll <driscoll at cs dot wisc dot edu>
- Cc: libstdc++ at gcc dot gnu dot org
- Date: Thu, 11 Oct 2012 00:15:56 +0100
- Subject: Re: Runtime crashes when mixing _GLIBCXX_DEBUG settings
- References: <5075F93B.4080302@cs.wisc.edu>
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.