[Mesa-dev] [Bug 100438] glsl/ir.cpp:1376: ir_dereference_variable::ir_dereference_variable(ir_variable*): Assertion `var != NULL' failed.

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Tue Mar 28 23:06:36 UTC 2017


https://bugs.freedesktop.org/show_bug.cgi?id=100438

            Bug ID: 100438
           Summary: glsl/ir.cpp:1376:
                    ir_dereference_variable::ir_dereference_variable(ir_va
                    riable*): Assertion `var != NULL' failed.
           Product: Mesa
           Version: 11.1
          Hardware: x86-64 (AMD64)
                OS: Linux (All)
            Status: NEW
          Keywords: bisected, regression
          Severity: normal
          Priority: medium
         Component: glsl-compiler
          Assignee: mesa-dev at lists.freedesktop.org
          Reporter: vlee at freedesktop.org
        QA Contact: intel-3d-bugs at lists.freedesktop.org
                CC: airlied at freedesktop.org, t_arceri at yahoo.com.au

mesa: 7ee91af30074a4381e4353122319e3b4b3fe7cbd (master 17.1.0-devel)

This GLSL shader triggers an assert.

void main()
{
  a[b](c);
}


$ ./src/compiler/glsl_compiler --version 110 test.frag 
glsl_compiler: glsl/ir.cpp:1376:
ir_dereference_variable::ir_dereference_variable(ir_variable*): Assertion `var
!= NULL' failed.
Aborted (core dumped)

(gdb) bt
#0  __GI_raise (sig=sig at entry=6) at ../sysdeps/unix/sysv/linux/raise.c:58
#1  0x00007f4f4e7363ea in __GI_abort () at abort.c:89
#2  0x00007f4f4e72cbb7 in __assert_fail_base (fmt=<optimized out>,
assertion=assertion at entry=0x56396212559c "var != NULL",
file=file at entry=0x56396210d127 "glsl/ir.cpp", line=line at entry=1376, 
    function=function at entry=0x56396210dfa0
<ir_dereference_variable::ir_dereference_variable(ir_variable*)::__PRETTY_FUNCTION__>
"ir_dereference_variable::ir_dereference_variable(ir_variable*)") at
assert.c:92
#3  0x00007f4f4e72cc62 in __GI___assert_fail
(assertion=assertion at entry=0x56396212559c "var != NULL",
file=file at entry=0x56396210d127 "glsl/ir.cpp", line=line at entry=1376, 
    function=function at entry=0x56396210dfa0
<ir_dereference_variable::ir_dereference_variable(ir_variable*)::__PRETTY_FUNCTION__>
"ir_dereference_variable::ir_dereference_variable(ir_variable*)") at
assert.c:101
#4  0x0000563962038087 in ir_dereference_variable::ir_dereference_variable
(var=0x0, this=<optimized out>) at glsl/ir.cpp:1376
#5  0x0000563962077f67 in ir_dereference_variable::ir_dereference_variable
(var=0x0, this=<optimized out>) at ../../src/compiler/glsl/list.h:58
#6  ir_dereference_array::ir_dereference_array (this=0x56396387c710, var=0x0,
array_index=0x56396387c530) at glsl/ir.cpp:1399
#7  0x0000563962101144 in generate_array_index
(mem_ctx=mem_ctx at entry=0x56396386cc40,
instructions=instructions at entry=0x56396387c4a0,
state=state at entry=0x56396386cc40, loc=..., array=<optimized out>,
idx=<optimized out>, function_name=function_name at entry=0x7ffdbdfbcf50, 
    actual_parameters=0x7ffdbdfbcfc0) at glsl/ast_function.cpp:668
#8  0x00005639621051eb in ast_function_expression::hir (this=0x56396386df68,
instructions=0x56396387c4a0, state=0x56396386cc40) at
glsl/ast_function.cpp:2191
#9  0x00005639620c2273 in ast_expression_statement::hir (this=<optimized out>,
instructions=<optimized out>, state=<optimized out>) at
glsl/ast_to_hir.cpp:2201
#10 0x00005639620c22cf in ast_compound_statement::hir (this=0x56396386e0d8,
instructions=0x56396387c4a0, state=0x56396386cc40) at glsl/ast_to_hir.cpp:2217
#11 0x00005639620c8a6c in ast_function_definition::hir (this=0x56396386e138,
instructions=<optimized out>, state=0x56396386cc40) at glsl/ast_to_hir.cpp:5845
#12 0x00005639620bee28 in _mesa_ast_to_hir (instructions=0x56396386e8b0,
state=state at entry=0x56396386cc40) at glsl/ast_to_hir.cpp:155
#13 0x000056396206ff5f in _mesa_glsl_compile_shader
(ctx=ctx at entry=0x5639623687a0 <standalone_compile_shader::local_ctx>,
shader=shader at entry=0x56396386ad10, dump_ast=<optimized out>,
dump_hir=<optimized out>, force_recompile=force_recompile at entry=true)
    at glsl/glsl_parser_extras.cpp:1984
#14 0x000056396203c2cc in compile_shader (ctx=ctx at entry=0x5639623687a0
<standalone_compile_shader::local_ctx>, shader=shader at entry=0x56396386ad10) at
glsl/standalone.cpp:385
#15 0x000056396203c6fb in standalone_compile_shader (_options=<optimized out>,
num_files=<optimized out>, files=<optimized out>) at glsl/standalone.cpp:488
#16 0x0000563962038cdb in main (argc=<optimized out>, argv=0x7ffdbdfbd498) at
glsl/main.cpp:92
(gdb) frame 4
#4  0x0000563962038087 in ir_dereference_variable::ir_dereference_variable
(var=0x0, this=<optimized out>) at glsl/ir.cpp:1376
1376       assert(var != NULL);
(gdb) print var
$1 = (ir_variable *) 0x0


fd01840c0bd3b22d058a65a17ad30e3b45813b60 is the first bad commit
commit fd01840c0bd3b22d058a65a17ad30e3b45813b60
Author: Timothy Arceri <t_arceri at yahoo.com.au>
Date:   Wed Aug 5 15:49:22 2015 +1000

    glsl: add AoA support to subroutines

    process_parameters() will now be called earlier because we need
    actual_parameters processed earlier so we can use it with
    match_subroutine_by_name() to get the subroutine variable, we need
    to do this inside the recursive function generate_array_index() because
    we can't create the ir_dereference_array() until we have gotten to the
    outermost array.

    For the remainder of the array dimensions the type doesn't matter so we
    can just use the existing _mesa_ast_array_index_to_hir() function to
    process the ast.

    Reviewed-by: Dave Airlie <airlied at redhat.com>

:040000 040000 6fd2725cb11bcd8a8339a426017a93474d8fe261
dd66f0eaee3f686a47397a886d25917ed452397e M      src
bisect run success

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170328/a312ab3e/attachment.html>


More information about the mesa-dev mailing list