Boost C++ Libraries: Ticket #4660: Error read binary archive, created by old boost version https://svn.boost.org/trac10/ticket/4660 <p> I have some binary archive files, which was created by old version of boost::serialization. New (1.44) version does not read these files. Program throws exception “unsupported_version” </p> <p> I have done some small investigation. The pproblem is: </p> <p> Old code writes library_version as 1 byte, but new code (1.44) writes library_version as unsigned short!!! </p> <p> You can see in attachment 2 files, which was created boost_1_44_0\libs\serialization\example\demo.cpp. I modify this program for work with binary archive. First file demofile.dat was created with boost 1.43. Second file demofile_1_44.dat. Was created with boost 1.44. </p> <p> I think it is very serious bug, as archive compatibility was ruined. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/4660 Trac 1.4.3 Sergey Voropaev <serge-voropaev@…> Mon, 20 Sep 2010 09:12:30 GMT attachment set https://svn.boost.org/trac10/ticket/4660 https://svn.boost.org/trac10/ticket/4660 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">demofile.3.dat</span> </li> </ul> <p> binary archive 1.43 version </p> Ticket Sergey Voropaev <serge-voropaev@…> Mon, 20 Sep 2010 09:12:50 GMT attachment set https://svn.boost.org/trac10/ticket/4660 https://svn.boost.org/trac10/ticket/4660 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">demofile_1_44.dat</span> </li> </ul> Ticket Sergey Voropaev <serge-voropaev@…> Mon, 20 Sep 2010 09:15:25 GMT attachment set https://svn.boost.org/trac10/ticket/4660 https://svn.boost.org/trac10/ticket/4660 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">demo.cpp</span> </li> </ul> <p> demo.cpp with my modification </p> Ticket Robert Ramey Mon, 20 Sep 2010 15:17:26 GMT <link>https://svn.boost.org/trac10/ticket/4660#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4660#comment:1</guid> <description> <p> Indeed this is a serious problem. </p> <p> It is addressed in the release notes documentation 1.44 . Try the recommendation described there and let me know how that goes. If that does it for you, please close this ticket </p> <p> Robert Ramey </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Tue, 21 Sep 2010 02:01:24 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4660#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4660#comment:2</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/4660#comment:1" title="Comment 1">ramey</a>: </p> <blockquote class="citation"> <p> Indeed this is a serious problem. </p> <p> It is addressed in the release notes documentation 1.44 . Try the recommendation described there and let me know how that goes. If that does it for you, please close this ticket </p> <p> Robert Ramey </p> </blockquote> <p> I had searche documentation before open bug and I did not find any information. I have search <a href="http://www.boost.org/doc/libs/1_44_0/libs/serialization/doc/index.html">http://www.boost.org/doc/libs/1_44_0/libs/serialization/doc/index.html</a> : "As of this writing, there are no known bugs. However, due to compiler/library quirks and or bugs, some tests fail with some combinations of compilers and libraries. Differences from Boost 1.43 •fixed bug in the serialization of virtual base classes. Due to heroic efforts by Takatoshi Kondo" </p> <p> There are not anathing in <a href="http://www.boost.org/users/download/version_1_44_0">http://www.boost.org/users/download/version_1_44_0</a> too. </p> <p> Can you give me link to your recomendation? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Robert Ramey</dc:creator> <pubDate>Tue, 21 Sep 2010 04:54:23 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4660#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4660#comment:3</guid> <description> <p> ouch - my mistake. This last documentation change didn't make it into the release branch. I've checked it in though I don't think it will show up until the next release. So I'm including the relevant text right here </p> <p> Differences from Boost 1.43 </p> <ul><li>fixed bug in the serialization of virtual base classes. Due to heroic efforts by Takatoshi Kondo. </li><li>Native binary archives created under versions 1.42 and 1.43 suffer from a serious problem. It's likely they won't be readable by this latest version. This due to the fact that 1.42 made some changes in the binary format of some types. Normally this could be addressed by detecting the library version number written into the archive header. Unfortunately, this library version number was not incremented at 1.42 as it should have been. So now we have two different binary archive versions with the same library version number. </li></ul><blockquote> <blockquote> <p> This has been addressed by including a small utility in the example directory named fix_six.cpp. This should be run with the command line </p> </blockquote> </blockquote> <blockquote> <blockquote> <blockquote> <p> fix_six &lt;file name&gt; </p> </blockquote> </blockquote> </blockquote> <p> </p> <blockquote> <blockquote> <p> This will assign 7 to the library version number of the archive. This fix will need to be applied to native binary archives created with boost versions 1.42 and 1.43. </p> </blockquote> </blockquote> <p> Let me know if this addresses the situation. </p> <p> Robert Ramey </p> </description> <category>Ticket</category> </item> <item> <author>Sergey Voropaev <serge-voropaev@…></author> <pubDate>Tue, 21 Sep 2010 05:25:01 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4660#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4660#comment:4</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/4660#comment:3" title="Comment 3">ramey</a>: </p> <blockquote class="citation"> <p> ouch - my mistake. This last documentation change didn't make it into the release branch.<br /> .........<br /> Let me know if this addresses the situation. </p> <p> Robert Ramey </p> </blockquote> <p> I did not find any fix*.cpp in boost_1_44_0\libs\serialization\ </p> <p> But I think it is not problem with "6" version. I have native binary archives 1.34.1 and 1.43.0 And all was good. But version 1.44 <strong>change</strong> binary format of version information. Format before 1.44.0 was unsigned char. Format of 1.44 is unsigned short. So 1.44.0 read invalid value. For example it read 0x0404 as library version from file, which was created by 1.34.1, but should read 0x04. Please see files, which I sent as attachements, in any hex editor. </p> <p> You can see library version information below as <strong>bold</strong> value<br /> 1.34.1 first 32 bytes of file:<br /> 16 00 00 00 73 65 72 69 61 6c 69 7a 61 74 69 6f 6e 3a 3a 61 72 63 68 69 76 65<strong> 04</strong> 04 04 04 08 01 1.43.0 first 32 bytes of file:<br /> 16 00 00 00 73 65 72 69 61 6c 69 7a 61 74 69 6f 6e 3a 3a 61 72 63 68 69 76 65 <strong>07</strong> 04 04 04 08 01 1.44.0 first 32 bytes of file:<br /> 16 00 00 00 73 65 72 69 61 6c 69 7a 61 74 69 6f 6e 3a 3a 61 72 63 68 69 76 65 <strong>07 00</strong> 04 04 04 08 </p> <p> </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Robert Ramey</dc:creator> <pubDate>Tue, 21 Sep 2010 06:32:57 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/4660 https://svn.boost.org/trac10/ticket/4660 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">fix_six.cpp</span> </li> </ul> Ticket Robert Ramey Tue, 21 Sep 2010 06:33:30 GMT <link>https://svn.boost.org/trac10/ticket/4660#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4660#comment:5</guid> <description> <p> ouch - again. I merging the missing file into the release branch. In the mean time her eit is. </p> <p> Robert Ramey </p> </description> <category>Ticket</category> </item> <item> <author>Sergey Voropaev <serge-voropaev@…></author> <pubDate>Tue, 21 Sep 2010 06:57:38 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4660#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4660#comment:6</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/4660#comment:5" title="Comment 5">ramey</a>: </p> <blockquote class="citation"> <p> ouch - again. I merging the missing file into the release branch. In the mean time her eit is. </p> <p> Robert Ramey </p> </blockquote> <p> I download fix_six.cpp from trunk and build it with 1.44.0 release. The program does not work with archive, created by boost 1.34.1 and 1.43.0. The code " boost::archive::binary_iarchive ia(fb); " throw exception from line in basic_binary_iarchive.ipp:<br /> </p> <pre class="wiki"> if(BOOST_ARCHIVE_VERSION() &lt; input_library_version) boost::serialization::throw_exception( archive_exception(archive_exception::unsupported_version) ); </pre><p> Value of variable <strong>input_library_version</strong> is 0x0407 Please read my comments above about change format of library version information from "unsigned char" -&gt; "unsigned short" </p> <p> </p> </description> <category>Ticket</category> </item> <item> <author>Sergey Voropaev <serge-voropaev@…></author> <pubDate>Wed, 22 Sep 2010 06:50:23 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4660#comment:7 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4660#comment:7</guid> <description> <p> I prepare some simple test program cser and tser. See attachments. First program (cser) creates simple native binary archive. Second program (tser) test these archive. I build these programs with 3 different version of BOOST – 1.34.1, 1.43 and 1.44. Then I run all version of cser and create 3 archive – arch_1_34_1.dat, arch_1_43.dat and arch_1_43.dat (see attachments). Then I run each version of tser with each version of archive. The results are: </p> <p> tser + boost 1.34.1<br /> arch_1_34_1.dat – “Test – OK”<br /> arch_1_43.dat – “archive serializations error - unsupported version”<br /> arch_1_44.dat – “archive serializations error - unsupported version”<br /> </p> <p> tser + boost 1.43<br /> arch_1_34_1.dat – “Test – OK”<br /> arch_1_43.dat – “Test – OK”<br /> arch_1_44.dat – “archive serializations error - incompatible native format - size of int”<br /> </p> <p> tser + boost 1.44<br /> arch_1_34_1.dat – “archive serializations error - unsupported version”<br /> arch_1_43.dat – “archive serializations error - unsupported version”<br /> arch_1_44.dat – “Test – OK”<br /> </p> <p> My summary<br /> 1) serialization 1.44 can not work with old version of binary archives. So backward compatibility was ruined.<br /> 2) format of binary archive in version 1.44 was changed, so version 1.43 does not work with new archive. And now we have 2 different incompatible version of native binary archive (before 1.44 and 1.44). Text archive does not have this problem </p> <p> So implementation of serialization in 1.44 is broken. I think this problem must be resolved ASAP. I think users must be informed about these problem with serialization and users must do not use this version in production code. May be we need 1.44.1 version? </p> </description> <category>Ticket</category> </item> <item> <author>Sergey Voropaev <serge-voropaev@…></author> <pubDate>Wed, 22 Sep 2010 06:51:34 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/4660 https://svn.boost.org/trac10/ticket/4660 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">cser.cpp</span> </li> </ul> <p> Create simple native archive </p> Ticket Sergey Voropaev <serge-voropaev@…> Wed, 22 Sep 2010 07:11:30 GMT attachment set https://svn.boost.org/trac10/ticket/4660 https://svn.boost.org/trac10/ticket/4660 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">tser.3.cpp</span> </li> </ul> <p> test native binary archive </p> Ticket Sergey Voropaev <serge-voropaev@…> Wed, 22 Sep 2010 07:12:28 GMT attachment set https://svn.boost.org/trac10/ticket/4660 https://svn.boost.org/trac10/ticket/4660 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">arch_1_34_1.dat</span> </li> </ul> <p> arcive 1.34.1 version </p> Ticket Sergey Voropaev <serge-voropaev@…> Wed, 22 Sep 2010 07:13:20 GMT attachment set https://svn.boost.org/trac10/ticket/4660 https://svn.boost.org/trac10/ticket/4660 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">arch_1_43.dat</span> </li> </ul> <p> archive 1.43 version </p> Ticket Sergey Voropaev <serge-voropaev@…> Wed, 22 Sep 2010 07:14:00 GMT attachment set https://svn.boost.org/trac10/ticket/4660 https://svn.boost.org/trac10/ticket/4660 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">arch_1_44.dat</span> </li> </ul> <p> archive 1.44 version </p> Ticket Robert Ramey Sat, 25 Sep 2010 18:41:48 GMT <link>https://svn.boost.org/trac10/ticket/4660#comment:8 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4660#comment:8</guid> <description> <p> OK, I'm now going to look at this more carefully. </p> <p> I do think there is a little more to this that meets the eye. The problem started when I made a simple tweak in 1.42 to eliminate a warning. It wasn't really correct and the issue was very muddled because the concept of "version" was applied to library version and data type version which are quite different things. There were a few other problems besides. Your observations and effort ARE appreciated so don't give up hope. I'm looking at this </p> <p> Robert Ramey </p> </description> <category>Ticket</category> </item> <item> <dc:creator>hajokirchhoff</dc:creator> <pubDate>Mon, 18 Oct 2010 09:45:54 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4660#comment:9 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4660#comment:9</guid> <description> <p> Hi there, I am bitten by this as well. </p> <p> Problem: Prior to 1.44 the archive version was written as "one byte". Starting with 1.44 archive version type changed from 'version_type' to 'library_version_type' and is expected to be read as two bytes. </p> <p> There is a comment in basic_archive.cpp: </p> <pre class="wiki">// 7 - separated version_type into library_version_type and class_version_type // changed version_type to be stored as 8 bits. </pre><p> this definitely points to the problem. </p> <p> This is a really <span class="underline">serious</span> problem, a potential showstopper. The longer this remains open, the more binary archives of version &lt;1.44 and 1.44 will both exist. And if this problem cannot be resolved in a backwards compatible way, either all binary &lt;1.44 or all binary 1.44 archives will break. </p> <p> Also I think it is <span class="underline">imperative</span> to add backwards compatibility to the test suite! A new version of boost::serialization should not be released unless tests reading previous versions of the archives pass. </p> <p> Breaking changes to the archives are really, really bad! And I mean really bad! </p> <p> (Otherwise, thanks a lot for your work. It's a great library :-) </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Vladimir Prus</dc:creator> <pubDate>Wed, 20 Oct 2010 05:50:31 GMT</pubDate> <title>version changed https://svn.boost.org/trac10/ticket/4660#comment:10 https://svn.boost.org/trac10/ticket/4660#comment:10 <ul> <li><strong>version</strong> <span class="trac-field-old">Boost 1.44.0</span> → <span class="trac-field-new">Boost 1.45.0</span> </li> </ul> Ticket Bryce Adelstein Lelbach Wed, 20 Oct 2010 06:09:08 GMT <link>https://svn.boost.org/trac10/ticket/4660#comment:11 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4660#comment:11</guid> <description> <p> Ramey has committed (<a class="changeset" href="https://svn.boost.org/trac10/changeset/66106" title="fix compatibility with archive versions 1.41-, 1.42, 1.43,1.44+">r66106</a> and <a class="changeset" href="https://svn.boost.org/trac10/changeset/66107" title="fix compatibility with archive versions 1.41-, 1.42, 1.43,1.44+ and a ...">r66107</a>); this should be fixed. Can the original submitter of this ticket please check if <a class="changeset" href="https://svn.boost.org/trac10/changeset/66106" title="fix compatibility with archive versions 1.41-, 1.42, 1.43,1.44+">r66106</a> and <a class="changeset" href="https://svn.boost.org/trac10/changeset/66107" title="fix compatibility with archive versions 1.41-, 1.42, 1.43,1.44+ and a ...">r66107</a> fix this error? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Vladimir Prus</dc:creator> <pubDate>Wed, 20 Oct 2010 06:11:56 GMT</pubDate> <title>milestone changed https://svn.boost.org/trac10/ticket/4660#comment:12 https://svn.boost.org/trac10/ticket/4660#comment:12 <ul> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost-1.45.0</span> </li> </ul> Ticket Sergey Voropaev <serge-voropaev@…> Wed, 20 Oct 2010 08:04:31 GMT <link>https://svn.boost.org/trac10/ticket/4660#comment:13 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4660#comment:13</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/4660#comment:11" title="Comment 11">wash</a>: </p> <blockquote class="citation"> <p> Ramey has committed (<a class="changeset" href="https://svn.boost.org/trac10/changeset/66106" title="fix compatibility with archive versions 1.41-, 1.42, 1.43,1.44+">r66106</a> and <a class="changeset" href="https://svn.boost.org/trac10/changeset/66107" title="fix compatibility with archive versions 1.41-, 1.42, 1.43,1.44+ and a ...">r66107</a>); this should be fixed. Can the original submitter of this ticket please check if <a class="changeset" href="https://svn.boost.org/trac10/changeset/66106" title="fix compatibility with archive versions 1.41-, 1.42, 1.43,1.44+">r66106</a> and <a class="changeset" href="https://svn.boost.org/trac10/changeset/66107" title="fix compatibility with archive versions 1.41-, 1.42, 1.43,1.44+ and a ...">r66107</a> fix this error? </p> </blockquote> <p> I have updated my version of serializatopn library to revision 66114 and built my small test programs cser and tser (see above). New version (1.44+) work well. (VC 7.1 + STLPort) </p> <p> I think we need detailed description of possible problem of using 1.44 version of serialization and some recomendation (not using 1.44 for binary archive?) </p> <p> I think <a class="ticket" href="https://svn.boost.org/trac10/ticket/4660#comment:9" title="Comment 9">hajokirchhoff</a> is is absolutely right : </p> <blockquote class="citation"> <p> Also I think it is imperative to add backwards compatibility to the test suite! A new version of boost::serialization should not be released unless tests reading previous versions of the archives pass. </p> </blockquote> <p> It would be very nice if someone checked backward compatibility with other types of archives (text, XML, portability ...) </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Robert Ramey</dc:creator> <pubDate>Wed, 20 Oct 2010 15:59:47 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4660#comment:14 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4660#comment:14</guid> <description> <p> I have checked in changes to the trunk to address this. Please feel free to verify that they have addressed the problem. </p> <p> I would love to have tests to verify compatibility with previous archives - especially binary ones. There are a lot of problems with this though. </p> <p> a) It's a heck of a lot of work. b) The serialization library already stretches testing facilities to the breaking point. It has a fairly large number of tests which are run with all the different archive implementations. It has been referred to as "carpet bombing". </p> <p> If someone want's to do this I would support the effort though. </p> <p> Robert Ramey </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Bryce Adelstein Lelbach</dc:creator> <pubDate>Sat, 30 Oct 2010 00:25:16 GMT</pubDate> <title>status changed; cc, resolution set https://svn.boost.org/trac10/ticket/4660#comment:15 https://svn.boost.org/trac10/ticket/4660#comment:15 <ul> <li><strong>cc</strong> <span class="trac-author">Bryce Adelstein Lelbach</span> added </li> <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> <p> This has since been resolved. </p> Ticket mark.stijnman@… Wed, 24 Nov 2010 10:45:51 GMT <link>https://svn.boost.org/trac10/ticket/4660#comment:16 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4660#comment:16</guid> <description> <p> I was bitten by this bug too. Did this make it into the 1.45 release? I didn't see serialization listed in the updated libraries, and it's not in the "changes since version..." section of the serialization documentation either. </p> </description> <category>Ticket</category> </item> <item> <author>thomas.bretgeld@…</author> <pubDate>Wed, 08 Dec 2010 20:30:58 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4660#comment:17 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4660#comment:17</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/4660#comment:16" title="Comment 16">mark.stijnman@…</a>: </p> <blockquote class="citation"> <p> I was bitten by this bug too. Did this make it into the 1.45 release? I didn't see serialization listed in the updated libraries, and it's not in the "changes since version..." section of the serialization documentation either. </p> </blockquote> <p> I second this question. Has this problem been resolved or does it also affect v1.45? I ask, because I have updated to boost v1.45 yesterday and have problems to open older binary archives, which have been created with boost v1.37 and v1.42. To sort out where the error comes from, I tried to recompile my software and the boost libraries with some intermediate versions of boost. It works ok with v1.42. On v1.44 I get the "unsupported version" error, but on v1.45 I am getting a lot of exceptions "basic_string::resize" when I try to open older binary archives. I am using Debian lenny with gcc 4.3.2. </p> <p> Kind regards, Thomas </p> </description> <category>Ticket</category> </item> <item> <author>Sergey Voropaev <serge-voropaev@…></author> <pubDate>Thu, 09 Dec 2010 03:05:28 GMT</pubDate> <title>status, severity changed; resolution deleted https://svn.boost.org/trac10/ticket/4660#comment:18 https://svn.boost.org/trac10/ticket/4660#comment:18 <ul> <li><strong>status</strong> <span class="trac-field-old">closed</span> → <span class="trac-field-new">reopened</span> </li> <li><strong>resolution</strong> <span class="trac-field-deleted">fixed</span> </li> <li><strong>severity</strong> <span class="trac-field-old">Showstopper</span> → <span class="trac-field-new">Problem</span> </li> </ul> <p> Replying to mark.stijnman@…: and thomas.bretgeld@… </p> <p> I wrote letter about problem with documentation of this bug - <a class="ext-link" href="http://thread.gmane.org/gmane.comp.lib.boost.devel/210992"><span class="icon">​</span>http://thread.gmane.org/gmane.comp.lib.boost.devel/210992</a> I see the problem is concerned not only me. As I do not undestand situation with 1.45 version, I reopen this bug. </p> Ticket Duncan Exon Smith <duncanphilipnorman@…> Thu, 09 Dec 2010 19:54:10 GMT <link>https://svn.boost.org/trac10/ticket/4660#comment:19 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4660#comment:19</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/4660#comment:17" title="Comment 17">thomas.bretgeld@…</a>: </p> <blockquote class="citation"> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/4660#comment:16" title="Comment 16">mark.stijnman@…</a>: I second this question. Has this problem been resolved or does it also affect v1.45? I ask, because I have updated to boost v1.45 yesterday and have problems to open older binary archives, which have been created with boost v1.37 and v1.42. To sort out where the error comes from, I tried to recompile my software and the boost libraries with some intermediate versions of boost. It works ok with v1.42. On v1.44 I get the "unsupported version" error, but on v1.45 I am getting a lot of exceptions "basic_string::resize" when I try to open older binary archives. I am using Debian lenny with gcc 4.3.2. </p> </blockquote> <p> It looks to me like errors are <em>expected</em> when reading archives created with v1.42 or v1.43. </p> <blockquote> <p> <a href="http://www.boost.org/doc/libs/1_45_0/libs/serialization/doc/release.html#differences_1_43">http://www.boost.org/doc/libs/1_45_0/libs/serialization/doc/release.html#differences_1_43</a> </p> </blockquote> <p> However, I think archives created with v1.37 are supposed to work fine as is, so that might be a separate issue. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Robert Ramey</dc:creator> <pubDate>Thu, 23 Dec 2010 22:42:33 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4660#comment:20 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4660#comment:20</guid> <description> <p> I've updated the trunk in an attempt to fix this problem. That is, I believe that now it should be able to read binary archives created prior to 1.43. 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>joerg schlegel <jschlegel@…></author> <pubDate>Wed, 05 Jan 2011 08:42:29 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4660#comment:21 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4660#comment:21</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/4660#comment:20" title="Comment 20">ramey</a>:Please check this out and let me know if it addresses the situation. </p> <p> I tried to read binary archives created with 1.42, it failed in the exact same way as with using 1.45 (std::string allocator throwing bad_alloc). </p> </description> <category>Ticket</category> </item> <item> <author>joerg schlegel <jschlegel@…></author> <pubDate>Wed, 05 Jan 2011 10:47:57 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4660#comment:22 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4660#comment:22</guid> <description> <p> The most simple test case to reproduce the error I was able to find is: </p> <hr /> <blockquote> <p> std::map&lt;std::string, size_t&gt; m; m<a class="missing wiki">aaa</a> = 111; m<a class="missing wiki">bbb</a> = 222; </p> </blockquote> <blockquote> <p> std::ofstream fb("archive.ser"); <em>std::ifstream fb("archive.ser"); boost::archive::binary_oarchive oa(fb); boost::archive::binary_iarchive ia(fb); oa &lt;&lt; m; </em>ia &gt;&gt; m; </p> </blockquote> <hr /> <ul><li>I compiled it using ms vc8 and boost 1.42 and created the test archive </li><li>If I read it using the same setup the map gets restored flawlessly </li><li>If I read it using the code compiled with ms VC10 and boost svn trunk "m" is empty (my real world rather dies with bad_alloc deep inside the call stack ) </li></ul> </description> <category>Ticket</category> </item> <item> <author>joerg schlegel <jschlegel@…></author> <pubDate>Wed, 05 Jan 2011 10:50:41 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4660#comment:23 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4660#comment:23</guid> <description> <p> Sorry the code formation got lost, I pasted it here <a class="ext-link" href="http://codepad.org/PK2fwo4c"><span class="icon">​</span>http://codepad.org/PK2fwo4c</a> </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Robert Ramey</dc:creator> <pubDate>Wed, 05 Jan 2011 23:12:21 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4660#comment:24 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4660#comment:24</guid> <description> <p> Hmmm.... </p> <p> I built tser_3.cpp on my system with the trunk version of the library. </p> <p> I used it read arch_34_1.dat arch_43.dat and arch_44.dat without problem. So things look OK to me now. </p> <p> Robert Ramey </p> </description> <category>Ticket</category> </item> <item> <author>joerg schlegel <jschlegel@…></author> <pubDate>Thu, 06 Jan 2011 08:19:15 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4660#comment:25 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4660#comment:25</guid> <description> <p> Hi Robert, I see the following possible differences between us: </p> <ul><li>I failed to read an archive created with 1.42, you succeeded reading 1.34,1.43 and 1.44 </li></ul><ul><li>I used VS 2010 to build the reader and VC 2005 to build the writer, so maybe it's the compiler </li></ul><ul><li>I used a map&lt;std::std::string, size_t&gt;, you rather integral and float numbers. Since my production code fails with throwing bad_alloc inside the basic_string allocator, that may also be an hint that the problem is specific to serialization of std::string </li></ul><p> Regards </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Robert Ramey</dc:creator> <pubDate>Tue, 11 Jan 2011 19:11:43 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4660#comment:26 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4660#comment:26</guid> <description> <p> "I failed to read an archive created with 1.42, you succeeded reading 1.34,1.43 and 1.44" </p> <p> Hmmm - does you're trunk version succeed or fail with 1.34,1.43 and 1.44? I don't your 1.42 test to try. Basically we're not running the same tests. I'm willing to try any test which fails for you. </p> <p> Robert Ramey </p> </description> <category>Ticket</category> </item> <item> <author>joerg schlegel <jschlegel@…></author> <pubDate>Wed, 12 Jan 2011 09:52:48 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/4660 https://svn.boost.org/trac10/ticket/4660 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">ser_test.cpp</span> </li> </ul> <p> read or write test archive </p> Ticket joerg schlegel <jschlegel@…> Wed, 12 Jan 2011 09:53:31 GMT attachment set https://svn.boost.org/trac10/ticket/4660 https://svn.boost.org/trac10/ticket/4660 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">archive-1_43.ser</span> </li> </ul> <p> archive created with 1_43 </p> Ticket joerg schlegel <jschlegel@…> Wed, 12 Jan 2011 09:53:47 GMT attachment set https://svn.boost.org/trac10/ticket/4660 https://svn.boost.org/trac10/ticket/4660 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">archive-1_46.ser</span> </li> </ul> <p> archive created with trunk </p> Ticket joerg schlegel <jschlegel@…> Wed, 12 Jan 2011 10:01:38 GMT <link>https://svn.boost.org/trac10/ticket/4660#comment:27 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4660#comment:27</guid> <description> <p> Robert, I attached: </p> <ul><li>ser_test.cpp: simple code to read/write archive with std::map&lt;std::string, size_t&gt; in it </li><li>archive-1_43.ser: output of ser_test.cpp build using boost 1_43 </li><li>archive-1_46.ser: output of ser_test.cpp build using boost trunk </li></ul><p> I run the following tests: </p> <ul><li>read archive-1_43.ser using ser_test.exe compiled using boost 1_43 -&gt; success </li><li>read archive-1_43.ser using ser_test.exe compiled using boost trunk -&gt; fail (map is empty after read) </li><li>read archive-1_46.ser using ser_test.exe compiled using boost trunk -&gt; success </li><li>read archive-1_46.ser using ser_test.exe compiled using boost 1_43 -&gt; throws unsupported_version </li></ul><p> All compile output was created using msvc 10.0. Should be easy to reproduce. Regards </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Robert Ramey</dc:creator> <pubDate>Wed, 12 Jan 2011 17:26:14 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/4660 https://svn.boost.org/trac10/ticket/4660 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">tser_3.cpp</span> </li> </ul> Ticket Robert Ramey Wed, 12 Jan 2011 17:31:47 GMT <link>https://svn.boost.org/trac10/ticket/4660#comment:28 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4660#comment:28</guid> <description> <p> "read archive-1_46.ser using ser_test.exe compiled using boost 1_43 -&gt; throws unsupported_version" </p> <p> This is correct behavior. Older versions of the library cannot necessarily read archives created with subsequent versions of the library. </p> <p> "# read archive-1_43.ser using ser_test.exe compiled using boost trunk -&gt; fail (map is empty after read)" </p> <p> I downloaded ser_test.cpp but it failed to compile on my vc 9.0system </p> <p> Robert Ramey </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Robert Ramey</dc:creator> <pubDate>Wed, 12 Jan 2011 17:34:43 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4660#comment:29 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4660#comment:29</guid> <description> <p> Looking at ser_test.cpp (in spite of it's failure to compile) I see at least one other problem: A binary archive is being used with a stream which has not been opened with ios::binary. This is doomed to fail in any event. </p> <p> Robert Ramey </p> </description> <category>Ticket</category> </item> <item> <author>joerg schlegel <jschlegel@…></author> <pubDate>Thu, 13 Jan 2011 11:40:45 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/4660 https://svn.boost.org/trac10/ticket/4660 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">ser_test_2.cpp</span> </li> </ul> <p> create / read test archive including std::map&lt;std::string, size_t&gt;, corrections: open file in binary mode, adapted to legacy c++ standard </p> Ticket joerg schlegel <jschlegel@…> Thu, 13 Jan 2011 11:43:10 GMT <link>https://svn.boost.org/trac10/ticket/4660#comment:30 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4660#comment:30</guid> <description> <p> Sorry for the inconvenience. I corrected the test program, it now opens the file streams in binary mode and it should compile on vc9.0, too. </p> <p> All test results stays the same, the problematic one beeing: </p> <ul><li>read archive-1_43.ser using ser_test.exe compiled using boost trunk -&gt; fail (map is empty after read) </li></ul> </description> <category>Ticket</category> </item> <item> <dc:creator>Robert Ramey</dc:creator> <pubDate>Fri, 14 Jan 2011 22:41:40 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4660#comment:31 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4660#comment:31</guid> <description> <p> OK, I've checked in a change into the trunk which I believe fixes this latest problem. That is, the loading a collection. Please update from the trunk and verify that I've fixed this. Thanks for giving me this test case. </p> <p> Robert Ramey </p> </description> <category>Ticket</category> </item> <item> <author>joerg schlegel <jschlegel@…></author> <pubDate>Mon, 17 Jan 2011 12:49:55 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4660#comment:32 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4660#comment:32</guid> <description> <p> Hello Robert, Thank you, the latest trunk fixes all my use cases so far. Since the problem will live in 1.45 it may be a good idea to add a note to it's docs. Regards, Joerg </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Robert Ramey</dc:creator> <pubDate>Tue, 18 Jan 2011 22:03:56 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/4660#comment:33 https://svn.boost.org/trac10/ticket/4660#comment:33 <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> Ticket d s m a l l @… Sat, 22 Jan 2011 20:25:23 GMT attachment set https://svn.boost.org/trac10/ticket/4660 https://svn.boost.org/trac10/ticket/4660 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">basic_binary_iarchive-modified.zip</span> </li> </ul> <p> File modifed to read version 3 archives </p> Ticket d s m a l l @… Sat, 22 Jan 2011 20:35:04 GMT <link>https://svn.boost.org/trac10/ticket/4660#comment:34 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4660#comment:34</guid> <description> <p> We are still seeing a problem when using the latest ( Jan 21 2010 ) code. Seems there is still an issue with the assumption regarding the size used to store the file version. </p> <p> Fwiw we are just in the process of upgrading our product to use boost 1.45. It has previously used 1.33.1 and 1.37. We have unit tests that test the ability to read old config archives and one of them is failing. ( Actually others may fail as well but we are stuck on the first failure ). </p> <p> We have worked around the problem by producing a modified version of basic_binary_iarchive.hpp which we include before including any other boost archiving headers. I have attached this modified file in basic_binary_iarchive-modified.zip. Note that the basis for file was 1.45 and not the current code. </p> <p> Please let me know if you need additional information. </p> </description> <category>Ticket</category> </item> <item> <author>d s m a l l @…</author> <pubDate>Sat, 22 Jan 2011 20:40:17 GMT</pubDate> <title>status changed; resolution deleted https://svn.boost.org/trac10/ticket/4660#comment:35 https://svn.boost.org/trac10/ticket/4660#comment:35 <ul> <li><strong>status</strong> <span class="trac-field-old">closed</span> → <span class="trac-field-new">reopened</span> </li> <li><strong>resolution</strong> <span class="trac-field-deleted">fixed</span> </li> </ul> <p> Oops, looks like I forgot to select re-open. </p> Ticket Robert Ramey Sun, 23 Jan 2011 03:23:04 GMT <link>https://svn.boost.org/trac10/ticket/4660#comment:36 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4660#comment:36</guid> <description> <p> OK - I've got your patch and have rolled in your changes. Should be in the trunk by monday. Thanks for tracking this down. </p> <p> Robert Ramey </p> </description> <category>Ticket</category> </item> <item> <author>d s m a l l @…</author> <pubDate>Wed, 26 Jan 2011 16:09:37 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4660#comment:37 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4660#comment:37</guid> <description> <p> Thanks for putting the fix in. </p> <p> We have made further our upgrade and have found that the problem also occurs when the library version is 5. ( Believe version 3 --&gt; boost 1.33.1 and version 5 --&gt; boost 1.37 ). In other words in our work around header we have changed the condition from </p> <p> if(boost::archive::library_version_type(3) == lvt ) </p> <p> to </p> <table class="wiki"> <tr>if(boost::archive::library_version_type(3) == lvt <td> boost::archive::library_version_type(5) == lvt ) </td></tr></table> <p> Btw we hope to complete our upgrade within the next couple of weeks. When we are done, which means we will have made it through all our unit tests, I'll post a comment to let you know. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Robert Ramey</dc:creator> <pubDate>Wed, 26 Jan 2011 16:32:34 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4660#comment:38 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4660#comment:38</guid> <description> <p> note that the current code in trunk and release looks like: </p> <pre class="wiki"> void load_override(version_type &amp; t, int version){ library_version_type lvt = this-&gt;get_library_version(); if(boost::archive::library_version_type(7) &lt; lvt){ this-&gt;detail_common_iarchive::load_override(t, version); } else if(boost::archive::library_version_type(6) &lt; lvt){ uint_least8_t x=0; * this-&gt;This() &gt;&gt; x; t = boost::archive::version_type(x); } else if(boost::archive::library_version_type(5) &lt; lvt){ uint_least16_t x=0; * this-&gt;This() &gt;&gt; x; t = boost::archive::version_type(x); } else if(boost::archive::library_version_type(2) &lt; lvt){ // upto 255 versions unsigned char x=0; * this-&gt;This() &gt;&gt; x; t = version_type(x); } else{ unsigned int x=0; * this-&gt;This() &gt;&gt; x; t = boost::archive::version_type(x); } } </pre><p> Doesn't this do the job for you? </p> <p> Robert Ramey </p> </description> <category>Ticket</category> </item> <item> <dc:creator>fperbet</dc:creator> <pubDate>Thu, 27 Jan 2011 11:05:41 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4660#comment:39 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4660#comment:39</guid> <description> <p> Hi, </p> <p> I ran into the same (serious) problem: exception "unsupported version" (see callstack) </p> <p> I understand there's a potential fix in the trunk but this is not an option for me. </p> <p> I tried the "fix_six.cpp" but it didn't help. Is there another way to simply fix the binary archive files so they can be read by 1.44 ? </p> <p> I am using 1.44 and the archive were generated using 1.39 (if I remember correctly). </p> <p> Any idea would help. </p> <p> Frank Perbet </p> <p> CALLSTACK: boost::serialization::throw_exception&lt;boost::archive::archive_exception&gt;(const boost::archive::archive_exception &amp; e={...}) Line 37 C++ boost::archive::basic_binary_iarchive&lt;boost::archive::binary_iarchive&gt;::init() Line 93 + 0x35 bytes C++ boost::archive::binary_iarchive_impl&lt;boost::archive::binary_iarchive,char,std::char_traits&lt;char&gt; &gt;::init(unsigned int flags=0) Line 57 C++ boost::archive::binary_iarchive_impl&lt;boost::archive::binary_iarchive,char,std::char_traits&lt;char&gt; &gt;::binary_iarchive_impl&lt;boost::archive::binary_iarchive,char,std::char_traits&lt;char&gt; &gt;(std::basic_istream&lt;char,std::char_traits&lt;char&gt; &gt; &amp; is={...}, unsigned int flags=0) Line 86 C++ bodyanalyzer.dll!boost::archive::binary_iarchive::binary_iarchive(std::basic_istream&lt;char,std::char_traits&lt;char&gt; &gt; &amp; is={...}, unsigned int flags=0) Line 84 + 0x3d bytes C++ </p> </description> <category>Ticket</category> </item> <item> <author>d s m a l l @…</author> <pubDate>Tue, 15 Feb 2011 01:37:47 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4660#comment:40 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4660#comment:40</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/4660#comment:38" title="Comment 38">ramey</a>: </p> <p> Sorry for the delay in reply. The code you posted won't work for us. Fwiw, below is the code that we have in our over-ride header. With it all of our unit tests are passing </p> <pre class="wiki"> void load_override(version_type &amp; t, int version){ library_version_type lvt = this-&gt;get_library_version(); if(boost::archive::library_version_type(7) &lt; lvt){ this-&gt;detail_common_iarchive::load_override(t, version); } else if(boost::archive::library_version_type(6) &lt; lvt){ uint_least16_t x=0; * this-&gt;This() &gt;&gt; x; t = boost::archive::version_type(x); } else if(boost::archive::library_version_type(3) == lvt || boost::archive::library_version_type(5) == lvt ){ #pragma message( "CTMS fix for serialization bug ( lack of backwards compatability ) introduced by boost 1.45." ) // upto 255 versions unsigned char x=0; * this-&gt;This() &gt;&gt; x; t = version_type(x); } else{ unsigned int x=0; * this-&gt;This() &gt;&gt; x; t = boost::archive::version_type(x); } } </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>Robert Ramey</dc:creator> <pubDate>Sat, 19 Feb 2011 17:12:24 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4660#comment:41 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4660#comment:41</guid> <description> <p> Hmmm - this is quite different than what we've checked into the trunk. </p> <pre class="wiki">version mine yours 7* uint_least8 uint_least16 6* uint_least16 unsigned int 5 unsigned char unsigned char 4* unsigned char unsigned int 3 unsigned char unsigned char 2 unsigned int unsigned int </pre><p> So we have differences in 7, 6 and 4. I notice you're not explicitly checking for 4 so maybe you're don't have archives of that version. </p> <p> I can't explain the differences between 7 and 6. As far as I know, your case is the last pending reported issue with this. Of course that doesn't mean much. I'll leave this open some time longer </p> <p> Robert Ramey </p> </description> <category>Ticket</category> </item> <item> <dc:creator>monkeyiq</dc:creator> <pubDate>Sat, 09 Apr 2011 08:40:04 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4660#comment:42 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4660#comment:42</guid> <description> <p> Fedora 14 just happens to include boost 1_44. I've submitted a report to get the boost in Fedora 14 patched to allow binary archives from older fedora to be read again... the bug id is 694448 on redhats bugzilla. </p> </description> <category>Ticket</category> </item> <item> <author>thomas.bretgeld@…</author> <pubDate>Mon, 30 May 2011 18:01:12 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4660#comment:43 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4660#comment:43</guid> <description> <p> Hi again, </p> <p> today I have tested my old archives again against a newly compile boost 1.46.1 filesystem library. The "Unsupported Version" error is gone, but now it fails to open the archive with the following error: </p> <p> /usr/include/boost/archive/basic_archive.hpp:116: boost::archive::class_id_type::class_id_type(int): Assertion `t_ &lt;= boost::integer_traits&lt;base_type&gt;::const_max' failed. </p> <p> This archive opens fine with V1.42. Is this a known error? If not, what can I do track it down? </p> <p> Thomas Bretgeld </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Thu, 23 Jun 2011 17:53:08 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/4660 https://svn.boost.org/trac10/ticket/4660 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">boost-1.46.0-binary-archive-version.patch</span> </li> </ul> <p> Additional fix for reading version 6 archives </p> Ticket anonymous Thu, 23 Jun 2011 17:57:14 GMT <link>https://svn.boost.org/trac10/ticket/4660#comment:44 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4660#comment:44</guid> <description> <p> Hi there. Here where I'm sitting, version 6 archives have only one byte of version information, which means we should handle it the same way as version &lt;6. That's what this patch does. I tested this with boost 1.46 and it fixes the issue that I'm seeing (archive produced by boost 1.41 being read by boost 1.46-consumer). </p> <p> I'm not sure if one of the interim versions of boost happened to have two-byte version-6 archives. If yes, then handling version 6 should be merged with version 7. If not, then it can be merged with handling version &lt;6 as the patch does. In any case, separate branch for version 6 doesn't seem to be necessary. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Thu, 29 Mar 2012 13:52:20 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4660#comment:45 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4660#comment:45</guid> <description> <p> Can anyone tell more about the status of this bug? </p> <p> Unfortunately the problem seems to persist in boost 1.49.0. An archive created with boost 1.32 can be read by 1.43 but not by 1.49. </p> </description> <category>Ticket</category> </item> <item> <author>binhvanpham@…</author> <pubDate>Thu, 29 Mar 2012 23:53:08 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4660#comment:46 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4660#comment:46</guid> <description> <p> Hi, I encounter this issue while linking </p> <p> Can't load '/home/scratch.bipham_ctg100/generic_dev/scripts/x86_64-linux/auto/nDB/nDB.so' for module nDB: /home/scratch.bipham_ctg100/generic_dev/scripts/x86_64-linux/auto/nDB/nDB.so: undefined symbol: _ZTIN5boost7archive17archive_exceptionE at /home/utils/perl-5.8.6/lib/5.8.6/x86_64-linux/XSLoader.pm line 70. </p> <blockquote> <p> at /home/scratch.bipham_ctg100/generic_dev/scripts/x86_64-linux/nDB.pm line 56 </p> </blockquote> <p> Compilation failed in require at /home/scratch.bipham_ctg100/generic_dev/scripts/test2.pl line 11. BEGIN failed--compilation aborted at /home/scratch.bipham_ctg100/generic_dev/scripts/test2.pl line 11. </p> <p> Do you know what is happening? </p> </description> <category>Ticket</category> </item> <item> <author>markus.henschel@…</author> <pubDate>Thu, 20 Sep 2012 09:33:58 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4660#comment:47 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4660#comment:47</guid> <description> <p> Compatibility ist still broken. We have binary archives from 1.34.1 that fail to load in 1.51 now. I stepped through the code and it seems like the class_id is 2 bytes in 1.34.1 but 1.51 tries to load it as 4 bytes. See basic_binary_iarchive.hpp: </p> <p> This is what the code looks like in 1.51 </p> <pre class="wiki">void load_override(class_id_type &amp; t, int version){ library_version_type lvt = this-&gt;get_library_version(); if(boost::archive::library_version_type(7) &lt; lvt){ this-&gt;detail_common_iarchive::load_override(t, version); } else if(boost::archive::library_version_type(6) &lt; lvt){ int_least16_t x=0; * this-&gt;This() &gt;&gt; x; t = boost::archive::class_id_type(x); } else{ int x=0; * this-&gt;This() &gt;&gt; x; t = boost::archive::class_id_type(x); } } </pre><p> 1.34.1 has library version 4 and had this code </p> <pre class="wiki">void load_override(class_id_type &amp; t, int){ // upto 32K classes int_least16_t x; * this-&gt;This() &gt;&gt; x; t = class_id_type(x); } </pre><p> So it seems to me that this is the problem. I checked the source code of releases from 1.34 to 1.40 (library version 6) and it looks like the class id has always been 16 bits. So this is was the code should look like: </p> <pre class="wiki">void load_override(class_id_type &amp; t, int version){ library_version_type lvt = this-&gt;get_library_version(); if(boost::archive::library_version_type(7) &lt; lvt){ this-&gt;detail_common_iarchive::load_override(t, version); } else { int_least16_t x=0; * this-&gt;This() &gt;&gt; x; t = boost::archive::class_id_type(x); } } </pre> </description> <category>Ticket</category> </item> <item> <author>serge-voropaev@…</author> <pubDate>Thu, 20 Sep 2012 09:53:25 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4660#comment:48 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4660#comment:48</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/4660#comment:47" title="Comment 47">markus.henschel@…</a>: </p> <blockquote class="citation"> <p> Compatibility ist still broken. </p> </blockquote> <p> ..... </p> <p> My advise - do not use boost.serialization. This library does not have good maintenance. You can see some discussion in boost developer mail-list. We ended use of this library in our projects. </p> <p> Sergey Voropaev (Reporter of this bug) </p> </description> <category>Ticket</category> </item> <item> <author>Duncan Exon Smith <duncanphilipnorman@…></author> <pubDate>Thu, 20 Sep 2012 15:30:49 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4660#comment:49 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4660#comment:49</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/4660#comment:48" title="Comment 48">serge-voropaev@…</a>: </p> <blockquote class="citation"> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/4660#comment:47" title="Comment 47">markus.henschel@…</a>: </p> <blockquote class="citation"> <p> Compatibility ist still broken. </p> </blockquote> <p> ..... </p> <p> My advise - do not use boost.serialization. This library does not have good maintenance. You can see some discussion in boost developer mail-list. We ended use of this library in our projects. </p> <p> Sergey Voropaev (Reporter of this bug) </p> </blockquote> <p> If you're going to transition, a less disruptive option is to use text archives -- which are less bug prone than binary -- that are passed through a gzip filter. That's worked very well for us. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Thu, 29 Nov 2012 07:11:57 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4660#comment:50 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4660#comment:50</guid> <description> <p> Unfortunately, new users won't see this advice - I doubt they'd look for something like this ticket until they stumble upon the problem themselves... In the meanwhile, it seems like nothing has changed in this library since boost 1.46. </p> <p> See also this bug: <a class="ext-link" href="https://svn.boost.org/trac/boost/ticket/5567"><span class="icon">​</span>https://svn.boost.org/trac/boost/ticket/5567</a> </p> </description> <category>Ticket</category> </item> <item> <author>markus.henschel@…</author> <pubDate>Fri, 22 Feb 2013 19:54:40 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4660#comment:51 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4660#comment:51</guid> <description> <p> I made a last effort to get this stuff fixed and did a lot of research. I have tested library versions from 1.34.1 to 1.46.1 with regards to how they store different types in binary archives. Because the main problem is that sizes for some types differ between library versions I tested how these types were serialized in different versions of the library: -version_type<br /> -class_id_type<br /> -class_id_reference_type<br /> -object_id_type<br /> -object_reference_type<br /> -tracking_type<br /> -collection_size_type<br /> </p> <p> These files that are relevant:<br /> </p> <ol><li>boost/archive/binary_oarchive.hpp<br /> </li></ol><p> This file contains overrides for storing the mentioned types that changed in size. </p> <ol start="2"><li>boost/archive/basic_archive.hpp<br /> </li></ol><p> This file defined the the types mentioned above.<br /> </p> <ol start="3"><li>boost/archive/binary_iarchive.hpp<br /> </li></ol><p> This file contains several load_override member functions that handle backwards compatibility to older archive versions. </p> <p> With different versions of the library the save overrides changed as well as the definitions of the types themselves. But for every version there is one definite type that has it's memory written to the output stream buffer. So I created an excel table that lists this information and attached it. </p> <p> The essence of this research is the following: a) The source of the problem started in 1.44. The documentation and the maintainers comments indicate that 1.42 changed the size of several types. This is true but it wasn't problematic for binary archives because they did explicitly override the serialization of these types. For instance class_id_type changed from int to int_least16_t but this didn't matter for the serialization of this type because the binary output archive stored it as a 16 bit type anyway. (To be precise the type used in save_override also changed but only from uint_least16_t to int_least16_t and this shouldn't usually cause any trouble unless a lot of classes are being used.) </p> <p> b) 1.44.0 removed the custom save_override functions for most types but the only type that really got a different binary representation is version_type. It changed from char to uint_least32_t. At the same time a load_override function was added but it used the wrong type for older archives. Instead of unsigned char is used unsigned int. Because 1.44.0 didn't increase the archive number it cannot be distinguished from archives of 1.42.0 and 1.43.0. All have version 7. </p> <p> c) Later changes fixed some things but introduced new bugs. It seems like the code tries to read all types like they are defined in basic_archive.hpp in the respective version of the library. The results are hit or miss. The problem is that the fixes seem to ignore the fact that these types had save_override functions in prior library versions that did alter the type actually stored in the data stream. So the current situation is much worse than it has to be. </p> <p> d) The only "unfixable" problem is that 1.42, 1.43 and 1.44 have the same version number. Either 1.42+1.43 or 1.44 cannot be loaded. </p> <p> I contacted the maintainer Robert Ramey via the boost developer mailing list and he agreed to at least take a look at the issue. I took a long time to extract all this information. I will provide a proper fix next week. Hopefully it will make it into boost so I can work with an unpatched boost version again. </p> </description> <category>Ticket</category> </item> <item> <author>markus.henschel@…</author> <pubDate>Fri, 22 Feb 2013 19:59:11 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/4660 https://svn.boost.org/trac10/ticket/4660 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">Boost_binary_output_archive_storage_data_types.xlsx</span> </li> </ul> <p> data types stored by binary archives for various internal serialization library types </p> Ticket markus.henschel@… Mon, 25 Feb 2013 18:58:45 GMT attachment set https://svn.boost.org/trac10/ticket/4660 https://svn.boost.org/trac10/ticket/4660 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">boost serialization binary archive compatibility fix.patch</span> </li> </ul> <p> Fix for making binary archives created by ALL versions work </p> Ticket markus.henschel@… Mon, 25 Feb 2013 19:26:43 GMT <link>https://svn.boost.org/trac10/ticket/4660#comment:52 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4660#comment:52</guid> <description> <p> After digging even deeper into the matter and creating the promised patch I have good news. If I'm not mistaken the patch fixes compatibility of binary archives created by all versions. Even 1.42, 1.43 and 1.44 should work. There already was code that could detect if the archive version was 1 or 2 bytes. This made it possible to differentiate between 1.43 (1 byte archive id) and 1.44 (2 byte archive id). I added some comments to make clear how this works. </p> <p> Because I didn't want to introduce another variable to tell if an archive with version 7 is from 1.43 or from 1.44 I increased the archive version to 8 if 1.44 was detected while loading the archive header. This should work because when 1.45 finally did increase the archive version to 8 it didn't introduce any other changes in the way it writes binary archives. I also searched the rest of the serialization code for some other places where there are checks for an archive version of 8 in some way but didn't find anything. (Even if I really overlooked something it would only lead to version 1.44 binary archives not working and a later patch could fix this by adding another variable to differentiate between 1.43 and 1.44.) </p> <p> The patch is against the current trunk. I did some tests with various archives from 1.34-1.46.1 and ran the regression tests. Please test and review this patch. If it is applied the documentation also has to be updated. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Robert Ramey</dc:creator> <pubDate>Tue, 26 Feb 2013 18:20:00 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4660#comment:53 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4660#comment:53</guid> <description> <p> a) in the course of this, did you come up with any tests which can add to the test suite to test backward capability? I would like to consider adding such tasks to the test suite. </p> <p> b) How would the documentation have to be changed? </p> <p> Robert Ramey </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Tue, 26 Feb 2013 19:20:27 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4660#comment:54 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4660#comment:54</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/4660#comment:53" title="Comment 53">ramey</a>: </p> <blockquote class="citation"> <p> a) in the course of this, did you come up with any tests which can add to the test suite to test backward capability? I would like to consider adding such tasks to the test suite. </p> </blockquote> <p> First I created a simple test app that would write a binary archive. It contained just one class for now. Then I compiled it with every boost version from 1.34 - 1-46.1 to get some test data and to debug what exactly gets written. When I had the patch ready I created another small test app that tries to read the archives back. I think this could be turned into a simple test that checks compatibility with a defined set of binary archives from different versions. I don't have access to the code right now but I can provide it. I'm not familiar with the boost regression tests yet (well, I can run them). If you wan't me to I can try to add some tests myself and add them in another patch. </p> <blockquote class="citation"> <p> b) How would the documentation have to be changed? </p> </blockquote> <p> As far as I can see the release notes are wrong about several things. The version that started to break something was 1.44. There is also some text about a fix-six utility that changes archive version to from 7 to 6. The reference to this utility should be removed. It shouldn't be required anymore. </p> <p> My fix detects archives written by version 1.44 that have an archive version of 7 and increases it to 8. I think it is possible that binary archives are being used without a header. In this mode the user has to provide the right archive number by calling set_library_version, right? So the documentation should mention that when reading back archives from 1.44 the user should manually set archive version 8. </p> <p> I also found a problem report that mentions another compatibility issue with binary archives that is independent from the one my patch addresses. <a class="ext-link" href="https://svn.boost.org/trac/boost/ticket/5579"><span class="icon">​</span>https://svn.boost.org/trac/boost/ticket/5579</a> </p> <p> This only affects people that split serialization across multiple dlls. I don't think this problem should be fixed in the way the user suggests there though. The solution adds more complexity and cannot work 100% without the user knowing which boost serialization version was really used. But IMHO it should be mentioned in the release notes that there is an issue with a link to the track item. This way users that have this problem can go there and find the patch. </p> </description> <category>Ticket</category> </item> <item> <author>markus.henschel@…</author> <pubDate>Wed, 27 Feb 2013 08:48:44 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4660#comment:55 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4660#comment:55</guid> <description> <p> The anonymous post above was mine. Forgot to login. </p> </description> <category>Ticket</category> </item> <item> <author>joao@…</author> <pubDate>Fri, 01 Mar 2013 16:20:44 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4660#comment:56 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4660#comment:56</guid> <description> <p> This patch does not fix all the binary compatibility problems. I have a file serialized with 1.35.1 that cannot be read by 1.53 when it is in binary format. Converting that file to text (compressed or not) allows the serialization to correctly read it. The file is too large to attach here, but you can contact me if a copy would be helpful. </p> </description> <category>Ticket</category> </item> <item> <author>markus.henschel@…</author> <pubDate>Fri, 01 Mar 2013 16:30:46 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4660#comment:57 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4660#comment:57</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/4660#comment:56" title="Comment 56">joao@…</a>: </p> <blockquote class="citation"> <p> This patch does not fix all the binary compatibility problems. I have a file serialized with 1.35.1 that cannot be read by 1.53 when it is in binary format. Converting that file to text (compressed or not) allows the serialization to correctly read it. The file is too large to attach here, but you can contact me if a copy would be helpful. </p> </blockquote> <p> Just to be sure: This patch is not in 1.53 yet. Did you apply it yourself and build boost from source? </p> <p> I'm not aware of a 1.35.1 release. Was that a typo? </p> <p> Otherwise I would appreciate getting the data as text and binary. i think it would also help to get the sources if possible. Can you upload to some share hoster like rapidshare? </p> </description> <category>Ticket</category> </item> <item> <author>joao@…</author> <pubDate>Fri, 01 Mar 2013 16:46:18 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4660#comment:58 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4660#comment:58</guid> <description> <p> Sorry, typo; the earlier release was 1.34.1. And yes, both version of Boost built from source and I applied the proposed patch manually to our 1.53 source tree. The binary file is 33Mb, compressed text is 59Mb, compressed XML is 82Mb. Note also that the reading problem applies to both binary &amp; xml files. Only the text version reads correctly in the 1.53 release (with or without the patch). Currently working through the clearance procedures at my company to see if I can release this data and/or spend the time to create a simplified version that duplicates the same issue. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Fri, 01 Mar 2013 17:05:58 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4660#comment:59 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4660#comment:59</guid> <description> <p> The last patch just handles issues of binary archives. If your xml archives also have a problem this might be a different bug. Do you split serialization across multiple libraries? In that case this might be this bug: <a class="ext-link" href="https://svn.boost.org/trac/boost/ticket/5579"><span class="icon">​</span>https://svn.boost.org/trac/boost/ticket/5579</a> </p> <p> It would be preferable if you could make the repro case as small as possible. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Robert Ramey</dc:creator> <pubDate>Fri, 01 Mar 2013 18:32:38 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4660#comment:60 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4660#comment:60</guid> <description> <blockquote class="citation"> <p> Note also that the reading problem applies to both binary &amp; xml files. Only the text version reads correctly in the 1.53 release (with or without the patch). Currently working through the clearance procedures at my company to see if I can release this data and/or spend the time to create a simplified version that duplicates the same issue. </p> </blockquote> <p> Note that this whole issue is related to native binary archives. </p> <p> If you've got problem which shows up in other archive types as well, that it's got to be a different problem. Upside, any xml problem should be easy to track down since it's easy to read the archive file. Also xml archives check that the beginning/end tags match and throw an exception when they don't. </p> <p> Robert Ramey </p> </description> <category>Ticket</category> </item> <item> <author>Joao Geada <joao@…></author> <pubDate>Fri, 01 Mar 2013 18:59:13 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/4660 https://svn.boost.org/trac10/ticket/4660 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">problem_1_34_1_serialized_file.tar.gz</span> </li> </ul> <p> Serialized files (txt, binary, xml) that can be read by 1.34.1 but only the txt file can be read in by 1.53 </p> Ticket Joao Geada <joao@…> Fri, 01 Mar 2013 19:02:33 GMT <link>https://svn.boost.org/trac10/ticket/4660#comment:61 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4660#comment:61</guid> <description> <p> OK, got permission to share our data. As per attachment above, the tar.gz file contains the same data serialized by 1_34.1 in several different ways: compressed binary, text, xml. Only the txt version of the file is readable by 1.53; If the txt file is read into 1.53 and the re-generated as binary from that version, 1.53 can read its own binary version correctly. However, 1.53 can't read back in its own XML format. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Mon, 04 Mar 2013 09:21:42 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4660#comment:62 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4660#comment:62</guid> <description> <p> Hi, </p> <p> could you please file a separate bug report? This really doesn't belong here and confuses people that search for solutions to problems with binary archives only. And if you do so I would suggest you add some more information. It would be best to have sources that read back these archives. Otherwise the least thing you could do is exactly say where the deserialization process fails. IMHO you should do some debugging first. Like Robert Ramey said before it shouldn't be that hard to find the place where the loading process starts to fail with xml archives. </p> <p> Please note that I'm not the maintainer - Robert Ramey is. I just replied because I initially thought you found a problem with the patch I submitted. </p> </description> <category>Ticket</category> </item> <item> <author>markus.henschel@…</author> <pubDate>Mon, 04 Mar 2013 09:24:15 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4660#comment:63 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4660#comment:63</guid> <description> <p> Post above has been written by me. Forgot to login (again). </p> </description> <category>Ticket</category> </item> <item> <author>Joao Geada <joao@…></author> <pubDate>Mon, 04 Mar 2013 16:24:39 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4660#comment:64 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4660#comment:64</guid> <description> <p> I'm stunned incredulous by the attitude displayed here Markus. </p> <p> I've contributed a testcase that shows that there is still a problem with the current version of boost serializer to read binary archives produced by an older version. This testcase was requested by Ramey, which I've spent time minimizing and clearing with my company to be allowed to share it with this team. In virtually every other open source project I'd be thanked for this and other people more expert with the code would dive in and diagnose what the real problem is etc etc. </p> <p> Instead here you <strong>complain</strong> for my having provided you a testcase??? </p> <p> And once again, let me be clear as to what exactly this testcase shows: </p> <p> 1) binary serialization written by 1.34.1 cannot be read by 1.53 </p> <p> 2) binary serialization written by 1.34.1 can be read by 1.34.1; likewise binary written by 1.53 can be read back by 1.53. I'd have thought it obvious that this should work, but as you'll see later, such an assumption is not legitimate in all cases. </p> <p> 3) text serialization written by 1.34.1 can be read by 1.34.1 and 1.53. Text archive written by 1.53 can also be read back by 1.53. </p> <p> 4) xml serialization written by 1.34.1 cannot be read by 1.53, but can be read back by 1.34.1. </p> <p> 5) xml serialization written 1.53 cannot be read back by 1.53!!! There goes that assumption that read/write within the same version and same backend format works. </p> <p> 6) the serialization code all lives in a single piece of code, runs in Linux 64bit; the problem here does not appear in any way related to bug 5579. But I'm not deeply familiar with the boost serializer code so I could be wrong about that. </p> <p> Note that I work for a closed source company and cannot under any circumstances reveal any of the our code. </p> <p> Echoing similar sentiments elsewhere, I'm seriously starting to wonder if my team has made a major mistake in using and relying on this component. </p> </description> <category>Ticket</category> </item> <item> <author>markus.henschel@…</author> <pubDate>Mon, 04 Mar 2013 17:12:41 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4660#comment:65 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4660#comment:65</guid> <description> <p> I'm not complaining about you providing a test case. I was just asking you to create a separate bug report because your bug actually seems to differ from the one discussed here (although there is some overlap). I also think that it's quite hard to find a problem if you just have the data without the code. But this is just my personal opinion. I'm just a user of boost serialization as you are. Please do not make your opinion about boost serialization depend on my posts. As I said: I'm not the maintainer and I do not represent boost serialization. Simply wait for Robert Ramey's response. </p> <p> PS: I'm not a native speaker. So if it's some wording in my post that made you upset I apologize. Sometimes it's hard to hit the right tone. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Sat, 09 Nov 2013 08:33:12 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4660#comment:66 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4660#comment:66</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/4660#comment:64" title="Comment 64">Joao Geada &lt;joao@…&gt;</a>: </p> <blockquote class="citation"> <p> Echoing similar sentiments elsewhere, I'm seriously starting to wonder if my team has made a major mistake in using and relying on this component. </p> </blockquote> <p> YES. </p> <p> My team has the same thoughts. Some time ago, we started our project with Boost 1.41, and we still can't even move to any newer version of Boost because of this bug. </p> <p> To everyone planning to use Boost.Serialization: don't trust this library. Choose something else, or just invent your own local data format. Save your time and nerves. </p> <p> Three years have passed and the bug is still not solved. It's a crying shame all this happens in such well-known and respected set of libraries like Boost is. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Robert Ramey</dc:creator> <pubDate>Sat, 09 Nov 2013 20:43:23 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4660#comment:67 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4660#comment:67</guid> <description> <p> I think I've answered these questions previously in the thread. Here is a summary </p> <p> a) This is a tricky problem to solve - it's it's solvable at all. I know this for a fact as I spent significant time trying to solve it and actually made things worse. Juast pasting in someone's patch might fix their problem but I can't know that ti will not break something else. </p> <p> b) What the serialization library needs is a comprehensive set of tests to verify loading of archives produced by previous versions. This is a large effort which no one has resources to undertake. </p> <p> c) If you want to move to a more recent of boost and preserve the data in one's previously written archives, I would recommend the following: </p> <p> i) Under your current version of boost, create a small program which reads your binary archive and write a text (or portable binary archive). ii) upgrade to a more recent version of boost iii) leave the archives as text or portable binary archive or make small program as in i) above which reads the portable and writes the (non-portable)binary ones. </p> <p> In the future, I will be much, much more careful about making changes to the binary_archive. If someone want's to commit resources to making a test suite to guarantee future binary portability, I would be willing to review it. That would likely be much less effort than making your own binary archive. </p> <p> Note that this problem could occur even if I had never made a mistake. An upgrade to 64 bit compiler from a 32 bit could present the exact same situation. The problem really has it's root in usage of the binary archive. This is indeed useful for MPI and applications like that, as it's the fastest - but it is the fastest at the expense of coupling the format to a specific machine architecture - not a great idea for permanent data storage. </p> <p> I do regret any inconvenience that my previous mistakes have caused, but this only makes less reluctant to commit changes without a lot of thought. Probably the most time I spend is finding problems cause by checkins by other people who don't really appreciate all that is involved in a library like this. Sometimes these changes get checked in even without being tested!!! </p> <p> Robert Ramey </p> </description> <category>Ticket</category> </item> <item> <author>Alex <kaplan2539@…></author> <pubDate>Mon, 10 Mar 2014 10:58:36 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4660#comment:68 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4660#comment:68</guid> <description> <p> Hi all, </p> <p> I understand the situation with the binary archives is tricky. However, we devices out in the wild which have configuration data written in a binary boost 1.43 archive on their eeprom. We changed our build environment from Visual Studio 2008 to 2012, which has also required a change from boost 1.43 to a newer version (1.54 in our case). Of course, we still need to support the old devices with our new software. </p> <p> So, I need to solve the following problems: </p> <ul><li>The new software (VS 2012) should be able to write binary boots archives which can still be read by our old software (VS 2008/boost 1.43). </li><li>The new software (VS 2012) should be able to read old binary archives written by boost 1.43. </li></ul><p> Is there any way I can achieve that? Unfortunately with Visual Studio 2012 I cannot link to boost 1.43 anymore. Is there sth. like a compatibility flag, so that boost 1.54 can write binary archives in the old boost 1.43 fashion? I happy for any useful hints or comments. </p> <p> Thanks in advance </p> <p> Alex </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Robert Ramey</dc:creator> <pubDate>Mon, 10 Mar 2014 21:09:13 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4660#comment:69 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4660#comment:69</guid> <description> <p> First of all, this thread deals with a different subject. That is it tries to address a problem whereby I introduced an incompatibility in binary_archives and we've had trouble getting over it. If you want to pursue this, you should create a new trac item. </p> <p> "So, I need to solve the following problems:" </p> <p> "The new software (VS 2012) should be able to write binary boots archives which can still be read by our old software (VS 2008/boost 1.43)." </p> <p> I don't see why you can't using the 1.43 version of serialization with vc 2012 </p> <p> "The new software (VS 2012) should be able to read old binary archives written by boost 1.43." </p> <p> This should be handled using the standard versioning available in all versions of the library. </p> <p> Robert Ramey </p> </description> <category>Ticket</category> </item> </channel> </rss>