Boost C++ Libraries: Ticket #3037: assert and later crash on app shutdown if BOOST_CLASS_EXPORT is used in headers https://svn.boost.org/trac10/ticket/3037 <p> 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. </p> <p> 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. </p> <p> 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). </p> <p> I have created a test to trigger the problem, patch follows. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/3037 Trac 1.4.3 Marvin.Sielenkemper@… Fri, 15 May 2009 13:54:22 GMT attachment set https://svn.boost.org/trac10/ticket/3037 https://svn.boost.org/trac10/ticket/3037 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">patch2-fix.txt</span> </li> </ul> <p> the collapsing fix </p> Ticket Robert Ramey Sat, 16 May 2009 21:30:16 GMT status changed https://svn.boost.org/trac10/ticket/3037#comment:1 https://svn.boost.org/trac10/ticket/3037#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> </ul> Ticket Marvin.Sielenkemper@… Mon, 18 May 2009 05:36:16 GMT attachment set https://svn.boost.org/trac10/ticket/3037 https://svn.boost.org/trac10/ticket/3037 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">patch2-test.zip</span> </li> </ul> <p> a new test to trigger the problem </p> Ticket Robert Ramey Mon, 18 May 2009 16:09:23 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/3037#comment:2 https://svn.boost.org/trac10/ticket/3037#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> I have made changes to extended_type_info.cpp and void_cast.cpp in the trunk. I can't really test these very well. I would appreciate it if you could rebuild the library with these latest files and try again. </p> <p> Robert Ramey </p> Ticket Marvin.Sielenkemper@… Mon, 08 Jun 2009 08:27:57 GMT status, version changed; milestone set; resolution deleted https://svn.boost.org/trac10/ticket/3037#comment:3 https://svn.boost.org/trac10/ticket/3037#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">closed</span> → <span class="trac-field-new">reopened</span> </li> <li><strong>version</strong> <span class="trac-field-old">Boost 1.39.0</span> → <span class="trac-field-new">Boost Development Trunk</span> </li> <li><strong>resolution</strong> <span class="trac-field-deleted">fixed</span> </li> <li><strong>milestone</strong> → <span class="trac-field-new">Boost 1.40.0</span> </li> </ul> <p> Checked with trunk rev. 53717. </p> <p> The test opens a dialog (Debug Assertion Failed! [Cancel] [Retry] [Ignore]) and fails with message </p> <p> --- snip --- </p> <p> No errors detected. Assertion failed: NULL != r, file ..\..\..\libs\serialization\src\extended_type_info.cpp, line 49 </p> <p> This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information. EXIT STATUS: 3 </p> <p> --- snip --- </p> <p> I'll try to add the relevant compiled files as an attachment. </p> Ticket Marvin.Sielenkemper@… Mon, 08 Jun 2009 08:30:14 GMT attachment set https://svn.boost.org/trac10/ticket/3037 https://svn.boost.org/trac10/ticket/3037 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">test_exported2.7z</span> </li> </ul> <p> compiled binary with debug information (msvc 8.0) </p> Ticket Robert Ramey Thu, 09 Jul 2009 14:59:24 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/3037#comment:4 https://svn.boost.org/trac10/ticket/3037#comment:4 <ul> <li><strong>status</strong> <span class="trac-field-old">reopened</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> I've made changes to address this in the trunk. As I write this, only one test - test_no_rtti is manifesting this behavior. I', still looking at this. double check wiht the trunk version </p> Ticket