Boost logo

Boost Users :

Subject: [Boost-users] [Serialization - 1.35] Crash while serializing
From: Soumen (soumen78_at_[hidden])
Date: 2009-09-22 11:39:59


Hi,

I've following class hierarchy:

FilterCondition <---+--- CompositeCondition
                          |
                          +--- ConcreteCondition

FilterCondition is ABC. FilterCondition has certain data members which I
need to serialize.

I already have another class "Table" for which serialization works
perfectly. Now, I've added a pointer of type "FilterCondition" as a member
to "Table". Say, the member name is "filterCond_".

Now, as soon as I add following line in Table::serialize(), I get a crash :

ar & filterCond_;

This happens even though I make body of FilterCondition::serialize(),
CompositeCondition::serialize() and
ConcreteCondition::serialize() empty.

In Table::serialize(), I've verified that filterCond_ is a valid pointer.
I've declared FilterCondition as abstract through BOOST_CLASS_ABSTRACT macro
as well.

Following is top of stack from gdb:

------------------------------------------------------------------------------------------------
(gdb) where
#0 0x0000000000fcfee6 in
boost::serialization::detail::extended_type_info_typeid_0::less_than ()
#1 0x0000000000fcf703 in
boost::serialization::extended_type_info::operator< ()
#2 0x0000000000fcf78b in boost::serialization::extended_type_info::find ()
#3 0x0000000000fcffea in
boost::serialization::detail::extended_type_info_typeid_0::get_derived_extended_type_info
()
#4 0x000000000136ca0c in
boost::serialization::detail::extended_type_info_typeid_1<FilterCondition
const>::get_derived_extended_type_info (t=@0x19c6e390) at
/remote/arch-tools/boost/qsc-b/1_35_0/include/boost/serialization/extended_type_info_typeid.hpp:92
#5 0x000000000136ca5b in
boost::archive::detail::save_pointer_type<boost::archive::binary_oarchive,
FilterCondition*>::polymorphic<FilterCondition>::save (ar=@0x7fbfffc410,
t=@0x19c6e390, bpos_ptr=0x0) at
/remote/arch-tools/boost/qsc-b/1_35_0/include/boost/archive/detail/oserializer.hpp:385
#6 0x000000000136cbed in
boost::archive::detail::save_pointer_type<boost::archive::binary_oarchive,
FilterCondition*>::save<FilterCondition> (ar=@0x7fbfffc410, t=@0x19c6e390,
bpos_ptr=0x0) at
/remote/arch-tools/boost/qsc-b/1_35_0/include/boost/archive/detail/oserializer.hpp:434
#7 0x000000000136cc4a in
boost::archive::detail::save_pointer_type<boost::archive::binary_oarchive,
FilterCondition*>::invoke (ar=@0x7fbfffc410, t=0x19c6e390) at
/remote/arch-tools/boost/qsc-b/1_35_0/include/boost/archive/detail/oserializer.hpp:462
#8 0x000000000136cc6c in
boost::archive::save<boost::archive::binary_oarchive, FilterCondition*>
(ar=@0x7fbfffc410, t=@0x19c6d820) at
/remote/arch-tools/boost/qsc-b/1_35_0/include/boost/archive/detail/oserializer.hpp:532
#9 0x000000000136cc96 in
boost::archive::detail::common_oarchive<boost::archive::binary_oarchive>::save_override<FilterCondition*
const> (this=0x7fbfffc410, t=@0x19c6d820) at
/remote/arch-tools/boost/qsc-b/1_35_0/include/boost/archive/detail/common_oarchive.hpp:64
#10 0x000000000136ccbb in
boost::archive::array::oarchive<boost::archive::binary_oarchive>::save_override<FilterCondition*>
(this=0x7fbfffc410, x=@0x19c6d820, version=0) at
/remote/arch-tools/boost/qsc-b/1_35_0/include/boost/archive/array/oarchive.hpp:122
#11 0x000000000136cce3 in
boost::archive::basic_binary_oarchive<boost::archive::binary_oarchive>::save_override<FilterCondition*>
(this=0x7fbfffc410, t=@0x19c6d820) at
/remote/arch-tools/boost/qsc-b/1_35_0/include/boost/archive/basic_binary_oarchive.hpp:64
#12 0x000000000136cd0b in
boost::archive::binary_oarchive_impl<boost::archive::binary_oarchive, char,
std::char_traits<char> >::save_override<FilterCondition* const>
(this=0x7fbfffc410, t=@0x19c6d820) at
/remote/arch-tools/boost/qsc-b/1_35_0/include/boost/archive/binary_oarchive_impl.hpp:45
#13 0x000000000136cd38 in
boost::archive::detail::interface_oarchive<boost::archive::binary_oarchive>::operator<<
<FilterCondition* const> (this=0x7fbfffc410, t=@0x19c6d820) at
/remote/arch-tools/boost/qsc-b/1_35_0/include/boost/archive/detail/interface_oarchive.hpp:64
#14 0x000000000136cd69 in
boost::archive::detail::interface_oarchive<boost::archive::binary_oarchive>::operator&<FilterCondition*>
(this=0x7fbfffc410, t=@0x19c6d820) at
/remote/arch-tools/boost/qsc-b/1_35_0/include/boost/archive/detail/interface_oarchive.hpp:72
#15 0x000000000136ce5a in Table::serialize<boost::archive::binary_oarchive>
(this=0x19c6d750, ar=@0x7fbfffc410, version=0) at
/remote/scratch/gsoumen/hiers/tmp.trunk/tools/code/tables/Table.h:178
#16 0x000000000136ce7f in
boost::serialization::access::serialize<boost::archive::binary_oarchive,
Table> (ar=@0x7fbfffc410, t=@0x19c6d750, file_version=0) at
/remote/arch-tools/boost/qsc-b/1_35_0/include/boost/serialization/access.hpp:109

------------------------------------------------------------------------------------------------

Is this a bug in serialization library?

Regards,
~ Soumen

-- 
View this message in context: http://www.nabble.com/-Serialization---1.35--Crash-while-serializing-tp25530791p25530791.html
Sent from the Boost - Users mailing list archive at Nabble.com.

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