Bug 5196 - Segmentation fault after restarting Q3DM12 single player
Status: RESOLVED FIXED
Alias: None
Product: ioquake3
Classification: Unclassified
Component: Misc
Version: GIT MASTER
Hardware: PC Linux
: P3 major
Assignee: Zachary J. Slater
QA Contact: ioquake3 bugzilla mailing list
URL:
Depends on:
Blocks:
 
Reported: 2011-08-19 18:30 EDT by yellow
Modified: 2011-09-28 14:14:01 EDT
1 user (show)

See Also:


Attachments
qagame.qvm (476.46 KB, application/octet-stream)
2011-08-20 05:41 EDT, yellow
cgame.qvm (340.31 KB, application/octet-stream)
2011-08-20 05:41 EDT, yellow
ui.qvm (295.14 KB, application/octet-stream)
2011-08-20 05:42 EDT, yellow

Description yellow 2011-08-19 18:30:34 EDT
Hello,

When using the latest version of the code from "trunk", revision 2147 as of the time I'm writing this, I get a segmentation fault when playing Q3DM12 single player and pressing the "restart" button once the match finishes.

This happens on Slackware Linux -current as of today, x86_64 version. I can provide more information on request. I'll try to attach a core file I have, but it's 32 MB compressed. The backtrace looks like this:

(gdb) thread 2
[Switching to thread 2 (Thread 16373)]#0  0x0000000000477f3f in VM_CallInterpreted (vm=0x2090b80, args=0x7fffffffca20)
    at code/qcommon/vm_interpreted.c:354
354             *(int *)&image[ programStack + 44] = args[9];
(gdb) where
#0  0x0000000000477f3f in VM_CallInterpreted (vm=0x2090b80, args=0x7fffffffca20) at code/qcommon/vm_interpreted.c:354
#1  0x00000000004775e8 in VM_Call (vm=0x2090b80, callnum=1) at code/qcommon/vm.c:826
#2  0x0000000000466ad4 in SV_ShutdownGameProgs () at code/server/sv_game.c:857
#3  0x00000000004682d9 in SV_Shutdown (finalmsg=0xd2cc40 "Server crashed: VM_Restart failed") at code/server/sv_init.c:756
#4  0x0000000000436899 in Com_Error (code=1, fmt=0x50a11d "VM_Restart failed") at code/qcommon/common.c:310
#5  0x0000000000476c88 in VM_Restart (vm=0x2090b80) at code/qcommon/vm.c:519
#6  0x0000000000466bb9 in SV_RestartGameProgs () at code/server/sv_game.c:904
#7  0x000000000045c90f in SV_MapRestart_f () at code/server/sv_ccmds.c:300
#8  0x0000000000435ff6 in Cmd_ExecuteString (text=0x7fffffffcdd0 "map_restart 0") at code/qcommon/cmd.c:779
#9  0x000000000043566d in Cbuf_Execute () at code/qcommon/cmd.c:248
#10 0x000000000043ad55 in Com_Frame () at code/qcommon/common.c:3171
#11 0x00000000004c7342 in main (argc=1, argv=0x7fffffffd7b8) at code/sys/sys_main.c:639
Comment 1 yellow 2011-08-19 18:58:02 EDT
The crash also happens when trying to restart Q3DM0, which is a much shorter match. :)
Comment 2 yellow 2011-08-19 18:59:16 EDT
I could not attach the core file (it's too big), but it's been uploaded here:

http://rg3.name/core.16373.xz
Comment 3 yellow 2011-08-20 05:39:38 EDT
I think I have found the cause of the problem. When building from trunk, the building process creates a file baseq3/vm/qagame.qvm, like this:



Q3ASM build/release-linux-x86_64/baseq3/vm/cgame.qvm
Q3ASM build/release-linux-x86_64/baseq3/vm/qagame.qvm
Q3ASM build/release-linux-x86_64/baseq3/vm/ui.qvm



When I launch the game normally with everything in place, I cannot restart at least those matches because I get an error about that qagame.qvm file in the terminal, which triggers some error handling code and ends up in a segmentation fault for some reason.



==== ShutdownGame ====
VM_Restart()
Loading vm file vm/qagame.qvm...
Failed.
^3Warning: Couldn't open VM file vm/qagame.qvm
********************
ERROR: VM_Restart failed
********************
----- Server Shutdown (Server crashed: VM_Restart failed) -----
----- Client Shutdown (Received signal 11) -----
----- FS_Startup -----
Current search path:
/home/rg3/.q3a/baseq3
./baseq3
./baseq3/pak8.pk3 (9 files)
./baseq3/pak7.pk3 (4 files)
./baseq3/pak6.pk3 (64 files)
./baseq3/pak5.pk3 (7 files)
./baseq3/pak4.pk3 (272 files)
./baseq3/pak3.pk3 (4 files)
./baseq3/pak2.pk3 (148 files)
./baseq3/pak1.pk3 (26 files)
./baseq3/pak0.pk3 (3539 files)

handle 1: music/win.wav
----------------------
4073 files in pk3 files
RE_Shutdown( 1 )
Closing SDL audio device...
SDL audio device shut down.
-----------------------
----- Server Shutdown (Received signal 11) -----
Segmentation fault



However, if I put those "vm" files out of sight, the game works and does not crash, and it seems to take them from the official pak files.



==== ShutdownGame ====
VM_Restart()
Loading vm file vm/qagame.qvm...
File "vm/qagame.qvm" found in "./baseq3/pak8.pk3"
------- Game Initialization -------
gamename: baseq3
gamedate: Sep 30 2002



I'm attaching the generated .qvm files in case they are wrong.
Comment 4 yellow 2011-08-20 05:41:19 EDT
Created attachment 2946 [details]
qagame.qvm
Comment 5 yellow 2011-08-20 05:41:47 EDT
Created attachment 2947 [details]
cgame.qvm
Comment 6 yellow 2011-08-20 05:42:13 EDT
Created attachment 2948 [details]
ui.qvm
Comment 7 Thilo Schulz 2011-09-27 07:14:11 EDT
Can you give me a shell account where I can reproduce this?
Comment 8 Thilo Schulz 2011-09-27 18:28:54 EDT
fixed r2181
Comment 9 yellow 2011-09-28 14:14:01 EDT
Thanks for the fix!