[Boost-bugs] [Boost C++ Libraries] #3014: Assertion on unregistering of extended_type_info

Subject: [Boost-bugs] [Boost C++ Libraries] #3014: Assertion on unregistering of extended_type_info
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-05-10 18:55:48


#3014: Assertion on unregistering of extended_type_info
----------------------------------+-----------------------------------------
 Reporter: mazay0_at_[hidden] | Owner: ramey
     Type: Bugs | Status: new
Milestone: Boost 1.39.0 | Component: serialization
  Version: Boost Release Branch | Severity: Problem
 Keywords: |
----------------------------------+-----------------------------------------
 /With boost version 1.39.0 I got the following behavior. On exit from the
 program an assertion assert(NULL != l) in extended_type_info.cpp:47
 failed. After some debugging I have revealed that same instances of
 extended_type_info were registered by extended_type_info::key_register()
 several times (about 3-4 times each). I am not sure if it is normal. The
 program which I debugged, staticaly links a library, and this library
 includes same headers with serializable classes as the program.
 Anyway, the multimap returned by
 singleton<detail::ktmap>::get_mutable_instance() may contain
 extended_type_info instances with the same m_key. BUT in
 extended_type_info::key_register():103, after removal of type info from
 the multimap, the value of m_key is being NULLed (m_key = NULL).
 Therefore, if this instance of extended_type_info is contained in the
 multimap at least once, it will make the next call of lower_bound to fail,
 because it has NULL in its m_key.

 As a temporary fix I have commented out the the following strings
 //assert(start != end);
 and
 //m_key = NULL;
 I removed the assertion because now the check in extended_type_info
 destructor may not work and key_unregister() method may be called for an
 instance allready removed from the multiset.


 I suppose that multiple registration can be caused by anonymous namespace
 introduced in export.hpp file around guid_initializer, but I didn't make
 deep investigations.

 The initial issue was observed on
 Win-32 + mingw-gcc.4.3
  and on
 Ubuntu-Linux-64 + gcc.4.3

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/3014>
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