boost 1.39 serialization via base pointer ok on gcc, but crashes on AIX V10.1
Take the following small self contained example.
This compiles and runs without any problems on gcc 4.2.1 on SUSE Linux.
However on AIX v10.1 compiler, you see the following on compile:
"/s1a/emos_esuite/emos_data/sms/boost_1_39_0/boost/archive/detail/oserializer.hpp",
line 538.5: 1540-2400 (W) "boost::serialization::STATIC_WARNING" is
undefined. The delete operator will not call a destructor.
"/s1a/emos_esuite/emos_data/sms/boost_1_39_0/boost/archive/detail/oserializer.hpp",
line 530.13: 1540-0700 (I) The previous message was produced while
processing
"boost::archive::saveboost::archive::text_oarchive,Defs(text_oarchive
"/s1a/emos_esuite/emos_data/sms/boost_1_39_0/boost/archive/detail/common_oarchive.hpp",
line 64.9: 1540-0700 (I) The previous message was produced while processing
"boost::archive::detail::common_oarchive ": Expecting ":", and didn't find one.
Can't read type info for
"singleton_wrapper it then throw an exception: archive_exception::unregistered_cast
This is because the it thinks that Base/Derived class relationship has
not been
registered. (i.e RepeatBase/RepeatDerived in the enclosed example).
It appears that:
ar & boost::serialization::base_object<RepeatBase>(*this);
is not registering the base/derived relationship on AIX.
The actual point in the code where is throws an exception is >>>>>>>>>:
// convert pointer to more derived type. if this is thrown
// it means that the base/derived relationship hasn't be
registered
vp = serialization::void_downcast(
*true_type,
*this_type,
static_cast archive_exception(archive_exception::unregistered_cast)
);
} In the debugger variables true_type and this_type are of type
boost::serialization::extended_type_info
true_type:
m_type_info_key unsigned int const 0x1100121b8 0x00000001 (1)
m_key $string const * 0x1100121c0 0x1000b9748 ->
"RepeatDerived"
this_type:
m_type_info_key unsigned int const 0x110012a40 0x00000001 (1)
m_key $string const * 0x110012a48 0x00000000
It looks like the m_key data member of this_type is empty,
I expected "RepeatBase"
Has any one else hit a similar problem, where on one platform its ok
and another it crashes ? Are there any workarounds I could try ?
--
Best regards,
Ta,
Avi
The code at line 538 on oserializer looks like:
template
archive_exception(archive_exception::unregistered_cast)
); }
In the debugger variables true_type and this_type are of type boost::serialization::extended_type_info true_type: m_type_info_key unsigned int const 0x1100121b8 0x00000001 (1) m_key $string const * 0x1100121c0 0x1000b9748 -> "RepeatDerived" this_type: m_type_info_key unsigned int const 0x110012a40 0x00000001 (1) m_key $string const * 0x110012a48 0x00000000 It looks like the m_key data member of this_type is empty, I expected "RepeatBase" Has any one else hit a similar problem, where on one platform its ok and another it crashes ? Are there any workarounds I could try ? -- Best regards, Ta, Avi ------------------------------------------------------------------------------ _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (2)
-
Avi Bahra
-
Robert Ramey