Closed Razish closed 10 years ago
The problem is that the tex coords are being trashed in RB_CalcFogTexCoords it seems (or) its trying to access texcoords that are not valid as it is.
Happens with OS X as well, when launching the game using the binary (not the app bundle).
Just to keep updating this as I dig into the code, the contents of tess.xyz seem to be getting munged (they contain NaNs) by the time RB_CalcFogTexCoords tries to access them.
I've looked into this further. tess.fogNum
is being assigned a value greater than the number of loaded fogs, in RB_BeginSurface
.
I'm still getting this issue, currently replicating it on mp/ctf4, usually within a few seconds of joining the game, maybe 15 at max, usually instantly. Linux x86_64, debug build of OpenJK from latest git
tex@textop ~/ja % gdb openjk.x86_64
(gdb) run +set fs_game "japlus" +set sv_pure "0" +map mp/ctf4
(debug)OpenJK-MP: v1.0.1.0 linux-x86_64-debug Dec 31 2013
]team r
Raz0r entered the game
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff56aac68 in R_FogFactor (s=-nan(0x400000), t=0.96875) at /home/tex/projects/OpenJK/codemp/rd-vanilla/tr_image.cpp:1217
1217 d = tr.fogTable[ (int)(s * (FOG_TABLE_SIZE-1)) ];
(gdb) backtrace
#0 0x00007ffff56aac68 in R_FogFactor (s=-nan(0x400000), t=0.96875) at /home/tex/projects/OpenJK/codemp/rd-vanilla/tr_image.cpp:1217
#1 0x00007ffff56c7252 in RB_CalcModulateColorsByFog (colors=0x7ffff5b81420 <tess+108000> "\177") at /home/tex/projects/OpenJK/codemp/rd-vanilla/tr_shade_calc.cpp:772
#2 0x00007ffff56c3b3c in ComputeColors (pStage=0x5c4b6d0, forceRGBGen=6) at /home/tex/projects/OpenJK/codemp/rd-vanilla/tr_shade.cpp:1372
#3 0x00007ffff56c48cd in RB_IterateStagesGeneric (input=0x7ffff5b66e40 <tess>) at /home/tex/projects/OpenJK/codemp/rd-vanilla/tr_shade.cpp:1655
#4 0x00007ffff56c4daa in RB_StageIteratorGeneric () at /home/tex/projects/OpenJK/codemp/rd-vanilla/tr_shade.cpp:1828
#5 0x00007ffff56c521f in RB_EndSurface () at /home/tex/projects/OpenJK/codemp/rd-vanilla/tr_shade.cpp:1959
#6 0x00007ffff568a000 in RB_RenderDrawSurfList (drawSurfs=0x5895480, numDrawSurfs=445) at /home/tex/projects/OpenJK/codemp/rd-vanilla/tr_backend.cpp:819
#7 0x00007ffff568ba1d in RB_DrawSurfs (data=0x5a39608) at /home/tex/projects/OpenJK/codemp/rd-vanilla/tr_backend.cpp:1510
#8 0x00007ffff568c427 in RB_ExecuteRenderCommands (data=0x5a39608) at /home/tex/projects/OpenJK/codemp/rd-vanilla/tr_backend.cpp:1809
#9 0x00007ffff569503d in R_IssueRenderCommands (runPerformanceCounters=qtrue) at /home/tex/projects/OpenJK/codemp/rd-vanilla/tr_cmds.cpp:86
#10 0x00007ffff5695871 in RE_EndFrame (frontEndMsec=0x0, backEndMsec=0x0) at /home/tex/projects/OpenJK/codemp/rd-vanilla/tr_cmds.cpp:426
#11 0x00000000004cf6ed in SCR_UpdateScreen () at /home/tex/projects/OpenJK/codemp/client/cl_scrn.cpp:506
#12 0x00000000004c87b0 in CL_Frame (msec=16) at /home/tex/projects/OpenJK/codemp/client/cl_main.cpp:2186
#13 0x0000000000426ca5 in Com_Frame () at /home/tex/projects/OpenJK/codemp/qcommon/common.cpp:1591
#14 0x00000000005230ab in main (argc=12, argv=0x7fffffffe208) at /home/tex/projects/OpenJK/codemp/sys/sys_main.cpp:620
You sure you're actually up to date :|
Absolutely. Deleted all binaries, cleaned build files, pulled from git, regenerated makefile, built project. Multiple times to make absolute sure.
(debug)OpenJK-MP: v1.0.1.0 linux-x86_64-debug Dec 31 2013
Baw, I'll take another look in a few hours.
@Razish Quick run through now doesn't give me any crashes on ctf4.
I can't reproduce this bug in my VM which is running Ubuntu 13.10 64-bit. Testing with a debug build.
This bug reappears when using JA++. The problem comes from the SFX sabers, which at some point give some NaNs to the engine.
I'll need to rethink my fix to handle NaNs more gracefully, as crashing isn't ever a good thing outside of debugging.
Confirmed to be fixed now for JA++.
Linux 64-bit on any map with fog, usually after a few seconds of gameplay. Reproduced on mp/ffa1 at jawa.jk3.in:29070