Opened 13 years ago
Closed 13 years ago
#3037 closed Bugs (fixed)
assert and later crash on app shutdown if BOOST_CLASS_EXPORT is used in headers
Reported by: | Owned by: | Robert Ramey | |
---|---|---|---|
Milestone: | Boost 1.40.0 | Component: | serialization |
Version: | Boost Development Trunk | Severity: | Problem |
Keywords: | Cc: |
Description
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.
Attachments (3)
Change History (7)
by , 13 years ago
Attachment: | patch2-fix.txt added |
---|
comment:1 by , 13 years ago
Status: | new → assigned |
---|
comment:2 by , 13 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
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.
Robert Ramey
comment:3 by , 13 years ago
Milestone: | → Boost 1.40.0 |
---|---|
Resolution: | fixed |
Status: | closed → reopened |
Version: | Boost 1.39.0 → Boost Development Trunk |
Checked with trunk rev. 53717.
The test opens a dialog (Debug Assertion Failed! [Cancel] [Retry] [Ignore]) and fails with message
--- snip ---
No errors detected. Assertion failed: NULL != r, file ..\..\..\libs\serialization\src\extended_type_info.cpp, line 49
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
--- snip ---
I'll try to add the relevant compiled files as an attachment.
by , 13 years ago
Attachment: | test_exported2.7z added |
---|
compiled binary with debug information (msvc 8.0)
comment:4 by , 13 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
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
the collapsing fix