Wednesday, 11 November 2009

Boost Serialization, Segmentation fault, load_preamble()




I was working on a part of a program that did not seem to affect the serialization parts. However, when I went to load a data file I got the following error message:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb684a6c0 (LWP 22331)]
0xb7cdb714 in boost::archive::detail::basic_iarchive_impl::load_preamble () from /usr/lib/libboost_serialization-gcc42-1_34_1.so.1.34.1

I could create a new data file and load that. I just couldn't load a data file that I created before I made some changes to the program. After a quite a lengthy period of debugging, I found the cause.

One of the changes I had made was to change a concrete base class into an abstract base class. When I changed back to a concrete base class, the error did not occur again.

This took me ages to figure out. I hope this eventually helps someone out there.

No comments:

Post a Comment