Boost logo

Boost :

Subject: [boost] crash in boost serialization 1.41
From: Est (esteban_at_[hidden])
Date: 2010-01-30 09:14:32


Hi All

I'm developing an image processing app.

In my app, I serialize a boost::ptr_vector of an abstract base class to
a polymorphic xml archive. I checked all my polymorphic classes are
exported with BOOST_SERIALIZATION_EXPORT and
BOOST_SERIALIZATION_ASSUME_ABSTRACT for abstract classes, and it's
working correctly with boost 1.38.

If I update to boost 1.41, I can save archives without problems.
When I try to load the resulting archive, I get a crash:

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x00000000
boost::archive::detail::basic_iarchive_impl::load_pointer
(this=0x1b955a00, ar=@0xbfffe598, t=@0xbfffd8d0, bpis_ptr=0x0) at
libs/serialization/src/basic_iarchive.cpp:429
429 class_id_type new_cid = register_type(bpis_ptr->get_basic_serializer());

I can read the archive with my app compiled with boost 1.38.

I'm using gcc 4.0.1 on OSX and gcc 4.3 on linux, all 32 bits.
I'm not using DLLs.

I ran the unit tests of the serialization library. All passed.

I'm in the process of extracting a small example that reproduces the crash.

Do you have any idea how can I fix it?

Thank you.

Est.

Here is the backtrace:

node_t is my abstract base class.

#0 boost::archive::detail::basic_iarchive_impl::load_pointer
(this=0x1b955a00, ar=@0xbfffe598, t=@0xbfffd8d0, bpis_ptr=0x0) at
libs/serialization/src/basic_iarchive.cpp:429
#1 0x005a5506 in boost::archive::detail::basic_iarchive::load_pointer
(this=0x0, t=@0x0, bpis_ptr=0x0) at
libs/serialization/src/basic_iarchive.cpp:538
#2 0x00043f2e in
boost::archive::detail::polymorphic_iarchive_route<boost::archive::naked_xml_iarchive>::load_pointer
(this=0xbfffe58c, t=@0xbfffd8d0, bpis_ptr=0x0) at
polymorphic_iarchive_route.hpp:65
#3 0x0003d0f9 in
boost::archive::detail::load_pointer_type<boost::archive::polymorphic_iarchive>::invoke<ramen::node_t*>
(ar=@0xbfffe58c, t=@0xbfffd8d0) at iserializer.hpp:486
#4 0x0003d157 in
boost::archive::load<boost::archive::polymorphic_iarchive,
ramen::node_t*> (ar=@0xbfffe58c, t=@0xbfffd8d0) at iserializer.hpp:554
#5 0x0003d1a6 in
boost::archive::polymorphic_iarchive_impl::load_override<ramen::node_t*>
(this=0xbfffe58c, t=@0xbfffd8d4) at polymorphic_iarchive.hpp:137
#6 0x0003d1f8 in
boost::archive::detail::interface_iarchive<boost::archive::polymorphic_iarchive>::operator>><boost::serialization::nvp<ramen::node_t*>
const> (this=0xbfffe58c, t=@0xbfffd8d4) at interface_iarchive.hpp:61
#7 0x0003d253 in
boost::ptr_container_detail::load_helper<boost::archive::polymorphic_iarchive,
boost::ptr_container_detail::sequence_config<ramen::node_t,
std::vector<void*, std::allocator<void*> > >,
boost::heap_clone_allocator> (ar=@0xbfffe58c, c=@0x193b1bd8, n=1) at
detail/serialize_reversible_cont.hpp:52
#8 0x0003d2e9 in
boost::serialization::load<boost::archive::polymorphic_iarchive,
ramen::node_t, boost::heap_clone_allocator, std::allocator<void*> >
(ar=@0xbfffe58c, c=@0x193b1bd8) at serialize_ptr_vector.hpp:28
#9 0x0003d327 in
boost::serialization::free_loader<boost::archive::polymorphic_iarchive,
boost::ptr_vector<ramen::node_t, boost::heap_clone_allocator,
std::allocator<void*> > >::invoke (ar=@0xbfffe58c, t=@0x193b1bd8,
file_version=0) at split_free.hpp:58
#10 0x0003d349 in
boost::serialization::split_free<boost::archive::polymorphic_iarchive,
boost::ptr_vector<ramen::node_t, boost::heap_clone_allocator,
std::allocator<void*> > > (ar=@0xbfffe58c, t=@0x193b1bd8,
file_version=0) at split_free.hpp:74
#11 0x0003d36b in
boost::serialization::serialize<boost::archive::polymorphic_iarchive,
ramen::node_t, boost::heap_clone_allocator, std::allocator<void*> >
(ar=@0xbfffe58c, c=@0x193b1bd8, version=0) at serialize_ptr_vector.hpp:34
#12 0x0003d3a9 in
boost::serialization::serialize_adl<boost::archive::polymorphic_iarchive,
boost::ptr_vector<ramen::node_t, boost::heap_clone_allocator,
std::allocator<void*> > > (ar=@0xbfffe58c, t=@0x193b1bd8,
file_version=0) at serialization.hpp:133
#13 0x0003d456 in
boost::archive::detail::iserializer<boost::archive::polymorphic_iarchive,
boost::ptr_vector<ramen::node_t, boost::heap_clone_allocator,
std::allocator<void*> > >::load_object_data (this=0xbcc2f0,
ar=@0xbfffe598, x=0x193b1bd8, file_version=0) at iserializer.hpp:173
#14 0x005a5423 in boost::archive::object_id_type::operator= () at
basic_archive.hpp:390
#15 0x005a5423 in
boost::archive::detail::basic_iarchive_impl::load_object () at
libs/serialization/src/basic_iarchive.cpp:391
#16 0x005a5423 in boost::archive::detail::basic_iarchive::load_object
(this=0xbfffe598, t=0x193b1bd8, bis=@0xbcc2f0) at
libs/serialization/src/basic_iarchive.cpp:529
#17 0x00043f0a in
boost::archive::detail::polymorphic_iarchive_route<boost::archive::naked_xml_iarchive>::load_object
(this=0xbfffe58c, t=0x193b1bd8, bis=@0xbcc2f0) at
polymorphic_iarchive_route.hpp:59
#18 0x00039f93 in
boost::archive::detail::load_non_pointer_type<boost::archive::polymorphic_iarchive>::load_standard::invoke<boost::ptr_vector<ramen::node_t,
boost::heap_clone_allocator, std::allocator<void*> > > (ar=@0xbfffe58c,
t=@0x193b1bd8) at iserializer.hpp:363
#19 0x00039fbc in
boost::archive::detail::load_non_pointer_type<boost::archive::polymorphic_iarchive>::invoke<boost::ptr_vector<ramen::node_t,
boost::heap_clone_allocator, std::allocator<void*> > > (ar=@0xbfffe58c,
t=@0x193b1bd8) at iserializer.hpp:415
#20 0x00039fdb in
boost::archive::load<boost::archive::polymorphic_iarchive,
boost::ptr_vector<ramen::node_t, boost::heap_clone_allocator,
std::allocator<void*> > > (ar=@0xbfffe58c, t=@0x193b1bd8) at
iserializer.hpp:554
#21 0x0003a02a in
boost::archive::polymorphic_iarchive_impl::load_override<boost::ptr_vector<ramen::node_t,
boost::heap_clone_allocator, std::allocator<void*> > > (this=0xbfffe58c,
t=@0xbfffdbc4) at polymorphic_iarchive.hpp:137
#22 0x0003a07c in
boost::archive::detail::interface_iarchive<boost::archive::polymorphic_iarchive>::operator>><boost::serialization::nvp<boost::ptr_vector<ramen::node_t,
boost::heap_clone_allocator, std::allocator<void*> > > const>
(this=0xbfffe58c, t=@0xbfffdbc4) at interface_iarchive.hpp:61
#23 0x0003a0ac in
boost::archive::detail::interface_iarchive<boost::archive::polymorphic_iarchive>::operator&<boost::serialization::nvp<boost::ptr_vector<ramen::node_t,
boost::heap_clone_allocator, std::allocator<void*> > > const>
(this=0xbfffe58c, t=@0xbfffdbc4) at interface_iarchive.hpp:68
#24 0x0003aa49 in
ramen::dataflow::graph<ramen::node_t>::load<boost::archive::polymorphic_iarchive>
(this=0x193b1bd8, ar=@0xbfffe58c, version=0) at graph.hpp:168
#25 0x0003ab9b in
boost::serialization::access::member_load<boost::archive::polymorphic_iarchive,
ramen::dataflow::graph<ramen::node_t> > (ar=@0xbfffe58c, t=@0x193b1bd8,
file_version=0) at access.hpp:101
#26 0x0003abbd in
boost::serialization::detail::member_loader<boost::archive::polymorphic_iarchive,
ramen::dataflow::graph<ramen::node_t> >::invoke (ar=@0xbfffe58c,
t=@0x193b1bd8, file_version=0) at split_member.hpp:54
#27 0x0003abdf in
boost::serialization::split_member<boost::archive::polymorphic_iarchive,
ramen::dataflow::graph<ramen::node_t> > (ar=@0xbfffe58c, t=@0x193b1bd8,
file_version=0) at split_member.hpp:69
#28 0x0003ac01 in
ramen::dataflow::graph<ramen::node_t>::serialize<boost::archive::polymorphic_iarchive>
(this=0x193b1bd8, ar=@0xbfffe58c, file_version=0) at graph.hpp:175
#29 0x0003ac23 in
boost::serialization::access::serialize<boost::archive::polymorphic_iarchive,
ramen::dataflow::graph<ramen::node_t> > (ar=@0xbfffe58c, t=@0x193b1bd8,
file_version=0) at access.hpp:109
#30 0x0003ac45 in
boost::serialization::serialize<boost::archive::polymorphic_iarchive,
ramen::dataflow::graph<ramen::node_t> > (ar=@0xbfffe58c, t=@0x193b1bd8,
file_version=0) at serialization.hpp:74
#31 0x0003ac83 in
boost::serialization::serialize_adl<boost::archive::polymorphic_iarchive,
ramen::dataflow::graph<ramen::node_t> > (ar=@0xbfffe58c, t=@0x193b1bd8,
file_version=0) at serialization.hpp:133
#32 0x0003ad30 in
boost::archive::detail::iserializer<boost::archive::polymorphic_iarchive,
ramen::dataflow::graph<ramen::node_t> >::load_object_data
(this=0xbcc260, ar=@0xbfffe598, x=0x193b1bd8, file_version=0) at
iserializer.hpp:173
#33 0x005a5423 in boost::archive::object_id_type::operator= () at
basic_archive.hpp:390
#34 0x005a5423 in
boost::archive::detail::basic_iarchive_impl::load_object () at
libs/serialization/src/basic_iarchive.cpp:391
#35 0x005a5423 in boost::archive::detail::basic_iarchive::load_object
(this=0xbfffe598, t=0x193b1bd8, bis=@0xbcc260) at
libs/serialization/src/basic_iarchive.cpp:529
#36 0x00043f0a in
boost::archive::detail::polymorphic_iarchive_route<boost::archive::naked_xml_iarchive>::load_object
(this=0xbfffe58c, t=0x193b1bd8, bis=@0xbcc260) at
polymorphic_iarchive_route.hpp:59
#37 0x000365fb in
boost::archive::detail::load_non_pointer_type<boost::archive::polymorphic_iarchive>::load_standard::invoke<ramen::dataflow::graph<ramen::node_t>
> (ar=@0xbfffe58c, t=@0x193b1bd8) at iserializer.hpp:363
#38 0x00036624 in
boost::archive::detail::load_non_pointer_type<boost::archive::polymorphic_iarchive>::invoke<ramen::dataflow::graph<ramen::node_t>
> (ar=@0xbfffe58c, t=@0x193b1bd8) at iserializer.hpp:415
#39 0x00036643 in
boost::archive::load<boost::archive::polymorphic_iarchive,
ramen::dataflow::graph<ramen::node_t> > (ar=@0xbfffe58c, t=@0x193b1bd8)
at iserializer.hpp:554
#40 0x00036692 in
boost::archive::polymorphic_iarchive_impl::load_override<ramen::dataflow::graph<ramen::node_t>
> (this=0xbfffe58c, t=@0xbfffdf8c) at polymorphic_iarchive.hpp:137
#41 0x000366e4 in
boost::archive::detail::interface_iarchive<boost::archive::polymorphic_iarchive>::operator>><boost::serialization::nvp<ramen::dataflow::graph<ramen::node_t>
> const> (this=0xbfffe58c, t=@0xbfffdf8c) at interface_iarchive.hpp:61
#42 0x00036714 in
boost::archive::detail::interface_iarchive<boost::archive::polymorphic_iarchive>::operator&<boost::serialization::nvp<ramen::dataflow::graph<ramen::node_t>
> const> (this=0xbfffe58c, t=@0xbfffdf8c) at interface_iarchive.hpp:68
#43 0x0002c3fb in ramen::composition_t::serialize (this=0x193b1bd8,
ar=@0xbfffe58c, version=0) at
/Users/est/Devel/ramen/trunk/ramen/app/composition.cpp:193
#44 0x0004570f in
boost::serialization::access::serialize<boost::archive::polymorphic_iarchive,
ramen::composition_t> (ar=@0xbfffe58c, t=@0x193b1bd8, file_version=0) at
access.hpp:109
#45 0x00048387 in
boost::serialization::serialize<boost::archive::polymorphic_iarchive,
ramen::composition_t> (ar=@0xbfffe58c, t=@0x193b1bd8, file_version=0) at
serialization.hpp:74
#46 0x0004574f in
boost::serialization::serialize_adl<boost::archive::polymorphic_iarchive,
ramen::composition_t> (ar=@0xbfffe58c, t=@0x193b1bd8, file_version=0) at
serialization.hpp:133
#47 0x00048436 in
boost::archive::detail::iserializer<boost::archive::polymorphic_iarchive,
ramen::composition_t>::load_object_data (this=0xbcc410, ar=@0xbfffe598,
x=0x193b1bd8, file_version=0) at iserializer.hpp:173
#48 0x005a5423 in boost::archive::object_id_type::operator= () at
basic_archive.hpp:390
#49 0x005a5423 in
boost::archive::detail::basic_iarchive_impl::load_object () at
libs/serialization/src/basic_iarchive.cpp:391
#50 0x005a5423 in boost::archive::detail::basic_iarchive::load_object
(this=0xbfffe598, t=0x193b1bd8, bis=@0xbcc410) at
libs/serialization/src/basic_iarchive.cpp:529
#51 0x00043f0a in
boost::archive::detail::polymorphic_iarchive_route<boost::archive::naked_xml_iarchive>::load_object
(this=0xbfffe58c, t=0x193b1bd8, bis=@0xbcc410) at
polymorphic_iarchive_route.hpp:59
#52 0x0004835f in
boost::archive::detail::load_non_pointer_type<boost::archive::polymorphic_iarchive>::load_standard::invoke<ramen::composition_t>
(ar=@0xbfffe58c, t=@0x193b1bd8) at iserializer.hpp:363
#53 0x00043692 in
boost::archive::detail::load_non_pointer_type<boost::archive::polymorphic_iarchive>::invoke<ramen::composition_t>
(ar=@0xbfffe58c, t=@0x193b1bd8) at iserializer.hpp:415
#54 0x000436b1 in
boost::archive::load<boost::archive::polymorphic_iarchive,
ramen::composition_t> (ar=@0xbfffe58c, t=@0x193b1bd8) at iserializer.hpp:554
#55 0x00043700 in
boost::archive::polymorphic_iarchive_impl::load_override<ramen::composition_t>
(this=0xbfffe58c, t=@0xbfffe5c8) at polymorphic_iarchive.hpp:137
#56 0x00043752 in
boost::archive::detail::interface_iarchive<boost::archive::polymorphic_iarchive>::operator>><boost::serialization::nvp<ramen::composition_t>
const> (this=0xbfffe58c, t=@0xbfffe5c8) at interface_iarchive.hpp:61
#57 0x00043782 in
boost::archive::detail::interface_iarchive<boost::archive::polymorphic_iarchive>::operator&<boost::serialization::nvp<ramen::composition_t>
const> (this=0xbfffe58c, t=@0xbfffe5c8) at interface_iarchive.hpp:68
#58 0x0004379c in
boost::archive::detail::polymorphic_iarchive_route<boost::archive::naked_xml_iarchive>::operator&<boost::serialization::nvp<ramen::composition_t>
const> (this=0xbfffe58c, t=@0xbfffe5c8) at
polymorphic_iarchive_route.hpp:173


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk