Boost logo

Boost Users :

From: Jeffrey Chang (jeffrey8chang_at_[hidden])
Date: 2006-09-26 17:53:54


Hi,

I've been using boost Serialization library (release v1_33_1) on Linux
without problems, with g++ compiler of both v3.3.6 & v4.1.1. My program
serialzes boost::shared_ptr of polymorphic types, and BOOST_CLASS_EXPORT()
and BOOST_SERIALIZATION_SHARED_PTR() are used.

However, when the same program is ported & run on mingw32 (w/ g++ v3.4.5 on
WinXP), it generates SIGSEGV before my main() is called. and here's the
stack trace:

Program received signal SIGSEGV, Segmentation fault.
0x6e3759a3 in boost::archive::detail::basic_serializer::basic_serializer (
    this=0x4, eti=@0x813484)
    at /opt/boost/boost_1_33_1/boost/archive/detail/basic_serializer.hpp:37
37 {}
(gdb) bt
#0 0x6e3759a3 in boost::archive::detail::basic_serializer::basic_serializer
(
    this=0x4, eti=@0x813484)
    at /opt/boost/boost_1_33_1/boost/archive/detail/basic_serializer.hpp:37
#1 0x6e34220b in
boost::archive::detail::basic_oserializer::basic_oserializer
    (this=0x0, eti=@0x813484)
    at
/opt/boost/boost_1_33_1/libs/serialization/build/../src/basic_oserializer.cpp:24
#2 0x005fb394 in boost::archive::detail::pointer_oserializer<HmcBase,
boost::archive::text_oarchive>::pointer_oserializer (this=0x813164)
    at
/opt/boost/boost_1_33_1/boost/serialization/extended_type_info_typeid.hpp:95
#3 0x00477c12 in __static_initialization_and_destruction_1 (
    __initialize_p=8467588, __priority=65535)
    at /opt/boost/boost_1_33_1/boost/archive/detail/oserializer.hpp:198
#4 0x004c5a57 in __main ()
    at /opt/boost/boost_1_33_1/boost/archive/detail/oserializer.hpp:198
#5 0x00404568 in main (argc=1, argv=0x3d45f8) at ../../src/HmcMain.cpp:231
(gdb)

I cannot connect the logic between stack frame #3 and #2; it seems trying to
instantiate some global static data when SIGSEGV happens. Is there some
dependency on order of global static data initialization to be satisfied
for using BOOST_CLASS_EXPORT/BOOST_SERIALIZATION_SHARED_PTR? HmcBase is the
base class for my polymorphic types, and all my code are statically linked,
while "boost_serialization-mgw-d-1_33_1.dll" is used here. I saw some
discussion in this mailing list on "Serializing classes defined in
DLLs"<http://news.gmane.org/find-root.php?message_id=%3c432FF0C3.5010002%40intopii.fi%3e>a
year ago, but don't know what's the current status on it and whether
this
case is related to it.

Thanks for any hit,

--- Jeffrey



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