Serialization segfaulting

Hi, I'm having problems with boost serialization library. There are two cases in which it is segfaulting on me. One is during a register_type() call, but we can discuss that one later. Another one which I am trying to debug right now is when I am trying to serialize a large binary tree (lots of pointers all over the place, sometimes pointing at themselves, sometimes at 0, sometimes jumping all over the tree). I am not quite sure how to approach the debugging of this issue since for some reason I am not able to step into the boost serialization routines themselves (but I'm not so good with the debugger). The actual segfault as given by DDD is: Program received signal SIGSEGV, Segmentation fault. 0x40075b75 in std::_Rb_tree<boost::archive::detail::basic_oarchive_impl::cobject_type, boost::archive::detail::basic_oarchive_impl::cobject_type, std::_Identity<boost::archive::detail::basic_oarchive_impl::cobject_type>, std::less<boost::archive::detail::basic_oarchive_impl::cobject_type>, std::allocator<boost::archive::detail::basic_oarchive_impl::cobject_type>
::insert_unique(boost::archive::detail::basic_oarchive_impl::cobject_type const&) () from /usr/lib/libboost_serialization.so.1.33.0
Any advice is appreciated. Best, Dmitriy P.S. On a completely unrelated note, when the abstract base class is a template, the BOOST_IS_ABSTRACT macro is not applicable. It would be helpful if the documentation listed the chunk of code that needs to be added in that case. It's pretty easy to find it in the header files (is_abstract.hpp), but it may be helpful to just list it.

It would be interesting to know what compiler you are using. In order to help we need a smaller piece of code that fails. We have found and corrected on error in the 1.33.1 release candidate that might account for this. You could check that by trying the RC_1_33_0 branch. Robert Ramey Dmitriy Morozov wrote:
Hi,
I'm having problems with boost serialization library.
There are two cases in which it is segfaulting on me. One is during a register_type() call, but we can discuss that one later. Another one which I am trying to debug right now is when I am trying to serialize a large binary tree (lots of pointers all over the place, sometimes pointing at themselves, sometimes at 0, sometimes jumping all over the tree). I am not quite sure how to approach the debugging of this issue since for some reason I am not able to step into the boost serialization routines themselves (but I'm not so good with the debugger). The actual segfault as given by DDD is:
Program received signal SIGSEGV, Segmentation fault. 0x40075b75 in std::_Rb_tree<boost::archive::detail::basic_oarchive_impl::cobject_type, boost::archive::detail::basic_oarchive_impl::cobject_type, std::_Identity<boost::archive::detail::basic_oarchive_impl::cobject_type>, std::less<boost::archive::detail::basic_oarchive_impl::cobject_type>, std::allocator<boost::archive::detail::basic_oarchive_impl::cobject_type>
insert_unique(boost::archive::detail::basic_oarchive_impl::cobject_type const&) () from /usr/lib/libboost_serialization.so.1.33.0
Any advice is appreciated.
Best, Dmitriy
P.S. On a completely unrelated note, when the abstract base class is a template, the BOOST_IS_ABSTRACT macro is not applicable. It would be helpful if the documentation listed the chunk of code that needs to be added in that case. It's pretty easy to find it in the header files (is_abstract.hpp), but it may be helpful to just list it.

It would be interesting to know what compiler you are using.
g++ (GCC) 3.4.4 (Gentoo 3.4.4, ssp-3.4.4-1.0, pie-8.7.8)
In order to help we need a smaller piece of code that fails.
I realize that, unfortunately I suspect that's not so easy. Since it's a segfault (that occurs after processing a large number of the nodes in the tree), the precise configuration is important. The particular tree is a result of a non-trivial computation. I will try to narrow things down over the weekend, but to be honest I am not very hopeful.
We have found and corrected on error in the 1.33.1 release candidate that might account for this. You could check that by trying the RC_1_33_0 branch.
Is it downloadable, or do I need to check it out of CVS? I will definitely give it a try. Thanks. Dmitriy

In order to help we need a smaller piece of code that fails.
I tried to create a smaller piece of code by producing a smaller tree by hand that causes the same problem, but I can't. It doesn't segfault on the hand-made trees.
We have found and corrected on error in the 1.33.1 release candidate that might account for this. You could check that by trying the RC_1_33_0 branch.
I checked Boost out of CVS. I don't know which branch that would be, but the problem remains. Best, Dmitriy
participants (2)
-
Dmitriy Morozov
-
Robert Ramey