id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 13259,"seg fault at cleanup time, __run_exit_handlers","James E. King, III",Robert Ramey,"I am getting a segfault at __run_exit_handlers time with 1.66 develop commit id d21a064a69663faf106ea363bf4785904bfd44d1 (Oct 6) using build command {{{~/boost/libs/serialization/test$ ../../../b2 toolset=clang test_dll_exported -q}}}: {{{ ==13247== Invalid free() / delete / delete[] / realloc() ==13247== at 0x4C2F25B: operator delete(void*) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==13247== by 0x50A097F: __gnu_cxx::new_allocator >::deallocate(std::_Rb_tree_node*, unsigned long) (new_allocator.h:110) ==13247== by 0x50A092F: __gnu_cxx::__alloc_traits > >::deallocate(std::allocator >&, std::_Rb_tree_node*, unsigned long) (alloc_traits.h:133) ==13247== by 0x50A07CB: std::_Rb_tree, boost::serialization::typeid_system::type_compare, std::allocator >::_M_put_node(std::_Rb_tree_node*) (stl_tree.h:509) ==13247== by 0x50A071B: std::_Rb_tree, boost::serialization::typeid_system::type_compare, std::allocator >::_M_drop_node(std::_Rb_tree_node*) (stl_tree.h:576) ==13247== by 0x50A127B: std::_Rb_tree, boost::serialization::typeid_system::type_compare, std::allocator >::_M_erase_aux(std::_Rb_tree_const_iterator) (stl_tree.h:2275) ==13247== by 0x50A1234: std::_Rb_tree, boost::serialization::typeid_system::type_compare, std::allocator >::erase(std::_Rb_tree_const_iterator) (stl_tree.h:1057) ==13247== by 0x509FF64: std::multiset >::erase(std::_Rb_tree_const_iterator) (stl_multiset.h:571) ==13247== by 0x509FB97: boost::serialization::typeid_system::extended_type_info_typeid_0::type_unregister() (extended_type_info_typeid.cpp:108) ==13247== by 0x4205E4: boost::serialization::extended_type_info_typeid::~extended_type_info_typeid() (extended_type_info_typeid.hpp:96) ==13247== by 0x420134: boost::serialization::singleton >::get_instance()::singleton_wrapper::~singleton_wrapper() (singleton.hpp:117) ==13247== by 0x601B26F: __run_exit_handlers (exit.c:83) ==13247== Address 0x63b9d80 is 0 bytes inside a block of size 40 free'd ==13247== at 0x4C2F25B: operator delete(void*) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==13247== by 0x50A097F: __gnu_cxx::new_allocator >::deallocate(std::_Rb_tree_node*, unsigned long) (new_allocator.h:110) ==13247== by 0x50A092F: __gnu_cxx::__alloc_traits > >::deallocate(std::allocator >&, std::_Rb_tree_node*, unsigned long) (alloc_traits.h:133) ==13247== by 0x50A07CB: std::_Rb_tree, boost::serialization::typeid_system::type_compare, std::allocator >::_M_put_node(std::_Rb_tree_node*) (stl_tree.h:509) ==13247== by 0x50A071B: std::_Rb_tree, boost::serialization::typeid_system::type_compare, std::allocator >::_M_drop_node(std::_Rb_tree_node*) (stl_tree.h:576) ==13247== by 0x50A0647: std::_Rb_tree, boost::serialization::typeid_system::type_compare, std::allocator >::_M_erase(std::_Rb_tree_node*) (stl_tree.h:1640) ==13247== by 0x50A05BE: std::_Rb_tree, boost::serialization::typeid_system::type_compare, std::allocator >::~_Rb_tree() (stl_tree.h:873) ==13247== by 0x50A0584: std::multiset >::~multiset() (stl_multiset.h:92) ==13247== by 0x50A0414: boost::serialization::singleton > >::get_instance()::singleton_wrapper::~singleton_wrapper() (singleton.hpp:117) ==13247== by 0x601B5E9: __cxa_finalize (cxa_finalize.c:56) ==13247== by 0x5087F12: ??? (in /home/jking/boost/bin.v2/libs/serialization/build/clang-gnu-linux-4.0.0/debug/threadapi-pthread/libboost_serialization.so.1.66.0) ==13247== by 0x4011109: _dl_fini (dl-fini.c:235) ==13247== Block was alloc'd at ==13247== at 0x4C2E19F: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==13247== by 0x50A0FC0: __gnu_cxx::new_allocator >::allocate(unsigned long, void const*) (new_allocator.h:104) ==13247== by 0x50A0F6B: __gnu_cxx::__alloc_traits > >::allocate(std::allocator >&, unsigned long) (alloc_traits.h:130) ==13247== by 0x50A0E43: std::_Rb_tree, boost::serialization::typeid_system::type_compare, std::allocator >::_M_get_node() (stl_tree.h:505) ==13247== by 0x50A0DFF: std::_Rb_tree, boost::serialization::typeid_system::type_compare, std::allocator >::_M_create_node(boost::serialization::typeid_system::extended_type_info_typeid_0 const* const&) (stl_tree.h:527) ==13247== by 0x50A0D8F: std::_Rb_tree_node* std::_Rb_tree, boost::serialization::typeid_system::type_compare, std::allocator >::_Alloc_node::operator()(boost::serialization::typeid_system::extended_type_info_typeid_0 const* const&) const (stl_tree.h:473) ==13247== by 0x50A0BDB: std::_Rb_tree_iterator std::_Rb_tree, boost::serialization::typeid_system::type_compare, std::allocator >::_M_insert_, boost::serialization::typeid_system::type_compare, std::allocator >::_Alloc_node>(std::_Rb_tree_node_base*, std::_Rb_tree_node_base*, boost::serialization::typeid_system::extended_type_info_typeid_0 const* const&, std::_Rb_tree, boost::serialization::typeid_system::type_compare, std::allocator >::_Alloc_node&) (stl_tree.h:1535) ==13247== by 0x50A09FC: std::_Rb_tree, boost::serialization::typeid_system::type_compare, std::allocator >::_M_insert_equal(boost::serialization::typeid_system::extended_type_info_typeid_0 const* const&) (stl_tree.h:1918) ==13247== by 0x509FE2C: std::multiset >::insert(boost::serialization::typeid_system::extended_type_info_typeid_0 const* const&) (stl_multiset.h:474) ==13247== by 0x509FA68: boost::serialization::typeid_system::extended_type_info_typeid_0::type_register(std::type_info const&) (extended_type_info_typeid.cpp:91) ==13247== by 0x4201CA: boost::serialization::extended_type_info_typeid::extended_type_info_typeid() (extended_type_info_typeid.hpp:91) ==13247== by 0x4200FE: boost::serialization::singleton >::get_instance()::singleton_wrapper::singleton_wrapper() (singleton.hpp:117) }}} In gdb it looks like this, not sure if it's the same thing however: {{{ (gdb) r Starting program: /home/jking/boost/bin.v2/libs/serialization/test/test_dll_exported.test/clang-gnu-linux-4.0.0/debug/threadapi-pthread/test_dll_exported No errors detected. Program received signal SIGSEGV, Segmentation fault. 0x00007ffff71f79b6 in std::_Rb_tree_rebalance_for_erase(std::_Rb_tree_node_base*, std::_Rb_tree_node_base&) () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (gdb) bt #0 0x00007ffff71f79b6 in std::_Rb_tree_rebalance_for_erase(std::_Rb_tree_node_base*, std::_Rb_tree_node_base&) () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6 #1 0x00007ffff793564b in std::_Rb_tree, boost::serialization::detail::key_compare, std::allocator >::_M_erase_aux ( this=0x7ffff7b9e948 > >::get_instance()::t>, __position=0x631870 >::get_instance()::t>) at /usr/bin/../lib/gcc/x86_64-linux-gnu/6.3.0/../../../../include/c++/6.3.0/bits/stl_tree.h:2272 #2 0x00007ffff7935615 in std::_Rb_tree, boost::serialization::detail::key_compare, std::allocator >::erase ( this=0x7ffff7b9e948 > >::get_instance()::t>, __position=0x631870 >::get_instance()::t>) at /usr/bin/../lib/gcc/x86_64-linux-gnu/6.3.0/../../../../include/c++/6.3.0/bits/stl_tree.h:1057 #3 0x00007ffff7934395 in std::multiset >::erase ( this=0x7ffff7b9e948 > >::get_instance()::t>, __position=0x631870 >::get_instance()::t>) at /usr/bin/../lib/gcc/x86_64-linux-gnu/6.3.0/../../../../include/c++/6.3.0/bits/stl_multiset.h:571 #4 0x00007ffff7933ec9 in boost::serialization::extended_type_info::key_unregister (this=0x631870 >::get_instance()::t>) at ../../../libs/serialization/src/extended_type_info.cpp:136 #5 0x000000000041fed7 in boost::serialization::extended_type_info_no_rtti::~extended_type_info_no_rtti ( this=0x631870 >::get_instance()::t>) at ../../../boost/serialization/extended_type_info_no_rtti.hpp:107 #6 0x000000000041fa05 in boost::serialization::singleton >::get_instance()::singleton_wrapper::~singleton_wrapper() ( this=0x631870 >::get_instance()::t>) at ../../../boost/serialization/singleton.hpp:117 #7 0x00007ffff68a3270 in __run_exit_handlers (status=0, listp=0x7ffff6c2a5d8 <__exit_funcs>, run_list_atexit=run_list_atexit@entry=true, run_dtors=run_dtors@entry=true) at exit.c:83 #8 0x00007ffff68a32ca in __GI_exit (status=) at exit.c:105 #9 0x00007ffff68893f8 in __libc_start_main (main=0x414660 , argc=1, argv=0x7fffffffe2e8, init=, fini=, rtld_fini=, stack_end=0x7fffffffe2d8) at ../csu/libc-start.c:325 #10 0x00000000004143ca in _start () at ../../../boost/serialization/singleton.hpp:155 }}} I don't think either of these issues specifically describes the memory leak in #13186 (valgrind is reporting that too) which is why I am opening a new defect for it.",Bugs,new,To Be Determined,serialization,Boost Development Trunk,Problem,,,