Boost logo

Boost Users :

Subject: Re: [Boost-users] problem of deserializing from a xml file
From: Gavin Lambert (gavinl_at_[hidden])
Date: 2015-07-29 22:34:51


On 30/07/2015 14:21, breadbread1984 wrote:
> I am having problem deserializing from a file of a serialized object. An
> exception of input stream error always occurs. The class of the object
> is pasted [here](http://pastebin.com/6XEBybWV). The xml file is pasted
> [here](http://pastebin.com/e2Ka2kVH). I tried debugging the program. The
> top few frames of the back trace of the exception is as follows
>
> #0 0x00007f8f9be4c267 in __GI_raise (sig=sig_at_entry=6) at
> ../sysdeps/unix/sysv/linux/raise.c:55
> #1 0x00007f8f9be4deca in __GI_abort () at abort.c:89
> #2 0x00007f8f9c76006d in
> __gnu_cxx::__verbose_terminate_handler() () from
> /usr/lib/x86_64-linux-gnu/libstdc++.so.6
> #3 0x00007f8f9c75dee6 in ?? () from
> /usr/lib/x86_64-linux-gnu/libstdc++.so.6 #4 0x00007f8f9c75df31 in
> std::terminate() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
> #5
> 0x00007f8f9c75e149 in __cxa_throw () from
> /usr/lib/x86_64-linux-gnu/libstdc++.so.6
> #6 0x00007f8f9e661734 in void
> boost::serialization::throw_exception<boost::archive::archive_exception>(boost::archive::archive_exception
> const&) () from
> /usr/lib/x86_64-linux-gnu/libboost_serialization.so.1.55.0 #7
> 0x00007f8f9e67e2f7 in
> boost::archive::basic_xml_iarchive<boost::archive::xml_iarchive>::load_start(char
> const*) () from
> /usr/lib/x86_64-linux-gnu/libboost_serialization.so.1.55.0 #8
> 0x0000000000486ab4 in
> boost::archive::basic_xml_iarchive<boost::archive::xml_iarchive>::load_override<std::map<int,
> std::deque<Observation, std::allocator<Observation> >, std::less<int>,
> std::allocator<std::pair<int const, std::deque<Observation,
> std::allocator<Observation> > > > > > (this=0x7ffe12327440, t=...)
> at
> /usr/include/boost/archive/basic_xml_iarchive.hpp:85
>
> It seems the problem occurs when the std::map<int,
> std::deque<Observation, std::allocator<Observation> > in Status is
> loaded. I can't step into frame #7 to checkout the detail of the
> exception. Could anyone give a hint of the problem. Thanks!

Terminate is being called because you're not catching the exception. If
you wrap a try/catch around it and examine the caught exception, you may
get more details about what went wrong.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net