Bug 64692

Summary: [llvmpipe] src/gallium/drivers/llvmpipe/lp_state_fs.c:2415:llvmpipe_set_constant_buffer: Assertion `index < (sizeof(llvmpipe->constants[shader])/sizeof((llvmpipe->constants[shader])[0]))' failed.
Product: Mesa Reporter: Vinson Lee <vlee>
Component: OtherAssignee: mesa-dev
Status: RESOLVED FIXED QA Contact:
Severity: critical    
Priority: medium CC: maraeo
Version: gitKeywords: have-backtrace, regression
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

Description Vinson Lee 2013-05-17 01:55:53 UTC
mesa: 46ea8041074df79561f9771e2ecf198f2cbd088f (master)

Run piglit arb_uniform_buffer_object-maxblocks on llvmpipe.

$ ./bin/arb_uniform_buffer_object-maxblocks -auto
Max VS uniform blocks: 31
Max FS uniform blocks: 31
Max combined uniform blocks: 36
Failed to link: error: Too many vertex uniform blocks (32/31)
Failed to link: error: Too many fragment uniform blocks (32/31)
Failed to link: error: Too many combined uniform blocks (37/36)
Failed to link: error: Too many combined uniform blocks (31/36)
src/gallium/drivers/llvmpipe/lp_state_fs.c:2415:llvmpipe_set_constant_buffer: Assertion `index < (sizeof(llvmpipe->constants[shader])/sizeof((llvmpipe->constants[shader])[0]))' failed.
Trace/breakpoint trap (core dumped)

(gdb) bt
#0  0x00007f9c3954490a in _debug_assert_fail (expr=0x7f9c3a04fad8 "index < (sizeof(llvmpipe->constants[shader])/sizeof((llvmpipe->constants[shader])[0]))", 
    file=0x7f9c3a04f250 "src/gallium/drivers/llvmpipe/lp_state_fs.c", line=2415, function=0x7f9c3a04fc10 "llvmpipe_set_constant_buffer")
    at src/gallium/auxiliary/util/u_debug.c:278
#1  0x00007f9c39203603 in llvmpipe_set_constant_buffer (pipe=0x9b1c10, shader=0, index=16, cb=0x7fffce789f10)
    at src/gallium/drivers/llvmpipe/lp_state_fs.c:2415
#2  0x00007f9c394f528c in cso_set_constant_buffer (cso=0xa90c00, shader_stage=0, index=16, cb=0x7fffce789f10)
    at src/gallium/auxiliary/cso_cache/cso_context.c:1337
#3  0x00007f9c39426779 in st_bind_ubos (st=0xa799f0, shader=0xb289f0, shader_type=0) at src/mesa/state_tracker/st_atom_constbuf.c:215
#4  0x00007f9c394267d7 in bind_vs_ubos (st=0xa799f0) at src/mesa/state_tracker/st_atom_constbuf.c:226
#5  0x00007f9c3942439a in st_validate_state (st=0xa799f0) at src/mesa/state_tracker/st_atom.c:201
#6  0x00007f9c3935ec38 in st_draw_vbo (ctx=0xa23990, prims=0x7fffce78a0e0, nr_prims=1, ib=0x0, index_bounds_valid=1 '\001', min_index=0, max_index=3, 
    tfb_vertcount=0x0) at src/mesa/state_tracker/st_draw.c:210
#7  0x00007f9c3941e305 in vbo_draw_arrays (ctx=0xa23990, mode=7, start=0, count=4, numInstances=1, baseInstance=0) at src/mesa/vbo/vbo_exec_array.c:624
#8  0x00007f9c3941eccc in vbo_exec_DrawArrays (mode=7, start=0, count=4) at src/mesa/vbo/vbo_exec_array.c:776
#9  0x00007f9c3bffd0e9 in stub_glDrawArrays (mode=7, first=0, count=4) at piglit/tests/util/generated_dispatch.c:5350
#10 0x00007f9c3c0582d1 in piglit_draw_rect (x=-0.959999979, y=-0.800000012, w=0.0399999991, h=0.200000003)
    at piglit/tests/util/piglit-util-gl.c:872
#11 0x0000000000401979 in test_draw (y_index=0, prog=15, bos=0xb47be0, test_block=0, active_blocks=31)
    at piglit/tests/spec/arb_uniform_buffer_object/maxblocks.c:226
#12 0x0000000000401af8 in pass_link_test (y_index=0, vs_prefix=0x4021c1 "vs", vs_blocks=31, fs_prefix=0x4021c1 "vs", fs_blocks=0)
    at piglit/tests/spec/arb_uniform_buffer_object/maxblocks.c:267
#13 0x0000000000401d21 in piglit_display () at piglit/tests/spec/arb_uniform_buffer_object/maxblocks.c:314
#14 0x00007f9c3bff1478 in display () at piglit/tests/util/piglit-framework-gl/piglit_glut_framework.c:60
#15 0x00007f9c3b7a3137 in fghRedrawWindow (window=0x9ae0c0) at freeglut_main.c:210
#16 fghcbDisplayWindow (window=0x9ae0c0, enumerator=0x7fffce78a3d0) at freeglut_main.c:227
#17 0x00007f9c3b7a6889 in fgEnumWindows (enumCallback=0x7f9c3b7a30d0 <fghcbDisplayWindow>, enumerator=0x7fffce78a3d0) at freeglut_structure.c:394
#18 0x00007f9c3b7a35fa in fghDisplayAll () at freeglut_main.c:249
#19 glutMainLoopEvent () at freeglut_main.c:1450
#20 0x00007f9c3b7a3f05 in glutMainLoop () at freeglut_main.c:1498
#21 0x00007f9c3bff16ad in run_test (gl_fw=0x7f9c3c2c4bc0, argc=1, argv=0x7fffce78a798)
    at piglit/tests/util/piglit-framework-gl/piglit_glut_framework.c:142
#22 0x00007f9c3bfef796 in piglit_gl_test_run (argc=1, argv=0x7fffce78a798, config=0x7fffce78a680)
    at piglit/tests/util/piglit-framework-gl.c:127
#23 0x000000000040131e in main (argc=2, argv=0x7fffce78a798) at piglit/tests/spec/arb_uniform_buffer_object/maxblocks.c:58
(gdb) frame 1
#1  0x00007f9c39203603 in llvmpipe_set_constant_buffer (pipe=0x9b1c10, shader=0, index=16, cb=0x7fffce789f10)
    at src/gallium/drivers/llvmpipe/lp_state_fs.c:2415
2415	   assert(index < Elements(llvmpipe->constants[shader]));
(gdb) print index
$1 = 16
(gdb) print Elements(llvmpipe->constants[shader])
No symbol "Elements" in current context.
(gdb) print sizeof(llvmpipe->constants[shader])
$2 = 384
(gdb) print sizeof(llvmpipe->constants[shader])[0]
$3 = 24
(gdb) print 384 / 24
$4 = 16

614ee25077b7ffafeb87b22563d01856824fb4bc is the first bad commit
commit 614ee25077b7ffafeb87b22563d01856824fb4bc
Author: Marek Olšák <maraeo@gmail.com>
Date:   Thu May 2 02:38:43 2013 +0200

    st/mesa: initialize all program constants and UBO limits
    
    Also simplify UBO support checking.
    
    NOTE: This is a candidate for the 9.1 branch.
    
    Reviewed-by: Brian Paul <brianp@vmware.com>

:040000 040000 43469d74b142c9f8cc68e07142a952dd73c6298d bd3bffda50371f7e9f646dda596077eb828ec3be M	src
bisect run success
Comment 1 Marek Olšák 2013-06-30 21:18:56 UTC
This has been fixed by 15a4b6db2192b0adc05c3dc07cf043316c556f2e.

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.