cxong / cdogs-sdl

Classic overhead run-and-gun game
https://cxong.github.io/cdogs-sdl/
GNU General Public License v2.0
891 stars 114 forks source link

Segfault when attempting to start mission 4 in Death Inc. #305

Closed Wuzzy2 closed 10 years ago

Wuzzy2 commented 10 years ago

Hi! 02fb968d019fd98ad90e7bb3ae903fd246d63df3 has a crash. There is a nasty crash which prevents me to start mission 4 in the campaign “Death Incorporated” from AntiHukkanen. The password is “ifnqa9”. The crash happens always, there are no exceptions (so far).

The program exits with the message “Program received signal SIGSEGV, Segmentation fault.”.

I am on a GNU/Linux system and have manually compiled the game with debug symbols on. Here is the backtrace from the GNU Debugger:

0xb7dc8ca4 in __memcpy_ssse3 () from /usr/lib/libc.so.6
(gdb) bt
#0  0xb7dc8ca4 in __memcpy_ssse3 () from /usr/lib/libc.so.6
#1  0xb7dc6f15 in __memcpy_ssse3 () from /usr/lib/libc.so.6
#2  0x0806f837 in CArrayPushBack (a=0x814c4ec <gMission+44>, elem=0xc39744c0)
    at /home/wuzzy/src/cdogs-sdl/cdogs-sdl/src/cdogs/c_array.c:64
#3  0x08089ffe in SetupMission (buildTables=1, m=0xc746a30, mo=0x814c4c0 <gMission>, missionIndex=-1013496640)
    at /home/wuzzy/src/cdogs-sdl/cdogs-sdl/src/cdogs/mission.c:605
#4  0x08071560 in CampaignAndMissionSetup (buildTables=1, campaign=0x814c540 <gCampaign>, mo=0x814c4c0 <gMission>)
    at /home/wuzzy/src/cdogs-sdl/cdogs-sdl/src/cdogs/campaigns.c:259
#5  0x08059e22 in Game (graphics=0x814cc40 <gGraphicsDevice>, co=0x814c540 <gCampaign>)
    at /home/wuzzy/src/cdogs-sdl/cdogs-sdl/src/cdogs.c:273
#6  0x0805a1bb in Campaign (graphics=0x814cc40 <gGraphicsDevice>, co=0x814c540 <gCampaign>)
    at /home/wuzzy/src/cdogs-sdl/cdogs-sdl/src/cdogs.c:376
#7  0x0805a4b0 in MainLoop (creditsDisplayer=0xbfffb4f8, campaigns=0xbfffb518)
    at /home/wuzzy/src/cdogs-sdl/cdogs-sdl/src/cdogs.c:478
#8  0x080566a6 in main (argc=1, argv=0xbffff644) at /home/wuzzy/src/cdogs-sdl/cdogs-sdl/src/cdogs.c:830
cxong commented 10 years ago

I can reliably reproduce this under Windows, on this exact mission.

cxong commented 10 years ago

It seems that this is caused by the campaign itself; there is a map item in this mission that loads as garbage, it's possible that it was created using a buggy editor version. I've added a check and skip.