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

Editor segfaults when loading one particular campaign #321

Closed Wuzzy2 closed 9 years ago

Wuzzy2 commented 9 years ago

I suddenly can not open my own campaign in the editor anymore.

When attempting to load it, the editor crashes with a segfault:

GNU Debugger output:

#0  0xb7d13086 in free () from /usr/lib/libc.so.6
#1  0x0806cbef in CArrayTerminate (a=0x8138f70 <currentMission+4272>)
    at /home/wuzzy/src/cdogs-sdl/cdogs-sdl/src/cdogs/c_array.c:116
#2  0x0806cc34 in CArrayCopy (dst=0x8138f70 <currentMission+4272>, src=0xc30fd30)
    at /home/wuzzy/src/cdogs-sdl/cdogs-sdl/src/cdogs/c_array.c:47
#3  0x08084c71 in MissionCopy (dst=0x8137ec0 <currentMission>, src=0xc30ec80)
    at /home/wuzzy/src/cdogs-sdl/cdogs-sdl/src/cdogs/mission.c:171
#4  0x0805549d in Setup (buildTables=1) at /home/wuzzy/src/cdogs-sdl/cdogs-sdl/src/cdogsed.c:433
#5  0x08053994 in Open () at /home/wuzzy/src/cdogs-sdl/cdogs-sdl/src/cdogsed.c:525
#6  HandleInput (scrap=0xbfffe458, ycOld=<synthetic pointer>, xcOld=<synthetic pointer>, yc=0xbfffb450, 
    xc=<synthetic pointer>, m=<optimized out>, c=<optimized out>) at /home/wuzzy/src/cdogs-sdl/cdogs-sdl/src/cdogsed.c:963
#7  EditCampaign () at /home/wuzzy/src/cdogs-sdl/cdogs-sdl/src/cdogsed.c:1143
#8  main (argc=1, argv=0xbffff634) at /home/wuzzy/src/cdogs-sdl/cdogs-sdl/src/cdogsed.c:1265

Funny enough, this seems to only affect this single campaign. Other campaign files work fine, I also can still load my campaign in the game, so it does not seem to be file corruption.

The campaign in question is temporarily available for download here: http://rghost.net/download/58106699/1c1f9056fa66a4c15299c07c870b10eb1e164c63/orange2.tar.xz

If for some reason above link does not work anymore, just drop a message here.

Version: 8de4d4ac29c55093af78661e0842836a4b210f7f

cxong commented 9 years ago

Bug introduced in https://github.com/cxong/cdogs-sdl/commit/40633db135a50970ceff3e810592516767f1484a