Boost C++ Libraries: Ticket #4929: Another serialization version compatibility issue with binary archives https://svn.boost.org/trac10/ticket/4929 <p> Although the 1-byte / 2-byte library version bug has been resolved (Ticket <a class="reopened ticket" href="https://svn.boost.org/trac10/ticket/4660" title="#4660: Bugs: Error read binary archive, created by old boost version (reopened)">#4660</a>), I've ran into several other problems of the same kind. </p> <p> I have an archive created with boost 1.43 which can't load in 1.45. The first problem occurs while loading the first object's preamble - load_preamble() reads tracking level (as one byte) and a version (as 2 bytes, but within the file it is stored as one byte too). The difference is caused by load_override() function for version_type which used char type in 1.43, now it loads as uint_least16_t for archive version 7. </p> <p> When I fixed this the next thing that failed was deserialization of std::list. The load_collection() function loads item version. In 1.43 this was fixed to unsigned int, in the current it is handled by load_override() which for archive version 7 loads this as uint_least16_t, so it leads to another misalignment. After I fixed those the old archive loads well. I've prepared a patch for those, but I think it probably breaks 1.44 archives using the same version 7. </p> <p> There's another thing that worth mentioning - the boost serialization library can be compiled into a static library. When linking an application with that library, the resulting exe exports many library functions, which is quite undesirable. I think the solution is to remove dllexport declarations when building a static lib, the patch is attached. </p> <p> Hope this helps. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/4929 Trac 1.4.3 Martina Fedyszynová <m_fedyszyn@…> Fri, 03 Dec 2010 22:10:14 GMT attachment set https://svn.boost.org/trac10/ticket/4929 https://svn.boost.org/trac10/ticket/4929 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">patches.zip</span> </li> </ul> Ticket Robert Ramey Thu, 23 Dec 2010 22:43:51 GMT <link>https://svn.boost.org/trac10/ticket/4929#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4929#comment:1</guid> <description> <p> I've updated the trunk in an attempt to fix this problem. Please check this out and let me know if it addresses the situation. </p> <p> Robert Ramey </p> </description> <category>Ticket</category> </item> <item> <author>Martina Fedyszynová <m_fedyszyn@…></author> <pubDate>Fri, 24 Dec 2010 00:04:23 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4929#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4929#comment:2</guid> <description> <p> Well, the problem I mentioned here is with archives made by v1.43, so - according to the SVN comment - it seems not to be relevant for this. BTW the only file updated is oserializer.hpp; haven't you forgotten to commit any changes within the archive input code? :) </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Robert Ramey</dc:creator> <pubDate>Sun, 23 Jan 2011 02:38:44 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4929#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4929#comment:3</guid> <description> <p> Note that I've updated binary_archive in several places to address this. The changes have been tested by others and are now in the trunk and release. </p> <p> Robert Ramey </p> </description> <category>Ticket</category> </item> <item> <author>Martina Fedyszynová <m_fedyszyn@…></author> <pubDate>Sun, 23 Jan 2011 14:52:23 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4929#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4929#comment:4</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/4929#comment:3" title="Comment 3">ramey</a>: </p> <blockquote class="citation"> <p> Note that I've updated binary_archive in several places to address this. The changes have been tested by others and are now in the trunk and release. </p> <p> Robert Ramey </p> </blockquote> <p> Yes, that seems to work smoothly with any problematic archives I have. Great work, thanks. </p> </description> <category>Ticket</category> </item> <item> <author>Martina Fedyszynová <m_fedyszyn@…></author> <pubDate>Sun, 23 Jan 2011 14:58:20 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/4929#comment:5 https://svn.boost.org/trac10/ticket/4929#comment:5 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> Ticket