id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 8164,basic_text_iprimitive loads garbage instead of throwing,Louis Dionne ,Robert Ramey,"Hi, When loading several objects from a text_iarchive, one can load one too many object without the archive throwing an exception. In such case, the last object loaded will contain garbage. If one tries to load yet another object, then an exception is thrown. Here is a minimal working example to show the issue: {{{ #include #include #include #include int main() { std::stringstream ss; { boost::archive::text_oarchive oarchive(ss); char a = 'a', b = 'b'; oarchive << a << b; } std::cout << ""saved: \"""" << ss.str() << ""\""\n""; { boost::archive::text_iarchive iarchive(ss); char a, b, garbage, will_fail; iarchive >> a; std::cout << ""happily loaded a:\"""" << a << ""\""\n""; iarchive >> b; std::cout << ""happily loaded b:\"""" << b << ""\""\n""; iarchive >> garbage; std::cout << ""happily loaded garbage:\"""" << garbage << ""\""\n""; try { iarchive >> will_fail; } catch (std::exception const& e) { std::cout << e.what(); throw; } } } }}} Attached is a patch that seems to fix the problem (and removes some trailing white spaces from the sources). I also ran all of Boost.Serialization's unit tests with the fix and everything passes except for test_array_xml_warchive, which fails with something weird and probably unrelated. Regards, Louis Dionne",Bugs,closed,To Be Determined,serialization,Boost 1.53.0,Problem,duplicate,serialization archive_exception input_stream_error,