Hi all again,
I have to stress the importance of a swift action/review here as the
current master now contains the flawed commit again that leads to a
certain crash when using shared libraries linked against static boost.
Reproduce with:
git clone git@github.com:boostorg/boost.git && cd boost && git submodule
update --recursive --init
./bootstrap.sh && ./b2 variant=release link=static
--with-libraries=serialization cxxflags=-fPIC cflags=-fPIC -j2
mkdir mytest && cd mytest
Create 3 files:
|test_multi_singleton.cpp:intf();intg();intmain(intargc,char**){// Make
sure symbols are
usedif(argc==8)returnf();if(argc==9)returng();}multi_singleton1.cpp:#includeintf(){return0!=boost::serialization::extended_type_info_typeid<int>::get_const_instance().get_key();}multi_singleton2.cpp:#includeintg(){//
Use different(!)
typereturn0!=boost::serialization::extended_type_info_typeid<float>::get_const_instance().get_key();}|
export CPATH=$PWD/..
export LIBRARY_PATH=$PWD/../stage/lib/
g++ multi_singleton1.cpp -lboost_serialization -fPIC -shared
-olibmulti_singleton1.so
g++ multi_singleton2.cpp -lboost_serialization -fPIC -shared
-olibmulti_singleton2.so
g++ test_multi_singleton.cpp -L. -lmulti_singleton1 -lmulti_singleton2
LD_LIBRARY_PATH=. ./a.out
Result: *** Error in `./a.out': double free or corruption (fasttop):
0x0000000001accc20 ***
This is due to the bug I described and fixed in
https://github.com/boostorg/serialization/pull/105.
An extract from there only showing the bug with `is_destroyed` is
https://github.com/boostorg/serialization/pull/110
In the current state I'm strongly against including the latest master
from Boost.Serialization. It would be better, to include the Boost 1.67
version of it which "only" contains a memory leak.
Regards, Alex