Bug 25588 - Lots of ARB_vertex_program/fragment_program parser errors in ETQW (if GLSL is unavailable)
Summary: Lots of ARB_vertex_program/fragment_program parser errors in ETQW (if GLSL is...
Status: RESOLVED WONTFIX
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/r300 (show other bugs)
Version: git
Hardware: x86 (IA32) Linux (All)
: medium major
Assignee: Default DRI bug account
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-11 07:36 UTC by Fabio Pedretti
Modified: 2011-04-13 08:49 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
etqw console output + gdb backtrace (41.62 KB, text/plain)
2009-12-11 07:36 UTC, Fabio Pedretti
Details
typescript game output (9.42 KB, text/plain)
2010-01-08 07:44 UTC, Fabio Pedretti
Details
'glxinfo -l' when compiling mesa with "--enable-debug" (8.81 KB, text/plain)
2010-01-08 07:48 UTC, Fabio Pedretti
Details
game output with r300c (9.77 KB, text/plain)
2011-04-11 03:14 UTC, Fabio Pedretti
Details

Description Fabio Pedretti 2009-12-11 07:36:17 UTC
Created attachment 31982 [details]
etqw console output + gdb backtrace

The game Enemy Territory: Quake Wars ( http://zerowing.idsoftware.com/linux/etqw/ ) crashes with the following backtrace. Note that the game require libtxc_dxtn.so or else it stops with the game console.

Full game console output + backtrace is attached.

I am using current mesa_7_7_branch git compiled with libdrm_radeon but without KMS:
GL_RENDERER   = Mesa DRI R300 (RV530 71C5) 20090101 x86/MMX/SSE2 TCL


Mesa: User error: GL_OUT_OF_MEMORY in glBufferDataARB()

Program received signal SIGSEGV, Segmentation fault.
vbo_get_minmax_index (ctx=0x9ce4058, prim=0xbffff090, ib=0xbffff0a0, min_index=0xbffff078, max_index=0xbffff07c)
    at vbo/vbo_exec_array.c:81
81            GLuint min_us = us_indices[0];
(gdb) bt
#0  vbo_get_minmax_index (ctx=0x9ce4058, prim=0xbffff090, ib=0xbffff0a0, min_index=0xbffff078, max_index=0xbffff07c)
    at vbo/vbo_exec_array.c:81
#1  0x01f8a06f in r300DrawPrims (ctx=0x9ce4058, arrays=0x9d1ee5c, prim=0xbffff090, nr_prims=1, ib=0xbffff0a0,
    index_bounds_valid=0 '\000', min_index=4294967295, max_index=4294967295) at r300_draw.c:694
#2  0x0204d695 in vbo_validated_drawrangeelements (ctx=0x9ce4058, mode=<value optimised out>,
    index_bounds_valid=<value optimised out>, start=4294967295, end=4294967295, count=60, type=5123, indices=0x0,
    basevertex=0) at vbo/vbo_exec_array.c:662
#3  0x0204d8c2 in vbo_exec_DrawElements (mode=4, count=60, type=5123, indices=0x0) at vbo/vbo_exec_array.c:794
#4  0x02040680 in neutral_DrawElements (mode=4, count=60, type=5123, indices=0x0) at main/vtxfmt_tmp.h:334


The game also prints many warnings similar to:

Mesa: User error: GL_INVALID_OPERATION in glProgramStringARB(invalid texture image unit selector)
WARNING: GL_PROGRAM_ERROR_STRING_ARB: line 121, char 37: error: invalid texture image unit selector
error at 2588:
pecLook, specLook;
MAD             color, R0, ambient, color;
# multiply with ambient brightness
MUL             color, program.env[0].x, color;
# do some special effects if we're compiling certain shaders
# we could move this to a separate file but this saves us from
# duplicating the shader
# modify by the vertex color
LRP color.rgb, fragment.color.secondary.x, program.local[3], color;
MUL             result.color, color, fragment.color;
MOV             result.color.a, program.env[0].y;
#MOV            result.color.rgb, fragment.texcoord[7].w;
Comment 1 Ian Romanick 2009-12-11 12:20:13 UTC
Thanks to mishandling of DOS line endings, that shader snippet doesn't include the actual error. :(  Could you run under GDB, and put a breakpoint at yyerror.  When it gets hit, 'up' to _mesa_parse_arb_program and print all of str.

The output of 'glxinfo -l | grep GL_MAX_TEXTURE_' would also be helpful.

My guess is that the number of texture image units and / or texture coordinates units is being set in a weird way that is either making ET:QW or the fragment program compiler do the wrong thing.  This should be easy to fix.

The other error seems to be a mishandling of out-of-memory conditions in the VBO code.
Comment 2 Fabio Pedretti 2009-12-15 05:17:50 UTC
(In reply to comment #1)
> Thanks to mishandling of DOS line endings, that shader snippet doesn't include
> the actual error. :(  Could you run under GDB, and put a breakpoint at yyerror.
>  When it gets hit, 'up' to _mesa_parse_arb_program and print all of str.

#2  0x04105ec2 in _mesa_parse_arb_program (ctx=0x9ce40b8, target=34820,
    str=0x9e3900 "!!ARBfp1.0\n\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\nOPTION ARB_precision_hint_fastest;\r\n\r\nTEMP\tR0, R1, color, localNormal, worldNormal, ambient, localAmbient, specLook, diffuse;\r\n\r\nPARAM\tsubOne = { -1, -1, -1, -"..., len=3194,
    state=0xbfff87f4) at program_parse.y:2638
2638    in program_parse.y


> The output of 'glxinfo -l | grep GL_MAX_TEXTURE_' would also be helpful.

$ glxinfo -l | grep GL_MAX_TEXTURE_
Mesa: CPU vendor: GenuineIntel
Mesa: CPU name: Genuine Intel(R) CPU           T2600  @ 2.16GHz
Mesa: Mesa 7.8-devel DEBUG build Dec 13 2009 18:40:27
Mesa warning: couldn't open libtxc_dxtn.so, software DXTn compression/decompression unavailable
Mesa: MMX cpu detected.
Mesa: SSE cpu detected.
Mesa: Not testing OS support for SSE, leaving enabled.
Mesa: User error: GL_INVALID_ENUM in glGetProgramivARB(pname)
Mesa: User error: GL_INVALID_ENUM in glGetProgramivARB(pname)
Mesa: User error: GL_INVALID_ENUM in glGetProgramivARB(pname)
Mesa: User error: GL_INVALID_ENUM in glGetProgramivARB(pname)
Mesa: User error: GL_INVALID_ENUM in glGetProgramivARB(pname)
Mesa: User error: GL_INVALID_ENUM in glGetProgramivARB(pname)
    GL_MAX_TEXTURE_STACK_DEPTH = 10
    GL_MAX_TEXTURE_SIZE = 4096
    GL_MAX_TEXTURE_UNITS_ARB = 8
    GL_MAX_TEXTURE_LOD_BIAS_EXT = 16
    GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT = 16

Btw, are all those
Mesa: User error: GL_INVALID_ENUM in glGetProgramivARB(pname)
meaningful (glxinfo bug?) or should I just ignore them?
Comment 3 Fabio Pedretti 2009-12-24 03:36:03 UTC
Ian, any news on this?
Comment 4 Ian Romanick 2009-12-29 10:43:51 UTC
(In reply to comment #2)
> (In reply to comment #1)
> > Thanks to mishandling of DOS line endings, that shader snippet doesn't include
> > the actual error. :(  Could you run under GDB, and put a breakpoint at yyerror.
> >  When it gets hit, 'up' to _mesa_parse_arb_program and print all of str.
> 
> #2  0x04105ec2 in _mesa_parse_arb_program (ctx=0x9ce40b8, target=34820,
>     str=0x9e3900
> "!!ARBfp1.0\n\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\nOPTION
> ARB_precision_hint_fastest;\r\n\r\nTEMP\tR0, R1, color, localNormal,
> worldNormal, ambient, localAmbient, specLook, diffuse;\r\n\r\nPARAM\tsubOne = {
> -1, -1, -1, -"..., len=3194,
>     state=0xbfff87f4) at program_parse.y:2638
> 2638    in program_parse.y

I actually need *all* of the program. :)  Try this, run 'script'.  Run etqw in GDB again.  As before put a breakpoint at yyerror.  When it gets hit, 'up' to _mesa_parse_arb_program.  Then do 'printf "%s", str'.  Quit out of GDB, and ^D to exit script.  Attach the generate typescript file.

For some reason ID games to weird stuff when output is redirected, so it's possible this won't work.  If it doesn't work, just run GDB as before, do the printf above, and copy-and-paste the output to an attachment.

> > The output of 'glxinfo -l | grep GL_MAX_TEXTURE_' would also be helpful.
> 
> $ glxinfo -l | grep GL_MAX_TEXTURE_
> Mesa: CPU vendor: GenuineIntel
> Mesa: CPU name: Genuine Intel(R) CPU           T2600  @ 2.16GHz
> Mesa: Mesa 7.8-devel DEBUG build Dec 13 2009 18:40:27
> Mesa warning: couldn't open libtxc_dxtn.so, software DXTn
> compression/decompression unavailable
> Mesa: MMX cpu detected.
> Mesa: SSE cpu detected.
> Mesa: Not testing OS support for SSE, leaving enabled.
> Mesa: User error: GL_INVALID_ENUM in glGetProgramivARB(pname)
> Mesa: User error: GL_INVALID_ENUM in glGetProgramivARB(pname)
> Mesa: User error: GL_INVALID_ENUM in glGetProgramivARB(pname)
> Mesa: User error: GL_INVALID_ENUM in glGetProgramivARB(pname)
> Mesa: User error: GL_INVALID_ENUM in glGetProgramivARB(pname)
> Mesa: User error: GL_INVALID_ENUM in glGetProgramivARB(pname)
>     GL_MAX_TEXTURE_STACK_DEPTH = 10
>     GL_MAX_TEXTURE_SIZE = 4096
>     GL_MAX_TEXTURE_UNITS_ARB = 8
>     GL_MAX_TEXTURE_LOD_BIAS_EXT = 16
>     GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT = 16
> 
> Btw, are all those
> Mesa: User error: GL_INVALID_ENUM in glGetProgramivARB(pname)
> meaningful (glxinfo bug?) or should I just ignore them?

These messages are usually produced when glxinfo tries to query limits related to fragment programs when the driver does not support fragment programs.  Could you attach the full output of 'glxinfo -l'?
Comment 5 Fabio Pedretti 2010-01-08 07:44:27 UTC
Created attachment 32524 [details]
typescript game output

> I actually need *all* of the program. :)  Try this, run 'script'.  Run etqw in
> GDB again.  As before put a breakpoint at yyerror.  When it gets hit, 'up' to
> _mesa_parse_arb_program.  Then do 'printf "%s", str'.  Quit out of GDB, and ^D
> to exit script.  Attach the generate typescript file.

Done.
Comment 6 Fabio Pedretti 2010-01-08 07:48:55 UTC
Created attachment 32525 [details]
'glxinfo -l' when compiling mesa with "--enable-debug"

> These messages are usually produced when glxinfo tries to query limits related
> to fragment programs when the driver does not support fragment programs.  Could
> you attach the full output of 'glxinfo -l'?

Note that these "Mesa: User error" messages only appears when compiling with "--enable-debug" and this also triggers bug 25706.
Comment 7 Fabio Pedretti 2010-02-24 00:48:28 UTC
> > $ glxinfo -l | grep GL_MAX_TEXTURE_
> > Mesa: CPU vendor: GenuineIntel
> > Mesa: CPU name: Genuine Intel(R) CPU           T2600  @ 2.16GHz
> > Mesa: Mesa 7.8-devel DEBUG build Dec 13 2009 18:40:27
> > Mesa warning: couldn't open libtxc_dxtn.so, software DXTn
> > compression/decompression unavailable
> > Mesa: MMX cpu detected.
> > Mesa: SSE cpu detected.
> > Mesa: Not testing OS support for SSE, leaving enabled.
> > Mesa: User error: GL_INVALID_ENUM in glGetProgramivARB(pname)
> > Mesa: User error: GL_INVALID_ENUM in glGetProgramivARB(pname)
> > Mesa: User error: GL_INVALID_ENUM in glGetProgramivARB(pname)
> > Mesa: User error: GL_INVALID_ENUM in glGetProgramivARB(pname)
> > Mesa: User error: GL_INVALID_ENUM in glGetProgramivARB(pname)
> > Mesa: User error: GL_INVALID_ENUM in glGetProgramivARB(pname)
> >     GL_MAX_TEXTURE_STACK_DEPTH = 10
> >     GL_MAX_TEXTURE_SIZE = 4096
> >     GL_MAX_TEXTURE_UNITS_ARB = 8
> >     GL_MAX_TEXTURE_LOD_BIAS_EXT = 16
> >     GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT = 16
> > 
> > Btw, are all those
> > Mesa: User error: GL_INVALID_ENUM in glGetProgramivARB(pname)
> > meaningful (glxinfo bug?) or should I just ignore them?
> 
> These messages are usually produced when glxinfo tries to query limits related
> to fragment programs when the driver does not support fragment programs.  Could
> you attach the full output of 'glxinfo -l'?
> 

The glxinfo 'User error' are now fixed with:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=52cc3b03c3950cd66f9d976b2a3ae9f89dc4a97b

The ETQW game still has the program errors as attached to comment 5.
Comment 8 Fabio Pedretti 2010-04-28 02:15:38 UTC
ETQW still shows errors as in comment #5 with current mesa with both r300 and swrast but not with r300g and swrastg.
Comment 9 Fabio Pedretti 2010-04-28 02:38:14 UTC
(In reply to comment #8)
> ETQW still shows errors as in comment #5 with current mesa with both r300 and
> swrast but not with r300g and swrastg.

Update:
- r300 shows the errors of comment #5;
- swrast works fine;
- r300g works fine;
- swrastg crashes in a different way;
Comment 10 almos 2011-04-09 09:50:18 UTC
(In reply to comment #9)
> (In reply to comment #8)
> > ETQW still shows errors as in comment #5 with current mesa with both r300 and
> > swrast but not with r300g and swrastg.
> 
> Update:
> - r300 shows the errors of comment #5;
> - swrast works fine;
> - r300g works fine;
> - swrastg crashes in a different way;

Is this still unresolved?
Comment 11 Marek Olšák 2011-04-09 10:26:45 UTC
I can't reproduce this with current Mesa git and GLSL disabled. Closing as WORKSFORME.
Comment 12 Fabio Pedretti 2011-04-11 03:14:53 UTC
Created attachment 45469 [details]
game output with r300c

(In reply to comment #11)
> I can't reproduce this with current Mesa git and GLSL disabled. Closing as
> WORKSFORME.

The game loads fine now on swrast/swrastg and r300c/r300g all with mesa from git master up to a26121f37530619610a78a5fbe5ef87e44047fda. However on r300c it still showing errors. Output is attached. Maybe it's just a r300 specific error.
Comment 13 Benjamin Bellec 2011-04-11 03:54:32 UTC
I saw that you use the version 1.4.
You should try with the latest one (1.5).
Comment 14 almos 2011-04-11 10:37:29 UTC
(In reply to comment #13)
> I saw that you use the version 1.4.
> You should try with the latest one (1.5).

The attached log says
Running in restricted mode.
which means it's the demo, for which there is no 1.5 patch. The 1.5 changelog doesn't say anything about graphics bug fixes, and judging from the log the error seems to be in r300c (I've also seen this until mesa 7.9), so I think there is no need to re-test it with 1.5.

Now that only 7.10 (and maybe 7.9) seems to be maintained as a stable branch, which has r300g by default, this bug is obsolete IMHO.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.