khizmax/libcds

Release/Debug build incompatibility

mlegenovic opened this issue · 3 comments

Hi,
We want to use this library in our project, but we have a problem (concrete signal 11 crashes) when we use libcds release build, and our executable as debug build.
It seams that header-only part is not compatible with compiled part of libcds if NDEBUG is set differently.

At the moment the only solution for us is to patch libcds (concreate to remove #define CDS_DEBUG statement), so that we can work without crashes.

This is also a huge problem for linux distributors because they have to build libcds in both versions, debug and release, and you have to link against first or second dependent on your build profile. This is not usual behaviour. I can for example use boost library provided by my distributor (which is built with release profile), and link them to my project which i have built in debug profile. Of course, it is not possible then to debug in boost library, but usualy you don't want to do that, you want to debug only your code. Executable will work without crashes.

Do you have a better solution for this problem? Is it possible to make CDS_DEBUG definition dependent on a different condition then #if !defined(NDEBUG)? In our Makefiles we do not set NDEBUG for debug build, and this activates CDS_DEBUG macro too, but compiled part of libcds was build without CDS_DEBUG?

Thanks in advance

Hmm... At first glance I dont' see any problem with debug/release mix for libcds.
Maybe, your crashes is really errors in your project or even in libcds?..
Can you give me at least the backtrace of any crash?

Of course, I can add preprocessor defs like -DCDS_DEBUG/-DCDS_NODEBUG in compiler's command line but at this moment it seems superfluous and ugly "feature" for me.

Hi,
is it possible that you are missing a

current_block_ = block;

arround line 401 in dhp.h?

Hi,
Yes, you are right, thanks!