Runtime crashes when mixing _GLIBCXX_DEBUG settings

Evan Driscoll driscoll@cs.wisc.edu
Thu Oct 11 22:06:00 GMT 2012


On 10/10/2012 06:15 PM, Jonathan Wakely wrote:
>> 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.

Ah, okay. The documentation made it sound to me like "our design *will*
either work or cause a linker error" rather than "we make a good
attempt, but there are some things that slip through the cracks". We use
STL containers as class members a lot, so if that can get by the
"checking" that the linker does, that sounds like a likely cause to me.


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

Well, you gave an alternative way of getting a somewhat similar result
as using _GLIBCXX_DEBUG. :-) (Don't take my re-asking the question here
to say that I don't appreciate your answers here or there BTW, because I
definitely do appreciate the time taken. I just figured if someone saw
it here but not there, they might have a trick up their sleeve. I also
didn't know that you were involved with GCC/stdlibc++ enough to watch
this list.)

Evan

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 554 bytes
Desc: OpenPGP digital signature
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20121011/21cc48cb/attachment.sig>


More information about the Libstdc++ mailing list