SupSuper/OpenXcom — Issue #63: SIGSEGV when starting Battlescape mission
Author: Shugyousha
Created: 2012-01-28 10:04:23+00:00
State: open

Since a few weeks every time I start a downed-UFO mission (just when I click on the OK button and the load out screen is supposed to be shown) I get a segfault and the game crashes.

I tried to use GDB to track down the problem (on Arch Linux using Linux 3.2.1-1-ARCH) which gives me the following stack trace:

Starting program: ~/build/OpenXcom/bin/openxcom
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/libthread_db.so.1".
[New Thread 0x7fffeef92700 (LWP 4717)]
[Thread 0x7fffeef92700 (LWP 4717) exited]
[New Thread 0x7fffeef92700 (LWP 4718)]

Program received signal SIGSEGV, Segmentation fault.
0x00000000005c4ed2 in OpenXcom::Surface::getWidth() const ()
(gdb) bt
#0 0x00000000005c4ed2 in OpenXcom::Surface::getWidth() const ()
#1 0x00000000005c51f1 in OpenXcom::Surface::blitNShade(OpenXcom::Surface*, int, int, int, bool, int) ()
#2 0x000000000056e962 in OpenXcom::Map::drawTerrain(OpenXcom::Surface*) ()
#3 0x000000000056cf6c in OpenXcom::Map::draw() ()
#4 0x000000000058d716 in OpenXcom::Camera::centerOnPosition(OpenXcom::Position const&, bool) ()
#5 0x00000000005806b9 in OpenXcom::BattlescapeState::BattlescapeState(OpenXcom::Game*) ()
#6 0x0000000000577b27 in OpenXcom::BriefingCrashState::btnOkClick(OpenXcom::Action*) ()
#7 0x00000000005c3a3f in OpenXcom::InteractiveSurface::mouseClick(OpenXcom::Action*, OpenXcom::State*) ()
#8 0x00000000005c3792 in OpenXcom::InteractiveSurface::handle(OpenXcom::Action*, OpenXcom::State*) ()
#9 0x00000000005b9485 in OpenXcom::State::handle(OpenXcom::Action*) ()
#10 0x00000000005bec23 in OpenXcom::Game::run() ()
#11 0x0000000000524747 in main ()

I had a look at the Surface::getWidth function but to pinpoint the problem I would need to find the place where the Surface class is being instantiated. I have not gotten around that yet so I just throw this stack trace at you... :-) If you need more debugging information just tell me how to get it for you.