[Boost-bugs] [Boost C++ Libraries] #3037: assert and later crash on app shutdown if BOOST_CLASS_EXPORT is used in headers

Subject: [Boost-bugs] [Boost C++ Libraries] #3037: assert and later crash on app shutdown if BOOST_CLASS_EXPORT is used in headers
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-05-15 13:51:10


#3037: assert and later crash on app shutdown if BOOST_CLASS_EXPORT is used in
headers
-------------------------------------------------+--------------------------
 Reporter: Marvin.Sielenkemper_at_[hidden] | Owner: ramey
     Type: Bugs | Status: new
Milestone: | Component: serialization
  Version: Boost 1.39.0 | Severity: Problem
 Keywords: |
-------------------------------------------------+--------------------------
 The extended_type_info is registered multiple times if a header bound
 BOOST_CLASS_EXPORT is included in multiple implementation files. Each of
 these registrations enters the same type info object into a (multi-)map.

 On shutdown only the _first_ unregistration removes _one_ object from the
 map and clears its key member. Since there are still pointers pointing to
 this object in the map, later unregistrations fail due to the invalid key.

 The problem can easily be fixed by either removing the "break;" in the
 unregister function (thus keeping the multiple equal pointers in the map)
 or adding "if (m_key) return;" in the register function (thereby
 collapsing the multiplicity to one).

 I have created a test to trigger the problem, patch follows.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/3037>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:00 UTC