src/compiler/glsl/ast_to_hir.cpp:2134: ir_rvalue* ast_expression::do_hir(exec_list*, _mesa_glsl_parse_state*, bool): Assertion `result != NULL || !needs_rvalue' failed.
This shader triggers a crash in the GLSL compiler.
void main()
{
int i;
for (i = 0; i < 10; i += j);
}
src/compiler/glsl/ast_to_hir.cpp:2134: ir_rvalue* ast_expression::do_hir(exec_list*, _mesa_glsl_parse_state*, bool): Assertion `result != NULL || !needs_rvalue' failed.
(gdb) bt
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1 0x00007ff4849d9899 in __GI_abort () at abort.c:79
#2 0x00007ff4849d9769 in __assert_fail_base (fmt=0x7ff484b6dfb8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x560d1da82fd8 "result != NULL || !needs_rvalue",
file=0x560d1da82110 "src/compiler/glsl/ast_to_hir.cpp", line=2134, function=<optimized out>) at assert.c:92
#3 0x00007ff4849eb006 in __GI___assert_fail (assertion=0x560d1da82fd8 "result != NULL || !needs_rvalue", file=0x560d1da82110 "src/compiler/glsl/ast_to_hir.cpp", line=2134,
function=0x560d1da82ab8 "ir_rvalue* ast_expression::do_hir(exec_list*, _mesa_glsl_parse_state*, bool)") at assert.c:101
#4 0x0000560d1da165ba in ast_expression::do_hir (this=0x560d1ee77850, instructions=0x560d1ee834d0, state=0x560d1ee72810, needs_rvalue=true)
at src/compiler/glsl/ast_to_hir.cpp:2134
#5 0x0000560d1da1328d in ast_expression::hir (this=0x560d1ee77850, instructions=0x560d1ee834d0, state=0x560d1ee72810) at src/compiler/glsl/ast_to_hir.cpp:1303
#6 0x0000560d1da21c84 in ast_iteration_statement::hir (this=0x560d1ee77930, instructions=0x560d1ee83100, state=0x560d1ee72810) at src/compiler/glsl/ast_to_hir.cpp:7060
#7 0x0000560d1da168a1 in ast_compound_statement::hir (this=0x560d1ee77998, instructions=0x560d1ee83100, state=0x560d1ee72810) at src/compiler/glsl/ast_to_hir.cpp:2252
#8 0x0000560d1da1f574 in ast_function_definition::hir (this=0x560d1ee77a00, instructions=0x560d1ee74820, state=0x560d1ee72810) at src/compiler/glsl/ast_to_hir.cpp:6318
#9 0x0000560d1da10bb6 in _mesa_ast_to_hir (instructions=0x560d1ee74820, state=0x560d1ee72810) at src/compiler/glsl/ast_to_hir.cpp:159
#10 0x0000560d1d96136d in _mesa_glsl_compile_shader (ctx=0x560d1dac6da0 <main::local_ctx>, shader=0x560d1ee703b0, dump_ast=false, dump_hir=false, force_recompile=true)
at src/compiler/glsl/glsl_parser_extras.cpp:2212
#11 0x0000560d1d8fc7b6 in compile_shader (ctx=0x560d1dac6da0 <main::local_ctx>, shader=0x560d1ee703b0) at src/compiler/glsl/standalone.cpp:398
#12 0x0000560d1d8fcdd5 in standalone_compile_shader (_options=0x560d1dac6d80 <options>, num_files=1, files=0x7ffc4b802740, ctx=0x560d1dac6da0 <main::local_ctx>)
at src/compiler/glsl/standalone.cpp:501
#13 0x0000560d1d8fe2d4 in main (argc=4, argv=0x7ffc4b802728) at src/compiler/glsl/main.cpp:97
(gdb) frame 4
#4 0x0000560d1da165ba in ast_expression::do_hir (this=0x560d1ee77850, instructions=0x560d1ee834d0, state=0x560d1ee72810, needs_rvalue=true)
at src/compiler/glsl/ast_to_hir.cpp:2134
2134 assert(result != NULL || !needs_rvalue);
(gdb) print result
$1 = (ir_rvalue *) 0x0
d1fa69ed61d5aebeb69ce8a415c098035a953d48 is the first bad commit
commit d1fa69ed61d5aebeb69ce8a415c098035a953d48
Author: Tapani Pälli <tapani.palli@intel.com>
Date: Tue Sep 25 17:04:40 2018 +0300
glsl: do not attempt assignment if operand type not parsed correctly
v2: check types of both operands (Ian)
Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108012
:040000 040000 931a2f24e9f98030a55e8f47f2ae8e73e80d5e46 d3cce6e33325dc1d3777900b3a5ee62db4da7cf1 M src
bisect run success
cc: @tpalli