Boost logo

Boost Users :

From: Joshua Little (ljoshua_at_[hidden])
Date: 2004-05-12 23:29:15


I've been using shared_ptr's for a while now with gcc 3.1 and recently
had to upgrade to gcc 3.2.3. Ever since then I'm getting strange crashes
when shared_ptr's are destructed. Heres a backtrace :
Program received signal SIGSEGV, Segmentation fault.
0x77f967bf in ?? ()
(gdb) bt
#0 0x77f967bf in ?? ()
#1 0x77fb5c15 in ?? ()
#2 0x77fa6afc in ?? ()
#3 0x77fccc55 in ?? ()
#4 0x78001e00 in _libmsvcrt_a_iname ()
#5 0x0050f4f5 in operator delete(void*) ()
#6 0x00541cc4 in
boost::detail::sp_counted_base_impl<BeamWeaponXMLLoader*,
boost::checked_deleter<BeamWeaponXMLLoader> >::~sp_counted_base_impl() (
    this=0x1899aa0) at e:/MinGW/include/c++/3.2.3/iostream:63
#7 0x0053fada in boost::detail::sp_counted_base::destruct()
(this=0x1899aa0)
    at e:/boost-1.30.2/boost/detail/shared_count.hpp:113
#8 0x0053f996 in boost::detail::sp_counted_base::weak_release() (
    this=0x1899aa0) at e:/boost-1.30.2/boost/detail/shared_count.hpp:168
#9 0x0053fab4 in boost::detail::sp_counted_base::release() (this=0x1899aa0)
    at e:/boost-1.30.2/boost/detail/shared_count.hpp:144
#10 0x0053f913 in boost::detail::shared_count::~shared_count()
(this=0x1899154)
    at e:/boost-1.30.2/boost/detail/shared_count.hpp:376
#11 0x005393e5 in boost::shared_ptr<BeamWeaponXMLLoader>::~shared_ptr() (
    this=0x1899150) at src/loaders/HullXMLLoader.cpp:19
#12 0x0043489a in HullXMLLoader::~HullXMLLoader() (this=0x1899100)
    at src/loaders/HullXMLLoader.cpp:32
#13 0x0053b5ba in void
boost::checked_delete<HullXMLLoader>(HullXMLLoader*) (
    x=0x1899100) at e:/boost-1.30.2/boost/checked_delete.hpp:34
#14 0x0055b43d in
boost::checked_deleter<HullXMLLoader>::operator()(HullXMLLoader*) const
(this=0x1899d08, x=0x1899100)
    at e:/boost-1.30.2/boost/checked_delete.hpp:52
#15 0x00540b8b in boost::detail::sp_counted_base_impl<HullXMLLoader*,
boost::checked_deleter<HullXMLLoader> >::dispose() (this=0x1899cf8)
    at e:/boost-1.30.2/boost/detail/shared_count.hpp:262
#16 0x0053faa6 in boost::detail::sp_counted_base::release() (this=0x1899cf8)
    at e:/boost-1.30.2/boost/detail/shared_count.hpp:143
#17 0x0053f913 in boost::detail::shared_count::~shared_count()
(this=0x18990e4)
    at e:/boost-1.30.2/boost/detail/shared_count.hpp:376
#18 0x00536f09 in boost::shared_ptr<HullXMLLoader>::~shared_ptr() (
    this=0x18990e0) at src/loaders/StarShipXMLLoader.cpp:13
#19 0x00432ba8 in StarShipXMLLoader::~StarShipXMLLoader() (this=0x18990c8)
    at src/loaders/StarShipXMLLoader.cpp:23
#20 0x00523926 in void baleet<StarShipXMLLoader>(StarShipXMLLoader*) (
    x=0x18990c8) at src/Deleters.hpp:36
#21 0x0055d119 in
baleeter<StarShipXMLLoader>::operator()(StarShipXMLLoader*) const
(this=0x1899d40, x=0x18990c8) at src/Deleters.hpp:48
#22 0x0054170f in
boost::detail::sp_counted_base_impl<StarShipXMLLoader*,
baleeter<StarShipXMLLoader> >::dispose() (this=0x1899d30)
    at e:/boost-1.30.2/boost/detail/shared_count.hpp:262
#23 0x0053faa6 in boost::detail::sp_counted_base::release() (this=0x1899d30)
    at e:/boost-1.30.2/boost/detail/shared_count.hpp:143
#24 0x0053f913 in boost::detail::shared_count::~shared_count()
(this=0x22fd14)
    at e:/boost-1.30.2/boost/detail/shared_count.hpp:376
#25 0x00538b1d in boost::shared_ptr<StarShipXMLLoader>::~shared_ptr() (
    this=0x22fd10) at src/Player.cpp:76
#26 0x0040cd8f in Player::Player(EngineManager*, GameManager*) (
    this=0x1898cd8, NewEngine=0x17d7a20, NewGameManager=0x1852ec8)
    at src/Player.cpp:96
#27 0x00407e4e in GameManager::Initialise() (this=0x1852ec8)
    at src/GameManager.cpp:125
#28 0x0040398a in main (argc=1, argv=0x17924f8) at src/ZeroSpace.cpp:32

I am constructing the shared_ptr's in a normal way :
    HullLoader.reset(new HullXMLLoader()); for instance. It seems to
segfault when delete is called either with the default deleter or with
one of my own. This was working fine when using gcc 3.1, do I need to
upgrade my boost or use some compile flag?
Any help would be greatfully appriciated,
Joshua.


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