Boost C++ Libraries: Ticket #12141: XML serialization broken https://svn.boost.org/trac10/ticket/12141 <p> The Boost 1.61.0 beta1 version of serialization has a breaking regression that changes the XML closing tag to <code>&amp;lt;/boost_serialization&amp;gt;</code> rather than <code>&lt;/boost_serialization&gt;</code>. </p> <p> Example code: </p> <div class="wiki-code"><div class="code"><pre><span class="cp">#include</span> <span class="cpf">&lt;boost/archive/xml_oarchive.hpp&gt;</span><span class="cp"></span> <span class="cp">#include</span> <span class="cpf">&lt;boost/serialization/nvp.hpp&gt;</span><span class="cp"></span> <span class="cp">#include</span> <span class="cpf">&lt;iostream&gt;</span><span class="cp"></span> <span class="kt">int</span> <span class="nf">main</span><span class="p">()</span> <span class="p">{</span> <span class="n">boost</span><span class="o">::</span><span class="n">archive</span><span class="o">::</span><span class="n">xml_oarchive</span> <span class="n">oa</span><span class="p">(</span> <span class="n">std</span><span class="o">::</span><span class="n">cerr</span> <span class="p">);</span> <span class="kt">int</span> <span class="n">bob</span> <span class="o">=</span> <span class="mi">3</span><span class="p">;</span> <span class="n">oa</span> <span class="o">&lt;&lt;</span> <span class="n">boost</span><span class="o">::</span><span class="n">serialization</span><span class="o">::</span><span class="n">make_nvp</span><span class="p">(</span> <span class="s">&quot;bob&quot;</span><span class="p">,</span> <span class="n">bob</span> <span class="p">);</span> <span class="p">}</span> </pre></div></div><p> Compiling and running with these commands: </p> <pre class="wiki"> setenv LD_LIBRARY_PATH /opt/boost_1_60_0_gcc_build/lib:/opt/boost_1_61_0_b1_gcc_build/lib g++ ser_regn.cpp -isystem /opt/boost_1_60_0_gcc_build/include -L/opt/boost_1_60_0_gcc_build/lib -l boost_serialization-mt -o ser_regn.1_60_0 g++ ser_regn.cpp -isystem /opt/boost_1_61_0_b1_gcc_build/include -L/opt/boost_1_61_0_b1_gcc_build/lib -l boost_serialization-mt -o ser_regn.1_61_0_b1 ./ser_regn.1_60_0 ./ser_regn.1_61_0_b1 </pre><p> The 1_60_0 version gives: </p> <pre class="wiki">&lt;?xml version="1.0" encoding="UTF-8" standalone="yes" ?&gt; &lt;!DOCTYPE boost_serialization&gt; &lt;boost_serialization signature="serialization::archive" version="14"&gt; &lt;bob&gt;3&lt;/bob&gt; &lt;/boost_serialization&gt; </pre><p> The 1_61_0_b1 version gives: </p> <pre class="wiki">&lt;?xml version="1.0" encoding="UTF-8" standalone="yes" ?&gt; &lt;!DOCTYPE boost_serialization&gt; &lt;boost_serialization signature="serialization::archive" version="14"&gt; &lt;bob&gt;3&lt;/bob&gt; &amp;lt;/boost_serialization&amp;gt; </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/12141 Trac 1.4.3 Robert Ramey Wed, 20 Apr 2016 18:30:43 GMT <link>https://svn.boost.org/trac10/ticket/12141#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12141#comment:1</guid> <description> <p> what compiler, platform, etc. can reproduce this? </p> </description> <category>Ticket</category> </item> <item> <author>Tony Lewis <tonyelewis@…></author> <pubDate>Wed, 20 Apr 2016 19:41:51 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12141#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12141#comment:2</guid> <description> <p> I'm seeing this on both: </p> <pre class="wiki">g++ (Ubuntu 5.2.1-22ubuntu2) 5.2.1 20151010 GNU libstdc++ version 20151010 </pre><p> ...and: </p> <pre class="wiki">Ubuntu clang version 3.6.2-1 (tags/RELEASE_362/final) (based on LLVM 3.6.2) libc++ version 1101 </pre><p> Both are running on: </p> <pre class="wiki">Ubuntu 15.10 Linux 4.2.0-35-generic #40-Ubuntu SMP Tue Mar 15 22:15:45 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>Robert Ramey</dc:creator> <pubDate>Thu, 21 Apr 2016 22:14:08 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/12141#comment:3 https://svn.boost.org/trac10/ticket/12141#comment:3 <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> <p> Wow - my tests didn't detect this. I've made the change and tested on my own system and uploaded it to boost. Early tomorrow I'll ask permission to merge into master so it can be included in to the official release of 1.61. I don't know if they'll accept it though. </p> Ticket anonymous Fri, 22 Apr 2016 08:41:09 GMT <link>https://svn.boost.org/trac10/ticket/12141#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12141#comment:4</guid> <description> <p> Great stuff. Thanks very much for addressing this so quickly. Yes - definitely worth getting this test case into the suite. </p> <p> I think this has got to be a good candidate for them allowing a merge because I'd estimate the cost of keeping this error in would easily outweigh the expected cost of possible problems caused by the change. </p> <p> Thanks again. </p> </description> <category>Ticket</category> </item> <item> <author>mark.incley@…</author> <pubDate>Thu, 01 Sep 2016 13:26:04 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12141#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12141#comment:5</guid> <description> <p> Hi. Using Boost 1.62 Beta 1 and Visual Studio 2015 Update 3, I'm still seeing the exact same issue reported by Colin here: <a class="ext-link" href="http://lists.boost.org/boost-users/2016/06/86317.php"><span class="icon">​</span>http://lists.boost.org/boost-users/2016/06/86317.php</a> </p> <p> i.e. the xml file ending with: </p> <pre class="wiki">&lt;/boost_serialization&gt; &amp;lt;/boost_serialization&amp;gt; </pre><p> </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Mon, 26 Sep 2016 08:57:42 GMT</pubDate> <title>status changed; resolution deleted https://svn.boost.org/trac10/ticket/12141#comment:6 https://svn.boost.org/trac10/ticket/12141#comment:6 <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> Ticket mark.incley@… Mon, 26 Sep 2016 09:34:52 GMT <link>https://svn.boost.org/trac10/ticket/12141#comment:7 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12141#comment:7</guid> <description> <p> The problem still in Boost 1.62 Beta 1 (and Beta 2) only occurs with the wide XML archiver (xml_woarchive) and not the narrow one (xml_oarchive), and seems to be due to the difference in behaviour (other than char types) between: </p> <pre class="wiki">xml_oarchive_impl&lt;Archive&gt;::save(const char * s) </pre><p> and </p> <pre class="wiki">xml_woarchive_impl&lt;Archive&gt;::save(const wchar_t * ws) </pre><p> Mark. </p> </description> <category>Ticket</category> </item> <item> <author>frank.richter@…</author> <pubDate>Thu, 03 Aug 2017 07:44:03 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/12141 https://svn.boost.org/trac10/ticket/12141 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">xml_woarchive_impl.diff</span> </li> </ul> <p> Patch to fix xml_woarchive writing after last tag </p> Ticket frank.richter@… Thu, 03 Aug 2017 07:44:34 GMT <link>https://svn.boost.org/trac10/ticket/12141#comment:8 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12141#comment:8</guid> <description> <p> Attached patch fixes it for me. </p> </description> <category>Ticket</category> </item> <item> <author>Brian Martin <brian.codemonkey@…></author> <pubDate>Wed, 08 Nov 2017 16:40:52 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12141#comment:9 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12141#comment:9</guid> <description> <p> Is this still open or been fixed? I'm using boost 1.65 and I'm getting an extra closing tag of &amp;lt;/boost_serialization&amp;gt; at the end of the file. It only does this for xml_woarchive, the narrow archive is fine. </p> <p> Brian </p> </description> <category>Ticket</category> </item> </channel> </rss>