Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix singleton::is_destroyed and crash when using shared libraries #131

Closed
wants to merge 6 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add test to reproduce crash caused by destruction order
The test uses singletons in shared libraries that are linked against static boost. On termination the (internal) singletons will be destructed in an unexpected order causing a use-after-free and segfault/assert.
Flamefire committed Nov 7, 2018
commit ebc8db50e3fe5687245653fa46b7d43a56f4f473
18 changes: 18 additions & 0 deletions test/Jamfile.v2
Original file line number Diff line number Diff line change
@@ -52,6 +52,22 @@ lib dll_polymorphic_derived2
<link>shared:<define>BOOST_SERIALIZATION_DYN_LINK=1
;

lib multi_shared_1
:
multi_shared1.cpp
../build//boost_serialization/<link>static
:
<link>shared
;

lib multi_shared_2
:
multi_shared2.cpp
../build//boost_serialization/<link>static
:
<link>shared
;

test-suite "serialization" :
[ test-bsl-run_files test_array : A : : [ requires cxx11_hdr_array ] ] # BOOST_NO_CXX11_HDR_ARRAY
[ test-bsl-run_files test_boost_array : A ]
@@ -140,6 +156,8 @@ if ! $(BOOST_ARCHIVE_LIST) {
[ test-bsl-run test_dll_simple : : dll_a : ]
# [ test-bsl-run test_dll_plugin : : polymorphic_derived2 : <link>static:<build>no <target-os>linux:<linkflags>-ldl ]

# Tests using shared libraries which are linked against static boost. Hence ignore for shared boost build
[ test-bsl-run test_multi_shared_lib : : multi_shared_1 multi_shared_2 : <link>shared:<build>no ]
[ test-bsl-run test_private_ctor ]
[ test-bsl-run test_reset_object_address : A ]
[ test-bsl-run test_void_cast ]