[CXX-651] debug build (GLIBCXX_DEBUG) crash Created: 16/Aug/15  Updated: 18/Aug/15  Resolved: 18/Aug/15

Status: Closed
Project: C++ Driver
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Mike Analitiqa Mintz Assignee: Andrew Morrow (Inactive)
Resolution: Done Votes: 0
Labels: legacy-cxx
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related

 Description   

I’ve tried building a DEBUG version of the mongo-cxx-driver library on linux, and linking it against an app that defines GLIBCXX_DEBUG.

This app then crashes when I call mongo::client::GlobalInstance:: GlobalInstance()

The issue is most easily seen by printing out
sizeof(mongo::DBClientConnection) = 320
in the mongo code, and
sizeof(mongo::DBClientConnection) = 344

in my calling code (which defines GLIBCXX_DEBUG).

I think what is needed is some SCONS magic to pass along the GLIBCXX_DEBUG flag to the c++ compiler. I believe this should be done automatically when you define dbg=on, but given your history, that poses problems with backward compatability. At the very least you should provide a simple way to pass along GLIBCXX_DEBUG to the C++ compiler in this case.



 Comments   
Comment by Mike Analitiqa Mintz [ 17/Aug/15 ]

For future reference, so the Mongo folks can be more helpful, please note that it was insufficient. It just caused a crash someplace else.

You must also rebuild boost as
USE_B2_ARGS= variant=debug define=_GLIBCXX_DEBUG

Comment by Andrew Morrow (Inactive) [ 16/Aug/15 ]

analitiqa - Can you see if adding the following statement to your SCons invocation is sufficient?

CPPDEFINES=_GLIBCXX_DEBUG

In other words, if you previously built and installed the driver like:

scons --prefix=/some/where install

then try building like this:

scons CPPDEFINES=_GLIBCXX_DEBUG --prefix=/some/where install

There are actually many variables you can set this way, you can run

scons --variables-help

to get a list.

Generated at Wed Feb 07 21:59:52 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.