Boost C++ Libraries: Ticket #7498: archive::binary_iarchive failure loading map<string,string> https://svn.boost.org/trac10/ticket/7498 <p> I create two std::map&lt;std::string, std::string&gt; instances, one of which having two dozen contents, the other default-initialized. I serialize the former using boost::archive::binary_oarchive and load it into the latter using boost::archive::binary_iarchive. </p> <pre class="wiki">// This Win32-specific test creates a std::map from strings to strings and // then serializes it to a file. We then attempt to desearialize from that // file. On boost_1_45_0 and boost_1_51_0 for Win32 this testcase fails on // our company's secondary build machine. </pre><pre class="wiki">/* At the top of the call stack (see attachment for context), std::streamsize s = static_cast&lt;std::streamsize&gt;(count / sizeof(Elem)); std::streamsize scount = m_sb.sgetn( static_cast&lt;Elem *&gt;(address), s ); if(scount != s) boost::serialization::throw_exception( archive_exception(archive_exception::input_stream_error) ); `scount` is 0, `s` is 8. It's trying to load a size_type, presumably for a string length or a map length. */ </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/7498 Trac 1.4.3 anonymous Thu, 11 Oct 2012 20:31:58 GMT attachment set https://svn.boost.org/trac10/ticket/7498 https://svn.boost.org/trac10/ticket/7498 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">test_binary_archive_with_map.cpp</span> </li> </ul> Ticket kaedenn@… Thu, 11 Oct 2012 22:04:53 GMT severity changed https://svn.boost.org/trac10/ticket/7498#comment:1 https://svn.boost.org/trac10/ticket/7498#comment:1 <ul> <li><strong>severity</strong> <span class="trac-field-old">Showstopper</span> → <span class="trac-field-new">Problem</span> </li> </ul> Ticket anonymous Thu, 11 Oct 2012 22:05:20 GMT <link>https://svn.boost.org/trac10/ticket/7498#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7498#comment:2</guid> <description> <p> Opening the streams with std::ios::binary fixes the problem. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Robert Ramey</dc:creator> <pubDate>Sun, 21 Oct 2012 16:49:00 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/7498#comment:3 https://svn.boost.org/trac10/ticket/7498#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">invalid</span> </li> </ul> <p> Basically it's a user error. I concede that it's something I would like to see detected automatically, but I've never figured out a way to do this. Sorry about this. </p> <p> Robert Ramey </p> Ticket