4
« on: July 24, 2010, 11:40:29 pm »
I've recently been trying to migrate from Visual Studio over to MinGW w/g++. Now that I've got everything compiling and linking again, I'm getting a crash in the constructor for WindowImpl(). It appears to have something to do with the stl:deque class (I'm assuming it's something to do with the myEvents member variable). It looks like it's either attempting to delete a bad pointer or, it's trying to delete something that it allocated with a version of new other than my overloaded new. I've been trying to debug this with gdb, but I'm a gdb noob.
Here's the call stack:
#0 0x70624be8 in dlfree (mem=0x344b28) at Native\DF_Common\dlmalloc\malloc.c:4739
#1 0x00465767 in operator delete (Memory=0x344b28) at Native/DF_Common/DF_Memory.h:46
#2 0x0041f381 in __gnu_cxx::new_allocator<sf::Event>::deallocate(sf::Event*, unsigned int) ()
#3 0x0044c108 in std::_Deque_base<sf::Event, std::allocator<sf::Event> >::_M_deallocate_node(sf::Event*) ()
#4 0x0044bf1a in std::_Deque_base<sf::Event, std::allocator<sf::Event> >::_M_destroy_nodes(sf::Event**, sf::Event**) ()
#5 0x0044c1d6 in std::_Deque_base<sf::Event, std::allocator<sf::Event> >::~_Deque_base() ()
#6 0x004582ce in std::deque<sf::Event, std::allocator<sf::Event> >::~deque() ()
#7 0x00402fcf in sf::priv::WindowImpl::WindowImpl() ()
#8 0x00403a9b in sf::priv::WindowImplWin32::WindowImplWin32(sf::VideoMode, std::string const&, unsigned long) ()
#9 0x00402f13 in sf::priv::WindowImpl::New(sf::VideoMode, std::string const&, unsigned long) ()
#10 0x004022e7 in sf::Window::Create(sf::VideoMode, std::string const&, unsigned long, sf::ContextSettings const&) ()
#11 0x004020f6 in sf::Window::Window(sf::VideoMode, std::string const&, unsigned long, sf::ContextSettings const&) ()
#12 0x00401457 in Init (hInstance=0x400000) at Native\DF_Game\Main.cpp:160
This does not happen with Visual Studio and its version of STL. Nor does it happen with MinGW/g++ if I don't overload global new/delete.
Any ideas and/or suggestions?[/code]