id summary reporter owner description type status milestone component version severity resolution keywords cc 478 Serialization 1.33 assertion failure when deserializing STL tzlaine Robert Ramey "{{{ I am seeing an assertion failure in reset_object_address. The assertion output is: /tmp/boost_cvs/libs/serialization/src/basic_iarchive.cpp:266: void boost::archive::detail::basic_iarchive_impl::reset_object_address(const void*, const void*): Assertion `object_id_vector[i].address >= ol d_address' failed. These are the values in the failed assertion: i == 1 object_id_vector[i].address == 0x43ef0920 old_address == 0xbfffe240 For good measure, new_address == 0x43ee7830 and this == 0x43eeffc0 at the point of failure. I don't know if that indicates that old_address is garbage, or if it is supposed to be that far away from the other addresses. This is the same assertion failure reported in bug #1262084, but I am not using polymorphic archives. I verified that the test code submitted for that bug fails for me as well, but when I converted it to non-polymorphic archives, it works fine. Therefor I have no idea if these bugs are related. The code producing the failure worked fine under version 1.32. Unfortunately, the code that produces this failure is pretty involved. All my attempts to produce a minimal set of code that provokes the failure have failed. The object producing the failure is being serialized through a pointer-to-base. The inheritance of the object's class is Wnd -> Control -> TextControl. The object within the TextControl that is actually producing the failure is m_line_data, which is a std::vector. I have two fairly minimal serialize methods that I have created for the object being loaded when the failure occurs -- one of which works and on of which does not. Method A works: template void GG::TextControl::serialize(Archive& ar, const unsigned int version) { ar & BOOST_SERIALIZATION_NVP(m_line_data); } Method B fails: template void GG::TextControl::serialize(Archive& ar, const unsigned int version) { ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(Control) & BOOST_SERIALIZATION_NVP(m_line_data); } The XML file produced using A: 1 0 8 The XML file produced using B: 0 0 0 1 0 0 0 150 25 0 0 1073741824 1073741824 0 0 0 0 0 0 0 0 1 0 8 Below is the stack at the point of failure. I Hope this helps. #0 0xffffe410 in ?? () #1 0xbfffe050 in ?? () #2 0x00000006 in ?? () #3 0x4062bf79 in abort () from /lib/tls/libc.so.6 #4 0x40623fe3 in __assert_fail () from /lib/tls/libc.so.6 #5 0x404be06f in boost::archive::detail::basic_iarchive_impl::reset_object_address (this=0x43eeffc0, new_address=0x43ee7830, old_address=0xbfffe240) at /tmp/boost_cvs/libs/serialization/src/basic_iarchive.cpp:266 #6 0x404bd7b1 in boost::archive::detail::basic_iarchive::reset_object_address (this=0xbfffebc0, new_address=0x43ee7830, old_address=0xbfffe240) at /tmp/boost_cvs/libs/serialization/src/basic_iarchive.cpp:529 up 5#7 0x0809c679 in boost::serialization::stl::archive_input_seq > >::operator() (this=0xbfffe27e, ar=@0xbfffebc0, s=@0x43ef099c) at collections_load_imp.hpp:91 #8 0x0809c495 in rebuild_collection >, boost::serialization::stl::archive_input_seq > >, boost::serialization::stl::reserve_imp > > > (ar=@0xbfffebc0, s=@0x43ef099c) at collections_load_imp.hpp:208 #9 0x0809c41c in load_collection >, boost::serialization::stl::archive_input_seq > >, boost::serialization::stl::reserve_imp > > > (ar=@0xbfffebc0, s=@0x43ef099c) at collections_load_imp.hpp:230 #10 0x0809c402 in load > (ar=@0xbfffebc0, t=@0x43ef099c) at vector.hpp:58 #11 0x0809c3e9 in boost::serialization::free_loader > >::invoke (ar=@0xbfffebc0, t=@0x43ef099c, file_version=0) at split_free.hpp:58 #12 0x0809c3ad in split_free > > (ar=@0xbfffebc0, t=@0x43ef099c, file_version=0) at split_free.hpp:74 #13 0x0809c391 in serialize > (ar=@0xbfffebc0, t=@0x43ef099c, file_version=0) at vector.hpp:76 #14 0x0809b937 in serialize_adl > > (ar=@0xbfffebc0, t=@0x43ef099c, file_version=0) at serialization.hpp:140 #15 0x0809b3b0 in boost::archive::detail::iserializer > >::load_object_data (this=0x814c7e8, ar=@0xbfffebc0, x=0x43ef099c, file_version=0) at iserializer.hpp:158 #16 0x404be3c6 in boost::archive::detail::basic_iarchive_impl::load_object (this=0x43eeffc0, ar=@0xbfffebc0, t=0x43ef099c, bis=@0x814c7e8) at /tmp/boost_cvs/libs/serialization/src/basic_iarchive.cpp:378 #17 0x404bd7e1 in boost::archive::detail::basic_iarchive::load_object (this=0xbfffebc0, t=0x43ef099c, bis=@0x814c7e8) at /tmp/boost_cvs/libs/serialization/src/basic_iarchive.cpp:537 #18 0x08095170 in boost::archive::detail::load_non_pointer_type > >::load_standard::invoke (ar=@0xbfffebc0, t=@0x43ef099c) at iserializer.hpp:362 #19 0x08095144 in boost::archive::detail::load_non_pointer_type > >::invoke (ar=@0xbfffebc0, t=@0x43ef099c) at iserializer.hpp:412 #20 0x08094c6a in load > > (ar=@0xbfffebc0, t=@0x43ef099c) at iserializer.hpp:559 #21 0x08094c28 in boost::archive::basic_xml_iarchive::load_override > > (this=0xbfffebc0, t=@0xbfffe540) at basic_xml_iarchive.hpp:80 #22 0x08094bdc in boost::archive::xml_iarchive_impl::load_override > > const> ( this=0xbfffebc0, t=@0xbfffe540) at xml_iarchive.hpp:74 #23 0x08094bb3 in operator>> > > > (this=0xbfffebc0, t=@0xbfffe540) at interface_iarchive.hpp:84 #24 0x08093aab in operator& > > > (this=0xbfffebc0, t=@0xbfffe540) at interface_iarchive.hpp:91 #25 0x080947de in GG::TextControl::serialize (this=0x43ef0920, ar=@0xbfffebc0, version=0) at GGTextControl.h:223 #26 0x08094775 in serialize (ar=@0xbfffebc0, t=@0x43ef0920, file_version=0) at access.hpp:109 #27 0x08094759 in serialize (ar=@0xbfffebc0, t=@0x43ef0920, file_version=0) at serialization.hpp:81 #28 0x0808e7cd in serialize_adl (ar=@0xbfffebc0, t=@0x43ef0920, file_version=0) at serialization.hpp:140 #29 0x0809b672 in boost::archive::detail::iserializer::load_object_data (this=0x814cad0, ar=@0xbfffebc0, x=0x43ef0920, file_version=0) at iserializer.hpp:158 #30 0x404be323 in boost::archive::detail::basic_iarchive_impl::load_object (this=0x43eeffc0, ar=@0xbfffebc0, t=0x43ef0920, bis=@0x814cad0) at /tmp/boost_cvs/libs/serialization/src/basic_iarchive.cpp:363 #31 0x404bd7e1 in boost::archive::detail::basic_iarchive::load_object (this=0xbfffebc0, t=0x43ef0920, bis=@0x814cad0) at /tmp/boost_cvs/libs/serialization/src/basic_iarchive.cpp:537 #32 0x0809b2c4 in boost::archive::detail::load_non_pointer_type::load_standard::invoke (ar=@0xbfffebc0, t=@0x43ef0920) at iserializer.hpp:362 #33 0x0809b298 in boost::archive::detail::load_non_pointer_type::invoke (ar=@0xbfffebc0, t=@0x43ef0920) at iserializer.hpp:412 #34 0x0809af74 in load (ar=@0xbfffebc0, t=@0x43ef0920) at iserializer.hpp:559 #35 0x0809af28 in boost::archive::basic_xml_iarchive::load_override (this=0xbfffebc0, t=@0xbfffe760) at basic_xml_iarchive.hpp:80 #36 0x0809aedc in boost::archive::xml_iarchive_impl::load_override const> (this=0xbfffebc0, t=@0xbfffe760) at xml_iarchive.hpp:74 #37 0x08098aaf in operator>> > (this=0xbfffebc0, t=@0xbfffe760) at interface_iarchive.hpp:84 #38 0x080984c7 in boost::archive::detail::pointer_iserializer::load_object_ptr (this=0x814c8c0, ar=@0xbfffebc0, x=@0x43ed4518, file_version=0) at iserializer.hpp:308 #39 0x404be9b6 in boost::archive::detail::basic_iarchive_impl::load_pointer (this=0x43eeffc0, ar=@0xbfffebc0, t=@0xbfffed44, bpis_ptr=0x814c8c0, finder=0x8081928 ::find(boost::serialization::extended_type_info const&)>) at /tmp/boost_cvs/libs/serialization/src/basic_iarchive.cpp:482 #40 0x404bd817 in boost::archive::detail::basic_iarchive::load_pointer (this=0xbfffebc0, t=@0xbfffed44, bpis_ptr=0x814c8c0, finder=0x8081928 ::find(boost::serialization::extended_type_info const&)>) at /tmp/boost_cvs/libs/serialization/src/basic_iarchive.cpp:549 #41 0x0808b34b in boost::archive::detail::load_pointer_type::invoke (ar=@0xbfffebc0, t=@0xbfffed44) at iserializer.hpp:473 #42 0x08089d8e in load (ar=@0xbfffebc0, t=@0xbfffed44) at iserializer.hpp:559 #43 0x08089d4c in boost::archive::basic_xml_iarchive::load_override (this=0xbfffebc0, t=@0xbfffed90) at basic_xml_iarchive.hpp:80 #44 0x08089d00 in boost::archive::xml_iarchive_impl::load_override const> (this=0xbfffebc0, t=@0xbfffed90) at xml_iarchive.hpp:74 #45 0x08089cd7 in operator>> > (this=0xbfffebc0, t=@0xbfffed90) at interface_iarchive.hpp:84 #46 0x08087555 in operator& > (this=0xbfffebc0, t=@0xbfffed90) at interface_iarchive.hpp:91 #47 0x08085cb8 in SerializationTestGGApp::Initialize (this=0xbfffef50) at serialization.cpp:458 #48 0x400312cc in SDLGGApp::Run (this=0xbfffef50) at src/SDL/SDLGGApp.cpp:291 #49 0x402259ce in GG::App::operator() (this=0xbfffef50) at src/GGApp.cpp:257 #50 0x40030988 in SDLGGApp::operator() (this=0xbfffef50) at src/SDL/SDLGGApp.cpp:62 #51 0x08085fe8 in main (argc=1, argv=0xbfffeff4) at serialization.cpp:497 }}}" Bugs closed serialization None Invalid