Boost logo

Boost :

Subject: Re: [boost] [Boost.Serialization] Crash in current master (1.68)
From: Alexander Grund (alexander.grund_at_[hidden])
Date: 2018-06-29 09:07:47


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_at_[hidden]: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:#include<boost/serialization/extended_type_info_typeid.hpp>intf(){return0!=boost::serialization::extended_type_info_typeid<int>::get_const_instance().get_key();}multi_singleton2.cpp:#include<boost/serialization/extended_type_info_typeid.hpp>intg(){//
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


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk