Bug 32733

Summary: arbocclude2 from mesa-demos segfaults
Product: Mesa Reporter: roughl <r0ugh_l>
Component: Drivers/Gallium/r600Assignee: Default DRI bug account <dri-devel>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: medium CC: r0ugh_l
Version: git   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

Description roughl 2010-12-29 16:30:15 UTC
When trying to run arbocclude2 on my system it gives me this output:
OQ2 supported
Depthbits: 24
[1]    27415 segmentation fault  arbocclude2

Steps to Reproduce:
run arbocclude2 with gallium r600 driver

Additional Information:
It doesn't crash if I force the use of the software rasterizer
OpenGL renderer string: Software Rasterizer
But it crashes also when I use the llvmpipe driver
OpenGL renderer string: Gallium 0.4 on llvmpipe

backtrace:
#0  0x00007ffff31e1f55 in r600_query_end () from /usr/lib/xorg/modules/dri/r600_dri.so
#1  0x0000000000401b41 in Display ()
#2  0x00007ffff76cf16b in processWindowWorkList () from /usr/lib/libglut.so.3
#3  0x00007ffff76d026c in glutMainLoop () from /usr/lib/libglut.so.3
#4  0x0000000000401e60 in main ()

Version information:
mesa: git 2010-12-29
$ glxinfo|grep -i opengl
OpenGL vendor string: X.Org
OpenGL renderer string: Gallium 0.4 on AMD RV770
OpenGL version string: 2.1 Mesa 7.10-devel
OpenGL shading language version string: 1.20

OS: 2.6.36-ARCH #1 SMP PREEMPT x86_64
Comment 1 Brian Paterni 2011-01-07 15:21:15 UTC
(In reply to comment #0)
> When trying to run arbocclude2 on my system it gives me this output:
> OQ2 supported
> Depthbits: 24
> [1]    27415 segmentation fault  arbocclude2

Instead of a segmentation fault, I'm getting an assertion failure at src/mesa/state_tracker/st_cb_queryobj.c:100

backtrace:
#0  0x00007ffff6e79165 in raise (sig=<value optimized out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#1  0x00007ffff6e7bf70 in abort () at abort.c:92
#2  0x00007ffff6e722b1 in __assert_fail (assertion=0x7ffff3ff6558 "0 && \"unexpected query target in st_BeginQuery()\"", file=<value optimized out>, line=100, 
    function=0x7ffff3ff65c0 "st_BeginQuery") at assert.c:81
#3  0x00007ffff3e9dd06 in st_BeginQuery (ctx=<value optimized out>, q=0xbc2480) at state_tracker/st_cb_queryobj.c:100
#4  0x0000000000401ca1 in Display () at arbocclude2.c:145
#5  0x00007ffff71c6a7b in processWindowWorkList (window=0x60f300) at glut_event.c:1307
#6  0x00007ffff71c7b7c in __glutProcessWindowWorkLists () at glut_event.c:1358
#7  glutMainLoop () at glut_event.c:1379
#8  0x0000000000402030 in main (argc=1, argv=<value optimized out>) at arbocclude2.c:337

Looking at both arbocclude2.c and st_cb_queryobj.c, it looks like st_BeginQuery is missing a case for GL_ANY_SAMPLES_PASSED
Comment 2 roughl 2011-01-09 14:51:25 UTC
updated to latest git (commit: ac6306e9ca904ae9674bf2a15222efe4cb861bf5) and now arbocclude2 works.
Comment 3 roughl 2011-01-09 14:59:18 UTC
(In reply to comment #2)
> updated to latest git (commit: ac6306e9ca904ae9674bf2a15222efe4cb861bf5) and
> now arbocclude2 works.

I was accidentally testing with the r600 driver instead of r600g. r600g still gives me a Segmentation fault.
Comment 4 Brian Paterni 2011-01-12 19:23:50 UTC
30616fdacfd3e2d8d3df64e4aa6b4cac405f3cf0 fixes arbocclude2 for me.
Comment 5 roughl 2011-01-16 12:57:20 UTC
updated to b61afe13f1a272bfe8230ed5d8658f4b4f58ed71 and now arbocclud2 runs fine but gives me an error message:
$ arbocclude2
EE r600_pipe.c:321 r600_get_param - r600: unknown param 43
OQ2 supported
Depthbits: 24
Comment 6 Tobias Jakobi 2011-01-16 14:30:27 UTC
I get the exact same error (I think 'EE'  means error, right?) from 
r600_pipe.c with most of the games I can start through wine: The example I currently have is Deus Ex with a OpenGL renderer.
Comment 7 Henri Verbeet 2011-01-16 15:23:02 UTC
(In reply to comment #6)
> I get the exact same error (I think 'EE'  means error, right?) from 
> r600_pipe.c with most of the games I can start through wine: The example I
> currently have is Deus Ex with a OpenGL renderer.

Should be pretty harmless, I think that's just the new PIPE_CAP_INSTANCED_DRAWING.
Comment 8 Tobias Jakobi 2011-01-16 15:24:26 UTC
Yeah, and it looks like Christian just fixed it:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=ef3b8042e00fa4ac371f61b0832d1d5e73cff52f
Comment 9 roughl 2011-01-23 14:32:37 UTC
updated to latest git and now it works completely for me.

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.