Serialization Archive Incompatibility between Boost Versions
Hello How is it possible to load serialized objects with a newer boost version than they have been saved with. I have installed boost version 1.36 and I cannot read archives that have been save with boost 1.35. This is not possible because boost 1.35 puts 'serialization::archive 4' into the files but boost 1.36 needs the archive version 5. I found some information in the documentation that is must be possible to read old archives. But I am not able to do it. I always get exceptions. Thank you in advance for help! David
In the documention is described how to use "version" to conditionally invoke code depending upon the BOOST_CLASS_VERSION setting at the time the archive was created? Does this not address your situation? Robert Ramey "David Graf" <david.graf@28msec.com> wrote in message news:500991ee0904080518k4a571d54m6712cf1a83e05219@mail.gmail.com... Hello How is it possible to load serialized objects with a newer boost version than they have been saved with. I have installed boost version 1.36 and I cannot read archives that have been save with boost 1.35. This is not possible because boost 1.35 puts 'serialization::archive 4' into the files but boost 1.36 needs the archive version 5. I found some information in the documentation that is must be possible to read old archives. But I am not able to do it. I always get exceptions. Thank you in advance for help! David ------------------------------------------------------------------------------ _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Hello BOOST_CLASS_VERSION is used for something else. With this makro, a programmer can change her save/load/serialize implementations and react on older versions of her own code. But I have the problem that classes serialized with older BOOST (or Boost Archive) versions cannot be read with newer ones. This version is declared at the beginning of a serialized archive. E.g.: The following beginning of a text archive is serialized with boost 1.37: 22 serialization::archive 5 0 35 ... Serialized with boost 1.35 it looks like this: 22 serialization::archive 4 0 35 ... Otherwise, the archives are in my case completely identical. Somehow, if this version number does not match to the serialized or archive version of the used boost library, boost throws an exception. David On Apr 8, 2009, at 7:09 PM, Robert Ramey wrote:
In the documention is described how to use "version" to conditionally invoke code depending upon the BOOST_CLASS_VERSION setting at the time the archive was created? Does this not address your situation?
Robert Ramey "David Graf" <david.graf@28msec.com> wrote in message news:500991ee0904080518k4a571d54m6712cf1a83e05219@mail.gmail.com ... Hello
How is it possible to load serialized objects with a newer boost version than they have been saved with. I have installed boost version 1.36 and I cannot read archives that have been save with boost 1.35. This is not possible because boost 1.35 puts 'serialization::archive 4' into the files but boost 1.36 needs the archive version 5.
I found some information in the documentation that is must be possible to read old archives. But I am not able to do it. I always get exceptions.
Thank you in advance for help!
David
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
This version is declared at the beginning of a serialized archive. E.g.: The following beginning of a text archive is serialized with boost 1.37: 22 serialization::archive 5 0 35 ... Serialized with boost 1.35 it looks like this: 22 serialization::archive 4 0 35 ... Otherwise, the archives are in my case completely identical. Somehow, if this version number does not match to the serialized or archive version of the used boost library, boost throws an exception. **** where does this exception get thrown? Robert Ramey
Hello Robert I did some more testing. I found out that the loading of older versions doesn't work only for some complex classes I've programmed. For one example, I can send you the call stack when the exception is thrown. David Stack: Catchpoint 1 (exception thrown). Catchpoint 1 (exception caught), throw location unknown, catch location unknown, exception type unknown 0x955fd201 in __cxa_throw () (gdb) where #0 0x955fd201 in __cxa_throw () #1 0x00a00d55 in boost ::archive ::basic_text_iarchive<boost::archive::text_iarchive>::load_override () #2 0x02896e82 in boost ::archive ::detail ::interface_iarchive < boost ::archive::text_iarchive>::operator>><boost::archive::class_name_type> (this=0xbfffb8a0, t=@0xbfffa61c) at interface_iarchive.hpp:61 #3 0x02896eb2 in boost ::archive ::detail::common_iarchive<boost::archive::text_iarchive>::vload (this=0xbfffb8a0, s=@0xbfffa61c) at common_iarchive.hpp:53 #4 0x009f46ea in boost::archive::detail::basic_iarchive_impl::load_pointer () #5 0x009f3e7d in boost::archive::detail::basic_iarchive::load_pointer () #6 0x0278df57 in boost ::archive::detail::load_pointer_type<boost::archive::text_iarchive, zorba::sausastore::XmlNode*>::invoke (ar=@0xbfffb8a0, t=@0xbfffa9d4) at iserializer.hpp:453 #7 0x0278dfb2 in boost::archive::load<boost::archive::text_iarchive, zorba::sausastore::XmlNode*> (ar=@0xbfffb8a0, t=@0xbfffa9d4) at iserializer.hpp:514 #8 0x0278dfd6 in boost ::archive ::detail ::common_iarchive < boost ::archive::text_iarchive>::load_override<zorba::sausastore::XmlNode*> (this=0xbfffb8a0, t=@0xbfffa9d4) at common_iarchive.hpp:59 #9 0x0278dff8 in boost ::archive ::basic_text_iarchive < boost ::archive::text_iarchive>::load_override<zorba::sausastore::XmlNode*> (this=0xbfffb8a0, t=@0xbfffa9d4) at basic_text_iarchive.hpp:62 #10 0x0278e01a in boost ::archive ::text_iarchive_impl < boost ::archive::text_iarchive>::load_override<zorba::sausastore::XmlNode*> (this=0xbfffb8a0, t=@0xbfffa9d4) at text_iarchive.hpp:65 #11 0x0278e046 in boost ::archive ::detail ::interface_iarchive < boost ::archive::text_iarchive>::operator>><zorba::sausastore::XmlNode*> (this=0xbfffb8a0, t=@0xbfffa9d4) at interface_iarchive.hpp:61 #12 0x027c6220 in boost ::serialization ::nvp <zorba::sausastore::XmlNode*>::load<boost::archive::text_iarchive> (this=0xbfffa9d8, ar=@0xbfffb8a0) at nvp.hpp:86 #13 0x027b2433 in boost ::serialization::access::member_load<boost::archive::text_iarchive, boost::serialization::nvp<zorba::sausastore::XmlNode*> > (ar=@0xbfffb8a0, t=@0xbfffa9d8, file_version=0) at access.hpp:101 #14 0x027c6243 in boost ::serialization::detail::member_loader<boost::archive::text_iarchive, boost::serialization::nvp<zorba::sausastore::XmlNode*> >::invoke (ar=@0xbfffb8a0, t=@0xbfffa9d8, file_version=0) at split_member.hpp:54 #15 0x027b2457 in boost::serialization::split_member<boost::archive::text_iarchive, boost::serialization::nvp<zorba::sausastore::XmlNode*> > (ar=@0xbfffb8a0, t=@0xbfffa9d8, file_version=0) at split_member.hpp:69 #16 0x027c6267 in boost ::serialization ::nvp < zorba::sausastore::XmlNode*>::serialize<boost::archive::text_iarchive> (this=0xbfffa9d8, ar=@0xbfffb8a0, file_version=0) at nvp.hpp:88 #17 0x027b247b in boost::serialization::access::serialize<boost::archive::text_iarchive, boost::serialization::nvp<zorba::sausastore::XmlNode*> > (ar=@0xbfffb8a0, t=@0xbfffa9d8, file_version=0) at access.hpp:109 #18 0x027c628b in boost::serialization::serialize<boost::archive::text_iarchive, boost::serialization::nvp<zorba::sausastore::XmlNode*> > (ar=@0xbfffb8a0, t=@0xbfffa9d8, file_version=0) at serialization.hpp:74 #19 0x027b24bb in boost::serialization::serialize_adl<boost::archive::text_iarchive, boost::serialization::nvp<zorba::sausastore::XmlNode*> > (ar=@0xbfffb8a0, t=@0xbfffa9d8, file_version=0) at serialization.hpp:133 #20 0x027c62b0 in boost ::archive ::detail::load_non_pointer_type<boost::archive::text_iarchive, boost::serialization::nvp<zorba::sausastore::XmlNode*>
::load_only::invoke (ar=@0xbfffb8a0, t=@0xbfffa9d8) at iserializer.hpp:316 #21 0x027b24d8 in boost ::archive ::detail::load_non_pointer_type<boost::archive::text_iarchive, boost::serialization::nvp<zorba::sausastore::XmlNode*> >::invoke (ar=@0xbfffb8a0, t=@0xbfffa9d8) at iserializer.hpp:391 #22 0x027c62cc in boost::archive::load<boost::archive::text_iarchive, boost::serialization::nvp<zorba::sausastore::XmlNode*> > (ar=@0xbfffb8a0, t=@0xbfffa9d8) at iserializer.hpp:514 #23 0x027b24f4 in boost::archive::load_wrapper<boost::archive::text_iarchive, boost::serialization::nvp<zorba::sausastore::XmlNode*> > (ar=@0xbfffb8a0, t=@0xbfffa9d8) at iserializer.hpp:536 #24 0x027c62f0 in boost::archive::load<boost::archive::text_iarchive, boost::serialization::nvp<zorba::sausastore::XmlNode*> > (ar=@0xbfffb8a0, t=@0xbfffa9d8) at iserializer.hpp:542 #25 0x027b251a in boost ::archive ::detail ::common_iarchive < boost ::archive ::text_iarchive
::load_override<boost::serialization::nvp<zorba::sausastore::XmlNode*> const> (this=0xbfffb8a0, t=@0xbfffa9d8) at common_iarchive.hpp:59 #26 0x027b253c in boost ::archive ::basic_text_iarchive < boost ::archive ::text_iarchive
::load_override<boost::serialization::nvp<zorba::sausastore::XmlNode*> const> (this=0xbfffb8a0, t=@0xbfffa9d8) at basic_text_iarchive.hpp:62 #27 0x027c6314 in boost ::archive ::text_iarchive_impl < boost ::archive ::text_iarchive
::load_override<boost::serialization::nvp<zorba::sausastore::XmlNode*> const> (this=0xbfffb8a0, t=@0xbfffa9d8) at text_iarchive.hpp:65 #28 0x027b256a in boost ::archive ::detail ::interface_iarchive < boost ::archive ::text_iarchive
::operator>><boost::serialization::nvp<zorba::sausastore::XmlNode*> const> (this=0xbfffb8a0, t=@0xbfffa9d8) at interface_iarchive.hpp:61 #29 0x027b25d8 in boost ::serialization::stl::archive_input_seq<boost::archive::text_iarchive, std::vector<zorba::sausastore::XmlNode*, std::allocator<zorba::sausastore::XmlNode*> > >::operator() (this=0xbfffaa02, ar=@0xbfffb8a0, s=@0x504b73c, v=12) at
collections_load_imp.hpp:61 #30 0x027c65f0 in boost ::serialization::stl::load_collection<boost::archive::text_iarchive, std::vector<zorba::sausastore::XmlNode*, std::allocator<zorba::sausastore::XmlNode*> >, boost ::serialization::stl::archive_input_seq<boost::archive::text_iarchive, std::vector<zorba::sausastore::XmlNode*, std::allocator<zorba::sausastore::XmlNode*> > >, boost ::serialization ::stl::reserve_imp<std::vector<zorba::sausastore::XmlNode*, std::allocator<zorba::sausastore::XmlNode*> > > > (ar=@0xbfffb8a0, s=@0x504b73c) at collections_load_imp.hpp:191 #31 0x027b2780 in boost::serialization::load<boost::archive::text_iarchive, zorba::sausastore::XmlNode*, std::allocator<zorba::sausastore::XmlNode*> > (ar=@0xbfffb8a0, t=@0x504b73c) at vector.hpp:65 #32 0x027c662f in boost::serialization::load<boost::archive::text_iarchive, zorba::sausastore::XmlNode*, std::allocator<zorba::sausastore::XmlNode*> > (ar=@0xbfffb8a0, t=@0x504b73c, file_version=0) at vector.hpp:128 #33 0x027b27bf in boost::serialization::free_loader<boost::archive::text_iarchive, std::vector<zorba::sausastore::XmlNode*, std::allocator<zorba::sausastore::XmlNode*> > >::invoke (ar=@0xbfffb8a0, t=@0x504b73c, file_version=0) at split_free.hpp:58 #34 0x027c6653 in boost::serialization::split_free<boost::archive::text_iarchive, std::vector<zorba::sausastore::XmlNode*, std::allocator<zorba::sausastore::XmlNode*> > > (ar=@0xbfffb8a0, t=@0x504b73c, file_version=0) at split_free.hpp:74 #35 0x027b27e3 in boost::serialization::serialize<boost::archive::text_iarchive, zorba::sausastore::XmlNode*, std::allocator<zorba::sausastore::XmlNode*> > (ar=@0xbfffb8a0, t=@0x504b73c, file_version=0) at vector.hpp:139 #36 0x027c6693 in boost::serialization::serialize_adl<boost::archive::text_iarchive, std::vector<zorba::sausastore::XmlNode*, std::allocator<zorba::sausastore::XmlNode*> > > (ar=@0xbfffb8a0, t=@0x504b73c, file_version=0) at serialization.hpp:133 #37 0x027b2812 in boost::archive::detail::iserializer<boost::archive::text_iarchive, std::vector<zorba::sausastore::XmlNode*, std::allocator<zorba::sausastore::XmlNode*> > >::load_object_data (this=0x2d4f478, ar=@0xbfffb8a0, x=0x504b73c, file_version=0) at iserializer.hpp:152 #38 0x009f3d93 in boost::archive::detail::basic_iarchive::load_object () #39 0x027ac6ab in boost ::archive ::detail::load_non_pointer_type<boost::archive::text_iarchive, std::vector<zorba::sausastore::XmlNode*, std::allocator<zorba::sausastore::XmlNode*> > >::load_standard::invoke (ar=@0xbfffb8a0, t=@0x504b73c) at iserializer.hpp:331 #40 0x027ac6c6 in boost ::archive ::detail::load_non_pointer_type<boost::archive::text_iarchive, std::vector<zorba::sausastore::XmlNode*, std::allocator<zorba::sausastore::XmlNode*> > >::invoke (ar=@0xbfffb8a0, t=@0x504b73c) at iserializer.hpp:391 #41 0x027ac6e0 in boost::archive::load<boost::archive::text_iarchive, std::vector<zorba::sausastore::XmlNode*, std::allocator<zorba::sausastore::XmlNode*> > > (ar=@0xbfffb8a0, t=@0x504b73c) at iserializer.hpp:514 #42 0x027ac704 in boost ::archive ::detail ::common_iarchive < boost ::archive ::text_iarchive >::load_override<std::vector<zorba::sausastore::XmlNode*, std::allocator<zorba::sausastore::XmlNode*> > > (this=0xbfffb8a0, t=@0x504b73c) at common_iarchive.hpp:59 #43 0x027ac726 in boost ::archive ::basic_text_iarchive < boost ::archive ::text_iarchive >::load_override<std::vector<zorba::sausastore::XmlNode*, std::allocator<zorba::sausastore::XmlNode*> > > (this=0xbfffb8a0, t=@0x504b73c) at basic_text_iarchive.hpp:62 #44 0x027ac748 in boost ::archive ::text_iarchive_impl < boost ::archive ::text_iarchive >::load_override<std::vector<zorba::sausastore::XmlNode*, std::allocator<zorba::sausastore::XmlNode*> > > (this=0xbfffb8a0, t=@0x504b73c) at text_iarchive.hpp:65 #45 0x027ac774 in boost ::archive ::detail ::interface_iarchive < boost ::archive ::text_iarchive>::operator>><std::vector<zorba::sausastore::XmlNode*, std::allocator<zorba::sausastore::XmlNode*> > > (this=0xbfffb8a0, t=@0x504b73c) at interface_iarchive.hpp:61 #46 0x027ac7a4 in boost ::archive ::detail ::interface_iarchive < boost ::archive ::text_iarchive>::operator&<std::vector<zorba::sausastore::XmlNode*, std::allocator<zorba::sausastore::XmlNode*> > > (this=0xbfffb8a0, t=@0x504b73c) at interface_iarchive.hpp:68 #47 0x027ac7c1 in zorba ::sausastore::NodeVector::serialize<boost::archive::text_iarchive> (this=0x504b738, ar=@0xbfffb8a0, version=0) at node_vector.h:80 #48 0x027ac7e3 in boost::serialization::access::serialize<boost::archive::text_iarchive, zorba::sausastore::NodeVector> (ar=@0xbfffb8a0, t=@0x504b738, file_version=0) at access.hpp:109 #49 0x027ac805 in boost::serialization::serialize<boost::archive::text_iarchive, zorba::sausastore::NodeVector> (ar=@0xbfffb8a0, t=@0x504b738, file_version=0) at serialization.hpp:74 #50 0x027ac843 in boost::serialization::serialize_adl<boost::archive::text_iarchive, zorba::sausastore::NodeVector> (ar=@0xbfffb8a0, t=@0x504b738, file_version=0) at serialization.hpp:133 #51 0x027ac870 in boost::archive::detail::iserializer<boost::archive::text_iarchive, zorba::sausastore::NodeVector>::load_object_data (this=0x2d4f5e8, ar=@0xbfffb8a0, x=0x504b738, file_version=0) at iserializer.hpp:152 #52 0x009f3d93 in boost::archive::detail::basic_iarchive::load_object () #53 0x027a50fb in boost ::archive ::detail::load_non_pointer_type<boost::archive::text_iarchive, zorba::sausastore::NodeVector>::load_standard::invoke (ar=@0xbfffb8a0, t=@0x504b738) at iserializer.hpp:331 #54 0x027a5116 in boost ::archive ::detail::load_non_pointer_type<boost::archive::text_iarchive, zorba::sausastore::NodeVector>::invoke (ar=@0xbfffb8a0, t=@0x504b738) at iserializer.hpp:391 #55 0x027a5130 in boost::archive::load<boost::archive::text_iarchive, zorba::sausastore::NodeVector> (ar=@0xbfffb8a0, t=@0x504b738) at iserializer.hpp:514 #56 0x027a5154 in boost ::archive ::detail ::common_iarchive < boost ::archive ::text_iarchive>::load_override<zorba::sausastore::NodeVector> (this=0xbfffb8a0, t=@0x504b738) at common_iarchive.hpp:59 #57 0x027a5176 in boost ::archive ::basic_text_iarchive < boost ::archive ::text_iarchive>::load_override<zorba::sausastore::NodeVector> (this=0xbfffb8a0, t=@0x504b738) at basic_text_iarchive.hpp:62 #58 0x027a5198 in boost ::archive ::text_iarchive_impl < boost ::archive ::text_iarchive>::load_override<zorba::sausastore::NodeVector> (this=0xbfffb8a0, t=@0x504b738) at text_iarchive.hpp:65 #59 0x027a51c4 in boost ::archive ::detail ::interface_iarchive < boost ::archive::text_iarchive>::operator>><zorba::sausastore::NodeVector> (this=0xbfffb8a0, t=@0x504b738) at interface_iarchive.hpp:61 #60 0x027a51f4 in boost ::archive ::detail ::interface_iarchive < boost ::archive::text_iarchive>::operator&<zorba::sausastore::NodeVector> (this=0xbfffb8a0, t=@0x504b738) at interface_iarchive.hpp:68 #61 0x027a5216 in zorba ::sausastore ::LoadedNodeVector::serialize<boost::archive::text_iarchive> (this=0x504b738, ar=@0xbfffb8a0, version=0) at node_vector.h:119 #62 0x027a5237 in boost::serialization::access::serialize<boost::archive::text_iarchive, zorba::sausastore::LoadedNodeVector> (ar=@0xbfffb8a0, t=@0x504b738, file_version=0) at access.hpp:109 #63 0x027a5259 in boost::serialization::serialize<boost::archive::text_iarchive, zorba::sausastore::LoadedNodeVector> (ar=@0xbfffb8a0, t=@0x504b738, file_version=0) at serialization.hpp:74 #64 0x027a5297 in boost::serialization::serialize_adl<boost::archive::text_iarchive, zorba::sausastore::LoadedNodeVector> (ar=@0xbfffb8a0, t=@0x504b738, file_version=0) at serialization.hpp:133 #65 0x027a52c4 in boost::archive::detail::iserializer<boost::archive::text_iarchive, zorba::sausastore::LoadedNodeVector>::load_object_data (this=0x2d4f2e4, ar=@0xbfffb8a0, x=0x504b738, file_version=0) at iserializer.hpp:152 #66 0x009f3d93 in boost::archive::detail::basic_iarchive::load_object () #67 0x0279217b in boost ::archive ::detail::load_non_pointer_type<boost::archive::text_iarchive, zorba::sausastore::LoadedNodeVector>::load_standard::invoke (ar=@0xbfffb8a0, t=@0x504b738) at iserializer.hpp:331 #68 0x027c4bec in boost ::archive ::detail::load_non_pointer_type<boost::archive::text_iarchive, zorba::sausastore::LoadedNodeVector>::invoke (ar=@0xbfffb8a0, t=@0x504b738) at iserializer.hpp:391 #69 0x02792198 in boost::archive::load<boost::archive::text_iarchive, zorba::sausastore::LoadedNodeVector> (ar=@0xbfffb8a0, t=@0x504b738) at iserializer.hpp:514 #70 0x027c4c12 in boost ::archive ::detail ::common_iarchive < boost ::archive ::text_iarchive>::load_override<zorba::sausastore::LoadedNodeVector> (this=0xbfffb8a0, t=@0x504b738) at common_iarchive.hpp:59 #71 0x027c4c34 in boost ::archive ::basic_text_iarchive < boost ::archive ::text_iarchive>::load_override<zorba::sausastore::LoadedNodeVector> (this=0xbfffb8a0, t=@0x504b738) at basic_text_iarchive.hpp:62 #72 0x027921bc in boost ::archive ::text_iarchive_impl < boost ::archive ::text_iarchive>::load_override<zorba::sausastore::LoadedNodeVector> (this=0xbfffb8a0, t=@0x504b738) at text_iarchive.hpp:65 #73 0x027c4c62 in boost ::archive ::detail ::interface_iarchive < boost ::archive ::text_iarchive>::operator>><zorba::sausastore::LoadedNodeVector> (this=0xbfffb8a0, t=@0x504b738) at interface_iarchive.hpp:61 #74 0x027921e0 in boost ::archive ::detail ::interface_iarchive < boost ::archive ::text_iarchive>::operator&<zorba::sausastore::LoadedNodeVector> (this=0xbfffb8a0, t=@0x504b738) at interface_iarchive.hpp:68 #75 0x02792301 in zorba ::sausastore ::ElementTreeNode::serialize<boost::archive::text_iarchive> (this=0x504b710, ar=@0xbfffb8a0, version=0) at /Users/dagraf/work/ 28msec/software/runtime0.9.2/store/src/node_items.cpp:3087 #76 0x02792337 in boost::serialization::access::serialize<boost::archive::text_iarchive, zorba::sausastore::ElementTreeNode> (ar=@0xbfffb8a0, t=@0x504b710, file_version=0) at access.hpp:109 #77 0x02792359 in boost::serialization::serialize<boost::archive::text_iarchive, zorba::sausastore::ElementTreeNode> (ar=@0xbfffb8a0, t=@0x504b710, file_version=0) at serialization.hpp:74 #78 0x02792397 in boost::serialization::serialize_adl<boost::archive::text_iarchive, zorba::sausastore::ElementTreeNode> (ar=@0xbfffb8a0, t=@0x504b710, file_version=0) at serialization.hpp:133 #79 0x027923c4 in boost::archive::detail::iserializer<boost::archive::text_iarchive, zorba::sausastore::ElementTreeNode>::load_object_data (this=0x2d4eef0, ar=@0xbfffb8a0, x=0x504b710, file_version=0) at iserializer.hpp:152 #80 0x009f3e18 in boost::archive::detail::basic_iarchive::load_object () #81 0x0279f745 in boost ::archive ::detail::load_non_pointer_type<boost::archive::text_iarchive, zorba::sausastore::ElementTreeNode>::load_standard::invoke (ar=@0xbfffb8a0, t=@0x504b710) at iserializer.hpp:331 #82 0x0279f760 in boost ::archive ::detail::load_non_pointer_type<boost::archive::text_iarchive, zorba::sausastore::ElementTreeNode>::invoke (ar=@0xbfffb8a0, t=@0x504b710) at iserializer.hpp:391 #83 0x0279f77a in boost::archive::load<boost::archive::text_iarchive, zorba::sausastore::ElementTreeNode> (ar=@0xbfffb8a0, t=@0x504b710) at iserializer.hpp:514 #84 0x0279f79e in boost ::archive ::detail ::common_iarchive < boost ::archive ::text_iarchive>::load_override<zorba::sausastore::ElementTreeNode> (this=0xbfffb8a0, t=@0x504b710) at common_iarchive.hpp:59 #85 0x0279f7c0 in boost ::archive ::basic_text_iarchive < boost ::archive ::text_iarchive>::load_override<zorba::sausastore::ElementTreeNode> (this=0xbfffb8a0, t=@0x504b710) at basic_text_iarchive.hpp:62 #86 0x0279f7e2 in boost ::archive ::text_iarchive_impl < boost ::archive ::text_iarchive>::load_override<zorba::sausastore::ElementTreeNode> (this=0xbfffb8a0, t=@0x504b710) at text_iarchive.hpp:65 #87 0x0279f80e in boost ::archive ::detail ::interface_iarchive < boost ::archive ::text_iarchive>::operator>><zorba::sausastore::ElementTreeNode> (this=0xbfffb8a0, t=@0x504b710) at interface_iarchive.hpp:61 #88 0x0279f83c in boost ::serialization ::nvp < zorba ::sausastore::ElementTreeNode>::load<boost::archive::text_iarchive> (this=0xbfffb600, ar=@0xbfffb8a0) at nvp.hpp:86 #89 0x0279f85d in boost ::serialization::access::member_load<boost::archive::text_iarchive, boost::serialization::nvp<zorba::sausastore::ElementTreeNode> > (ar=@0xbfffb8a0, t=@0xbfffb600, file_version=0) at access.hpp:101 #90 0x0279f87f in boost ::serialization::detail::member_loader<boost::archive::text_iarchive, boost::serialization::nvp<zorba::sausastore::ElementTreeNode> >::invoke (ar=@0xbfffb8a0, t=@0xbfffb600, file_version=0) at split_member.hpp:54 #91 0x0279f8a1 in boost::serialization::split_member<boost::archive::text_iarchive, boost::serialization::nvp<zorba::sausastore::ElementTreeNode> > (ar=@0xbfffb8a0, t=@0xbfffb600, file_version=0) at split_member.hpp:69 #92 0x0279f8c3 in boost ::serialization ::nvp < zorba ::sausastore ::ElementTreeNode>::serialize<boost::archive::text_iarchive> (this=0xbfffb600, ar=@0xbfffb8a0, file_version=0) at nvp.hpp:88 #93 0x0279f8e5 in boost::serialization::access::serialize<boost::archive::text_iarchive, boost::serialization::nvp<zorba::sausastore::ElementTreeNode> > (ar=@0xbfffb8a0, t=@0xbfffb600, file_version=0) at access.hpp:109 #94 0x0279f907 in boost::serialization::serialize<boost::archive::text_iarchive, boost::serialization::nvp<zorba::sausastore::ElementTreeNode> > (ar=@0xbfffb8a0, t=@0xbfffb600, file_version=0) at serialization.hpp:74 #95 0x0279f945 in boost::serialization::serialize_adl<boost::archive::text_iarchive, boost::serialization::nvp<zorba::sausastore::ElementTreeNode> > (ar=@0xbfffb8a0, t=@0xbfffb600, file_version=0) at serialization.hpp:133 #96 0x0279f968 in boost ::archive ::detail::load_non_pointer_type<boost::archive::text_iarchive, boost::serialization::nvp<zorba::sausastore::ElementTreeNode> >::load_only::invoke (ar=@0xbfffb8a0, t=@0xbfffb600) at iserializer.hpp:316 #97 0x0279f982 in boost ::archive ::detail::load_non_pointer_type<boost::archive::text_iarchive, boost::serialization::nvp<zorba::sausastore::ElementTreeNode> >::invoke (ar=@0xbfffb8a0, t=@0xbfffb600) at iserializer.hpp:391 #98 0x0279f99c in boost::archive::load<boost::archive::text_iarchive, boost::serialization::nvp<zorba::sausastore::ElementTreeNode> > (ar=@0xbfffb8a0, t=@0xbfffb600) at iserializer.hpp:514 #99 0x0279f9b6 in boost::archive::load_wrapper<boost::archive::text_iarchive, boost::serialization::nvp<zorba::sausastore::ElementTreeNode> > (ar=@0xbfffb8a0, t=@0xbfffb600) at iserializer.hpp:536 #100 0x0279f9d8 in boost::archive::load<boost::archive::text_iarchive, boost::serialization::nvp<zorba::sausastore::ElementTreeNode> > (ar=@0xbfffb8a0, t=@0xbfffb600) at iserializer.hpp:542 #101 0x0279f9fc in boost ::archive ::detail ::common_iarchive < boost ::archive ::text_iarchive > ::load_override <boost::serialization::nvp<zorba::sausastore::ElementTreeNode> const> (this=0xbfffb8a0, t=@0xbfffb600) at common_iarchive.hpp:59 #102 0x0279fa1e in boost ::archive ::basic_text_iarchive < boost ::archive ::text_iarchive > ::load_override <boost::serialization::nvp<zorba::sausastore::ElementTreeNode> const> (this=0xbfffb8a0, t=@0xbfffb600) at basic_text_iarchive.hpp:62 #103 0x0279fa40 in boost ::archive ::text_iarchive_impl < boost ::archive ::text_iarchive > ::load_override <boost::serialization::nvp<zorba::sausastore::ElementTreeNode> const> (this=0xbfffb8a0, t=@0xbfffb600) at text_iarchive.hpp:65 #104 0x0279fa6c in boost ::archive ::detail ::interface_iarchive < boost ::archive ::text_iarchive > ::operator >><boost::serialization::nvp<zorba::sausastore::ElementTreeNode> const> (this=0xbfffb8a0, t=@0xbfffb600) at interface_iarchive.hpp:61 #105 0x0279fb63 in boost ::archive::detail::pointer_iserializer<boost::archive::text_iarchive, zorba::sausastore::ElementTreeNode>::load_object_ptr (this=0x2d4eefc, ar=@0xbfffb8a0, x=@0x505d070, file_version=0) at iserializer.hpp:284 #106 0x009f4962 in boost::archive::detail::basic_iarchive_impl::load_pointer () #107 0x009f3e7d in boost::archive::detail::basic_iarchive::load_pointer () #108 0x0278df57 in boost ::archive::detail::load_pointer_type<boost::archive::text_iarchive, zorba::sausastore::XmlNode*>::invoke (ar=@0xbfffb8a0, t=@0xbfffbcbc) at iserializer.hpp:453 #109 0x0278dfb2 in boost::archive::load<boost::archive::text_iarchive, zorba::sausastore::XmlNode*> (ar=@0xbfffb8a0, t=@0xbfffbcbc) at iserializer.hpp:514 #110 0x0278dfd6 in boost ::archive ::detail ::common_iarchive < boost ::archive::text_iarchive>::load_override<zorba::sausastore::XmlNode*> (this=0xbfffb8a0, t=@0xbfffbcbc) at common_iarchive.hpp:59 #111 0x0278dff8 in boost ::archive ::basic_text_iarchive < boost ::archive::text_iarchive>::load_override<zorba::sausastore::XmlNode*> (this=0xbfffb8a0, t=@0xbfffbcbc) at basic_text_iarchive.hpp:62 #112 0x0278e01a in boost ::archive ::text_iarchive_impl < boost ::archive::text_iarchive>::load_override<zorba::sausastore::XmlNode*> (this=0xbfffb8a0, t=@0xbfffbcbc) at text_iarchive.hpp:65 #113 0x0278e046 in boost ::archive ::detail ::interface_iarchive < boost ::archive::text_iarchive>::operator>><zorba::sausastore::XmlNode*> (this=0xbfffb8a0, t=@0xbfffbcbc) at interface_iarchive.hpp:61 #114 0x0278e076 in boost ::archive ::detail ::interface_iarchive < boost::archive::text_iarchive>::operator&<zorba::sausastore::XmlNode*> (this=0xbfffb8a0, t=@0xbfffbcbc) at interface_iarchive.hpp:68
On Apr 9, 2009, at 6:38 PM, Robert Ramey wrote:
This version is declared at the beginning of a serialized archive. E.g.:
The following beginning of a text archive is serialized with boost 1.37: 22 serialization::archive 5 0 35 ...
Serialized with boost 1.35 it looks like this: 22 serialization::archive 4 0 35 ...
Otherwise, the archives are in my case completely identical.
Somehow, if this version number does not match to the serialized or archive version of the used boost library, boost throws an exception.
**** where does this exception get thrown?
Robert Ramey
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Hello Robert Attached, please find two text archive outputs. The first is generated using boost version 1.35. The second is generated using boost version 1.37. Additionally, I attached the diff between these archives. In this diff, you can safely ignore the second and the last difference. Those are due to random generated data. We assume that the exception (see attached stacktrace.txt) is caused by the third difference. Do you have any idea why this exception is thrown? David On Apr 9, 2009, at 6:38 PM, Robert Ramey wrote:
This version is declared at the beginning of a serialized archive. E.g.:
The following beginning of a text archive is serialized with boost 1.37: 22 serialization::archive 5 0 35 ...
Serialized with boost 1.35 it looks like this: 22 serialization::archive 4 0 35 ...
Otherwise, the archives are in my case completely identical.
Somehow, if this version number does not match to the serialized or archive version of the used boost library, boost throws an exception.
**** where does this exception get thrown?
Robert Ramey
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
This looks useful. May we presume that you're trying to read this with boost 1.37 and the exception is thrown? Note that the the 1.35 version has archive library version #4 while 1.37 has archive library version #5 in the top row. The archive library version is changed every time we make a change which might mean that older archive have to be handled differently. A example where this has happened is where we change the type of the integer which indicates how may items there are in a collection. In this case, 1.37 (library version # 5) is expecting data which 1.35 (library version #4) didn't put there. That is, 1.37 is missing some code which looks like: if(library_version >4) ar >> i ... Of course the rub is to figure out where that is. The key line differs in that: 1.35 1 12 ... 1.37 1 0 12 ... // extr 0 With your test case I would do the following: Generate the same two files with the xml_archive. This should reveal what the extra "0" corresponds to. With the debugger, trap the program where the exception is thrown. This might reveal the part of code which is throwing this extra "0". This is where the mistake might lie. Robert Ramey David Graf wrote:
Hello Robert
Attached, please find two text archive outputs. The first is generated using boost version 1.35. The second is generated using boost version 1.37. Additionally, I attached the diff between these archives.
In this diff, you can safely ignore the second and the last difference. Those are due to random generated data. We assume that the exception (see attached stacktrace.txt) is caused by the third difference.
Do you have any idea why this exception is thrown?
David
On Apr 9, 2009, at 6:38 PM, Robert Ramey wrote:
This version is declared at the beginning of a serialized archive. E.g.:
The following beginning of a text archive is serialized with boost 1.37: 22 serialization::archive 5 0 35 ...
Serialized with boost 1.35 it looks like this: 22 serialization::archive 4 0 35 ...
Otherwise, the archives are in my case completely identical.
Somehow, if this version number does not match to the serialized or archive version of the used boost library, boost throws an exception.
**** where does this exception get thrown?
Robert Ramey
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Hello Robert After adding nvp wrappers around all serialize commands, I am able to produce the xml archives (attached inclusive diff). The archive produced using boost 1.37 contains the additional element '<item_version>0</item_version>. This additional element seems to be inserted by the std::vector serialization code. I compared the load function in vector.hpp from version 1.35 and 1.37 (see code below). The version 1.37 tries to load the variable item_version that is not saved by version 1.35. Is the condition around the additional code (BOOST_SERIALIZATION_VECTOR_VERSION < ar.get_library_version()) executed wrongly? David version 1.35: template<class Archive, class U, class Allocator> inline void load( Archive & ar, std::vector<U, Allocator> &t, const unsigned int /* file_version */, mpl::true_ ){ collection_size_type count(t.size()); ar >> BOOST_SERIALIZATION_NVP(count); t.resize(count); if (!t.empty()) ar >> make_array(detail::get_data(t),t.size()); } version 1.37: template<class Archive, class U, class Allocator> inline void load( Archive & ar, std::vector<U, Allocator> &t, const unsigned int /* file_version */, mpl::true_ ){ collection_size_type count(t.size()); ar >> BOOST_SERIALIZATION_NVP(count); t.resize(count); unsigned int item_version=0; if(BOOST_SERIALIZATION_VECTOR_VERSION < ar.get_library_version()) ar >> BOOST_SERIALIZATION_NVP(item_version); if (!t.empty()) ar >> make_array(detail::get_data(t),t.size()); } On May 18, 2009, at 6:52 PM, Robert Ramey wrote:
This looks useful.
May we presume that you're trying to read this with boost 1.37 and the exception is thrown?
Note that the the 1.35 version has archive library version #4 while 1.37 has archive library version #5 in the top row. The archive library version is changed every time we make a change which might mean that older archive have to be handled differently. A example where this has happened is where we change the type of the integer which indicates how may items there are in a collection.
In this case, 1.37 (library version # 5) is expecting data which 1.35 (library version #4) didn't put there. That is, 1.37 is missing some code which looks like:
if(library_version >4) ar >> i ...
Of course the rub is to figure out where that is. The key line differs in that:
1.35 1 12 ... 1.37 1 0 12 ... // extr 0 With your test case I would do the following:
Generate the same two files with the xml_archive. This should reveal what the extra "0" corresponds to. With the debugger, trap the program where the exception is thrown. This might reveal the part of code which is throwing this extra "0". This is where the mistake might lie.
Robert Ramey
David Graf wrote:
Hello Robert
Attached, please find two text archive outputs. The first is generated using boost version 1.35. The second is generated using boost version 1.37. Additionally, I attached the diff between these archives.
In this diff, you can safely ignore the second and the last difference. Those are due to random generated data. We assume that the exception (see attached stacktrace.txt) is caused by the third difference.
Do you have any idea why this exception is thrown?
David
On Apr 9, 2009, at 6:38 PM, Robert Ramey wrote:
This version is declared at the beginning of a serialized archive. E.g.:
The following beginning of a text archive is serialized with boost 1.37: 22 serialization::archive 5 0 35 ...
Serialized with boost 1.35 it looks like this: 22 serialization::archive 4 0 35 ...
Otherwise, the archives are in my case completely identical.
Somehow, if this version number does not match to the serialized or archive version of the used boost library, boost throws an exception.
**** where does this exception get thrown?
Robert Ramey
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
I think the problem will be resolved by defining BOOST_SERIALIZATION_VECTOR_VERSION 4 rather than 3 as it is above. Unless someone tells me I'm missing something, I'm checking in this change to the trunk. Robert Ramey "David Graf" <david.graf@28msec.com> wrote in message news:D84C651B-510D-4D80-8224-5C09542F74DE@28msec.com... Hello Robert After adding nvp wrappers around all serialize commands, I am able to produce the xml archives (attached inclusive diff). The archive produced using boost 1.37 contains the additional element '<item_version>0</item_version>. This additional element seems to be inserted by the std::vector serialization code. I compared the load function in vector.hpp from version 1.35 and 1.37 (see code below). The version 1.37 tries to load the variable item_version that is not saved by version 1.35. Is the condition around the additional code (BOOST_SERIALIZATION_VECTOR_VERSION < ar.get_library_version()) executed wrongly? David version 1.35: template<class Archive, class U, class Allocator> inline void load( Archive & ar, std::vector<U, Allocator> &t, const unsigned int /* file_version */, mpl::true_ ){ collection_size_type count(t.size()); ar >> BOOST_SERIALIZATION_NVP(count); t.resize(count); if (!t.empty()) ar >> make_array(detail::get_data(t),t.size()); } version 1.37: template<class Archive, class U, class Allocator> inline void load( Archive & ar, std::vector<U, Allocator> &t, const unsigned int /* file_version */, mpl::true_ ){ collection_size_type count(t.size()); ar >> BOOST_SERIALIZATION_NVP(count); t.resize(count); unsigned int item_version=0; if(BOOST_SERIALIZATION_VECTOR_VERSION < ar.get_library_version()) ar >> BOOST_SERIALIZATION_NVP(item_version); if (!t.empty()) ar >> make_array(detail::get_data(t),t.size()); } ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ On May 18, 2009, at 6:52 PM, Robert Ramey wrote: This looks useful. May we presume that you're trying to read this with boost 1.37 and the exception is thrown? Note that the the 1.35 version has archive library version #4 while 1.37 has archive library version #5 in the top row. The archive library version is changed every time we make a change which might mean that older archive have to be handled differently. A example where this has happened is where we change the type of the integer which indicates how may items there are in a collection. In this case, 1.37 (library version # 5) is expecting data which 1.35 (library version #4) didn't put there. That is, 1.37 is missing some code which looks like: if(library_version >4) ar >> i ... Of course the rub is to figure out where that is. The key line differs in that: 1.35 1 12 ... 1.37 1 0 12 ... // extr 0 With your test case I would do the following: Generate the same two files with the xml_archive. This should reveal what the extra "0" corresponds to. With the debugger, trap the program where the exception is thrown. This might reveal the part of code which is throwing this extra "0". This is where the mistake might lie. Robert Ramey David Graf wrote: Hello Robert Attached, please find two text archive outputs. The first is generated using boost version 1.35. The second is generated using boost version 1.37. Additionally, I attached the diff between these archives. In this diff, you can safely ignore the second and the last difference. Those are due to random generated data. We assume that the exception (see attached stacktrace.txt) is caused by the third difference. Do you have any idea why this exception is thrown? David On Apr 9, 2009, at 6:38 PM, Robert Ramey wrote: This version is declared at the beginning of a serialized archive. E.g.: The following beginning of a text archive is serialized with boost 1.37: 22 serialization::archive 5 0 35 ... Serialized with boost 1.35 it looks like this: 22 serialization::archive 4 0 35 ... Otherwise, the archives are in my case completely identical. Somehow, if this version number does not match to the serialized or archive version of the used boost library, boost throws an exception. **** where does this exception get thrown? Robert Ramey _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users ------------------------------------------------------------------------------ Hello Robert After adding nvp wrappers around all serialize commands, I am able to produce the xml archives (attached inclusive diff). The archive produced using boost 1.37 contains the additional element '<item_version>0</item_version>. This additional element seems to be inserted by the std::vector serialization code. I compared the load function in vector.hpp from version 1.35 and 1.37 (see code below). The version 1.37 tries to load the variable item_version that is not saved by version 1.35. Is the condition around the additional code (BOOST_SERIALIZATION_VECTOR_VERSION < ar.get_library_version()) executed wrongly? David version 1.35: template<class Archive, class U, class Allocator> inline void load( Archive & ar, std::vector<U, Allocator> &t, const unsigned int /* file_version */, mpl::true_ ){ collection_size_type count(t.size()); ar >> BOOST_SERIALIZATION_NVP(count); t.resize(count); if (!t.empty()) ar >> make_array(detail::get_data(t),t.size()); } version 1.37: template<class Archive, class U, class Allocator> inline void load( Archive & ar, std::vector<U, Allocator> &t, const unsigned int /* file_version */, mpl::true_ ){ collection_size_type count(t.size()); ar >> BOOST_SERIALIZATION_NVP(count); t.resize(count); unsigned int item_version=0; if(BOOST_SERIALIZATION_VECTOR_VERSION < ar.get_library_version()) ar >> BOOST_SERIALIZATION_NVP(item_version); if (!t.empty()) ar >> make_array(detail::get_data(t),t.size()); } On May 18, 2009, at 6:52 PM, Robert Ramey wrote:
This looks useful.
May we presume that you're trying to read this with boost 1.37 and the exception is thrown?
Note that the the 1.35 version has archive library version #4 while 1.37 has archive library version #5 in the top row. The archive library version is changed every time we make a change which might mean that older archive have to be handled differently. A example where this has happened is where we change the type of the integer which indicates how may items there are in a collection.
In this case, 1.37 (library version # 5) is expecting data which 1.35 (library version #4) didn't put there. That is, 1.37 is missing some code which looks like:
if(library_version >4) ar >> i ...
Of course the rub is to figure out where that is. The key line differs in that:
1.35 1 12 ... 1.37 1 0 12 ... // extr 0 With your test case I would do the following:
Generate the same two files with the xml_archive. This should reveal what the extra "0" corresponds to. With the debugger, trap the program where the exception is thrown. This might reveal the part of code which is throwing this extra "0". This is where the mistake might lie.
Robert Ramey
David Graf wrote:
Hello Robert
Attached, please find two text archive outputs. The first is generated using boost version 1.35. The second is generated using boost version 1.37. Additionally, I attached the diff between these archives.
In this diff, you can safely ignore the second and the last difference. Those are due to random generated data. We assume that the exception (see attached stacktrace.txt) is caused by the third difference.
Do you have any idea why this exception is thrown?
David
On Apr 9, 2009, at 6:38 PM, Robert Ramey wrote:
This version is declared at the beginning of a serialized archive. E.g.:
The following beginning of a text archive is serialized with boost 1.37: 22 serialization::archive 5 0 35 ...
Serialized with boost 1.35 it looks like this: 22 serialization::archive 4 0 35 ...
Otherwise, the archives are in my case completely identical.
Somehow, if this version number does not match to the serialized or archive version of the used boost library, boost throws an exception.
**** where does this exception get thrown?
Robert Ramey
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
------------------------------------------------------------------------------ _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (2)
-
David Graf
-
Robert Ramey