[quake3-bugzilla] [Bug 5503] New: SIGSEGV with r_vertexlight 1 in missionpack

bugzilla-daemon at icculus.org bugzilla-daemon at icculus.org
Sun Apr 29 13:25:14 EDT 2012


https://bugzilla.icculus.org/show_bug.cgi?id=5503

           Summary: SIGSEGV with r_vertexlight 1 in missionpack
           Product: ioquake3
           Version: SVN HEAD
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P3
         Component: Video
        AssignedTo: zakk at icculus.org
        ReportedBy: belyshev at depni.sinp.msu.ru
         QAContact: quake3-bugzilla at icculus.org


Setting r_vertexlight to 1 causes game to crash when loading a map.  Here is a
sample backtrace of this event:


Program terminated with signal 11, Segmentation fault.
#0  0x00007f426eb7c467 in ParseStage (stage=0x7f426ed0e8c8,
text=0x7fff21095108) at code/renderer/tr_shader.c:633
633                        stage->bundle[0].image[0] =
tr.lightmaps[shader.lightmapIndex];
(gdb) bt
#0  0x00007f426eb7c467 in ParseStage (stage=0x7f426ed0e8c8,
text=0x7fff21095108) at code/renderer/tr_shader.c:633
#1  0x00007f426eb7e218 in ParseShader (text=0x7fff21095108) at
code/renderer/tr_shader.c:1436
#2  0x00007f426eb8034a in R_FindShader (name=0x7fff21095490
"textures/ctf2/redteam02", lightmapIndex=0, mipRawImage=qtrue) at
code/renderer/tr_shader.c:2508
#3  0x00007f426eb8092e in RE_RegisterShaderLightMap (name=0x7fff21095490
"textures/ctf2/redteam02", lightmapIndex=0) at code/renderer/tr_shader.c:2708
#4  0x00007f426eb7afa0 in R_RemapShader (shaderName=0x7fff21095490
"textures/ctf2/redteam02", newShaderName=0x7fff210954d0 "team_icon/Pagans_red",
timeOffset=0x7fff21095480 " 0.00") at code/renderer/tr_shader.c:76
#5  0x0000000000406725 in CL_CgameSystemCalls (args=0x7fff21095330) at
code/client/cl_cgame.c:686
#6  0x0000000000475f01 in VM_DllSyscall (arg=79) at code/qcommon/vm.c:352
#7  0x00007f426983c6af in ?? () from ioq3/missionpack/cgamex86_64.so
#8  0x00007f426980f952 in ?? () from ioq3/missionpack/cgamex86_64.so
[...]


The code in question is (code/renderer/tr_shader.c:630):

        if ( shader.lightmapIndex < 0 ) {
                stage->bundle[0].image[0] = tr.whiteImage;
        } else {
                stage->bundle[0].image[0] = tr.lightmaps[shader.lightmapIndex];
        }

When r_vertexlight is set to 1, this if() is called with tr.lightmaps having
value of NULL.  Fixed by checking value of tr.lightmaps in the condition, patch
attached.

-- 
Configure bugmail: https://bugzilla.icculus.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the quake3-bugzilla mailing list