Boost logo

Boost Users :

Subject: Re: [Boost-users] binary serialization, what's missing
From: Avi Bahra (avibahra_at_[hidden])
Date: 2009-11-25 12:36:53


Reproduced the crash with binary serialization.

Program received signal SIGSEGV, Segmentation fault.
#0 0x08082c1f in boost::archive::detail::basic_oarchive_impl::save_pointer
()
#1 0x08081f16 in boost::archive::detail::basic_oarchive::save_pointer ()
#2 0x08076ad8 in
boost::archive::detail::save_pointer_type<boost::archive::binary_oarchive,
RepeatBase*>::polymorphic<RepeatBase>::save (ar=@0xbfd58428, t=@0x80bbd38)
at /var/tmp/ma0/boost/boost_1_39_0/boost/archive/detail/oserializer.hpp:408
#3 0x08076b04 in
boost::archive::detail::save_pointer_type<boost::archive::binary_oarchive,
RepeatBase*>::save<RepeatBase> (ar=@0xbfd58428, t=@0x80bbd38) at
/var/tmp/ma0/boost/boost_1_39_0/boost/archive/detail/oserializer.hpp:428
#4 0x08076b6c in
boost::archive::detail::save_pointer_type<boost::archive::binary_oarchive,
RepeatBase*>::invoke (ar=@0xbfd58428, t=0x80bbd38) at
/var/tmp/ma0/boost/boost_1_39_0/boost/archive/detail/oserializer.hpp:457
#5 0x08076b98 in boost::archive::save<boost::archive::binary_oarchive,
RepeatBase*> (ar=@0xbfd58428, t=@0x80b9738) at
/var/tmp/ma0/boost/boost_1_39_0/boost/archive/detail/oserializer.hpp:506
#6 0x08076bcc in
boost::archive::detail::common_oarchive<boost::archive::binary_oarchive>::save_override<RepeatBase*
const> (this=0xbfd58428, t=@0x80b9738) at
/var/tmp/ma0/boost/boost_1_39_0/boost/archive/detail/common_oarchive.hpp:64
#7 0x08076bfd in
boost::archive::basic_binary_oarchive<boost::archive::binary_oarchive>::save_override<RepeatBase*>
(this=0xbfd58428,
....

In doing this I have noted.
   o creating small trivial cases seemed to work.
   o when I combined the test case files to a single file, it worked

In trying to create the test case I figured out what caused the crash,
Basically I had included text archive in all the compilation units
but the binary archive _only_ in the file where I was outputting to
the disk. When I included the binary archive in _all_ the compilation
units that were being serialized, the test worked.

I am not sure how common this case is, but gcc compiler/linker gave no
warnings
Maybe this need to be added as a gotcha in the documentation?

  Best regards,
Ta,
   Avi



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