New: r600g: 'invalid read' linking geometry shader
https://bugs.freedesktop.org/show_bug.cgi?id=74717
Priority: medium
Bug ID: 74717
CC: [email protected]
Assignee: [email protected]
Summary: r600g: 'invalid read' linking geometry shader
Severity: normal
Classification: Unclassified
OS: All
Reporter: [email protected]
Hardware: Other
Status: NEW
Version: git
Component: Drivers/Gallium/r600
Product: Mesa
Created attachment 93669
--> https://bugs.freedesktop.org/attachment.cgi?id=93669&action=edit
gl-320-primitive-shading.trace
I am happy that r600g gained OpenGL 3.3 support in Mesa, so I tested a few geometry shader samples.
gl-320-primitive-shading either segfaults or prints error messages when run. According to valgrind there is an invalid read when linking the shader. I have reproduced the invalid read with glretrace too (see attachment).
Kernel is 3.14.0-rc1 + merge of 7c4c62a04a2a80e3feb5d6c97aca1e413b11c790 from drm-fixes:
$ uname -a Linux debian 3.14.0-rc1-00015-g7c4c62a #48 SMP PREEMPT Sat Feb 8 17:33:48 EET 2014 x86_64 GNU/Linux
Mesa is from the 10.1 branch:
$ glxinfo |grep OpenGL OpenGL vendor string: X.Org OpenGL renderer string: Gallium 0.4 on AMD RV730 OpenGL core profile version string: 3.3 (Core Profile) Mesa 10.1.0-rc1 (git-1e6bba5) OpenGL core profile shading language version string: 3.30 OpenGL core profile context flags: (none) OpenGL core profile profile mask: core profile OpenGL core profile extensions: OpenGL version string: 3.0 Mesa 10.1.0-rc1 (git-1e6bba5) OpenGL shading language version string: 1.30 OpenGL context flags: (none) OpenGL extensions:
Hardware is a Radeon HD 4650:
01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] RV730 PRO [Radeon HD 4650] (prog-if 00 [VGA controller])
To reproduce using the source code:
$ git clone https://github.com/g-truc/ogl-samples $ cmake . $ make $ build/build/release/gl-320-primitive-shading
The relevant source files:
https://github.com/g-truc/ogl-samples/blob/master/samples/gl-320-primitive-shading.cpp
https://github.com/g-truc/ogl-samples/blob/master/data/gl-320/primitive-shading.frag
https://github.com/g-truc/ogl-samples/blob/master/data/gl-320/primitive-shading.geom
https://github.com/g-truc/ogl-samples/blob/master/data/gl-320/primitive-shading.vert
Running 'valgrind glretrace gl-320-primitive-shading.trace' shows:
==10728== Memcheck, a memory error detector
==10728== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al. ==10728== Using Valgrind-3.9.0 and LibVEX; rerun with -h for copyright info ==10728== Command: glretrace gl-320-primitive-shading.trace ==10728==
==10728== Invalid read of size 8
==10728== at 0x58131A0: glsl_to_tgsi_visitor::copy_propagate()
(st_glsl_to_tgsi.cpp:3447)
==10728== by 0x581AE1F: st_link_shader (st_glsl_to_tgsi.cpp:5126) ==10728== by 0x582EDD9: _mesa_glsl_link_shader (ir_to_mesa.cpp:3091) ==10728== by 0x577E729: link_program (shaderapi.c:872) ==10728== by 0x47D8B3: _glLinkProgram(unsigned int) (in
/usr/local/bin/glretrace)
==10728== by 0x4E7411: retrace_glLinkProgram(trace::Call&) (in/usr/local/bin/glretrace)
==10728== by 0x429EDC: retrace::Retracer::retrace(trace::Call&) (in/usr/local/bin/glretrace)
==10728== by 0x41F7F8: retrace::retraceCall(trace::Call*) (in/usr/local/bin/glretrace)
==10728== by 0x421681: retrace::RelayRunner::runLeg(trace::Call*) (in/usr/local/bin/glretrace)
==10728== by 0x421573: retrace::RelayRunner::runRace() (in/usr/local/bin/glretrace)
==10728== by 0x41FB49: retrace::RelayRace::run() (in/usr/local/bin/glretrace)
==10728== by 0x41FD18: retrace::mainLoop() (in /usr/local/bin/glretrace)
==10728== Address 0x8517a88 is not stack'd, malloc'd or (recently) free'd ==10728==
==10728== Invalid read of size 8
==10728== at 0x58131B6: glsl_to_tgsi_visitor::copy_propagate()
(st_glsl_to_tgsi.cpp:3459)
==10728== by 0x581AE1F: st_link_shader (st_glsl_to_tgsi.cpp:5126) ==10728== by 0x582EDD9: _mesa_glsl_link_shader (ir_to_mesa.cpp:3091) ==10728== by 0x577E729: link_program (shaderapi.c:872) ==10728== by 0x47D8B3: _glLinkProgram(unsigned int) (in
/usr/local/bin/glretrace)
==10728== by 0x4E7411: retrace_glLinkProgram(trace::Call&) (in/usr/local/bin/glretrace)
==10728== by 0x429EDC: retrace::Retracer::retrace(trace::Call&) (in/usr/local/bin/glretrace)
==10728== by 0x41F7F8: retrace::retraceCall(trace::Call*) (in/usr/local/bin/glretrace)
==10728== by 0x421681: retrace::RelayRunner::runLeg(trace::Call*) (in/usr/local/bin/glretrace)
==10728== by 0x421573: retrace::RelayRunner::runRace() (in/usr/local/bin/glretrace)
==10728== by 0x41FB49: retrace::RelayRace::run() (in/usr/local/bin/glretrace)
==10728== by 0x41FD18: retrace::mainLoop() (in /usr/local/bin/glretrace)
==10728== Address 0x188 is not stack'd, malloc'd or (recently) free'd ==10728==
apitrace: warning: caught signal 11
5394: error: caught an unhandled exception
Running it without valgrind shows this:
$ glretrace gl-320-primitive-shading.trace EE r600_shader.c:345 tgsi_is_supported - unsupported src 0 (dimension 1) EE r600_shader.c:157 r600_pipe_shader_create - translation from TGSI failed ! EE r600_state_common.c:745 r600_shader_select - Failed to build shader variant (type=2) -22 EE r600_shader.c:345 tgsi_is_supported - unsupported src 0 (dimension 1) EE r600_shader.c:157 r600_pipe_shader_create - translation from TGSI failed ! EE r600_state_common.c:745 r600_shader_select - Failed to build shader variant (type=2) -22
Signature · 2 lines
You are receiving this mail because: You are the assignee for the bug.
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 74717] r600g: 'invalid read' linking geometry shader
https://bugs.freedesktop.org/show_bug.cgi?id=74717
Andreas Boll <[email protected]> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |[email protected], | |[email protected]. | |org
--- Comment #1 from Andreas Boll <[email protected]> --- I have replayed your trace and I get the following failing assertion. (mesa is compiled with --enable-debug)
glretrace: ../../src/glsl/ir.cpp:170:ir_assignment::ir_assignment(ir_dereference*, ir_rvalue*, ir_rvalue*, unsigned int): Assertion `lhs_components == this->rhs->type->vector_elements' failed.
OpenGL renderer string: Gallium 0.4 on AMD BARTS
OpenGL core profile version string: 3.3 (Core Profile) Mesa 10.2.0-devel (git-6e8d04a)
OpenGL core profile shading language version string: 3.30 OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 3.0 Mesa 10.2.0-devel (git-6e8d04a) OpenGL shading language version string: 1.30
Signature · 2 lines
You are receiving this mail because: You are the assignee for the bug.
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 74717] r600g: 'invalid read' linking geometry shader
In reply to [email protected]https://bugs.freedesktop.org/show_bug.cgi?id=74717
--- Comment #2 from Török Edwin <[email protected]> --- (In reply to comment #1)
Quoted 7 lines
I have replayed your trace and I get the following failing assertion. (mesa is compiled with --enable-debug)
glretrace: ../../src/glsl/ir.cpp:170:
ir_assignment::ir_assignment(ir_dereference*, ir_rvalue*, ir_rvalue*, unsigned int): Assertion `lhs_components ==this->rhs->type->vector_elements' failed.
I can confirm that I get the same assertion when running the original program, see backtrace below:
OpenGL Version Needed 3.2 ( 3.3 Found )
Compiling shader
gl-320/primitive-shading.vert...
Compiling shader
gl-320/primitive-shading.geom...
Compiling shader
gl-320/primitive-shading.frag...
gl-320-primitive-shading: ../../src/glsl/ir.cpp:170:ir_assignment::ir_assignment(ir_dereference*, ir_rvalue*, ir_rvalue*, unsigned int): Assertion `lhs_components == this->rhs->type->vector_elements' failed.
Program received signal SIGABRT, Aborted.0x000000382c4351d5 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0 0x000000382c4351d5 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1 0x000000382c438388 in __GI_abort () at abort.c:90
#2 0x000000382c42e252 in __assert_fail_base (fmt=0x382c56c080 "%s%s%s:%u:
%s%sAssertion `%s' failed.\n%n",
assertion=assertion@entry=0x7ffff70d6cb8 "lhs_components ==
this->rhs->type->vector_elements",
file=file@entry=0x7ffff70d6c57 "../../src/glsl/ir.cpp",
line=line@entry=170,
function=function@entry=0x7ffff70d7960<ir_assignment::ir_assignment(ir_dereference*, ir_rvalue*, ir_rvalue*, unsigned int)::__PRETTY_FUNCTION__> "ir_assignment::ir_assignment(ir_dereference*, ir_rvalue*, ir_rvalue*, unsigned int)") at assert.c:92
#3 0x000000382c42e302 in __GI___assert_fail (assertion=0x7ffff70d6cb8 "lhs_components == this->rhs->type->vector_elements",
file=0x7ffff70d6c57 "../../src/glsl/ir.cpp", line=170,
function=0x7ffff70d7960 <ir_assignment::ir_assignment(ir_dereference*,ir_rvalue*, ir_rvalue*, unsigned int)::__PRETTY_FUNCTION__> "ir_assignment::ir_assignment(ir_dereference*, ir_rvalue*, ir_rvalue*, unsigned int)") at assert.c:101
#4 0x00007ffff65950c1 in ir_assignment::ir_assignment (this=0xa4f8f0, lhs=0xa4f250, rhs=0xa4f3a0, condition=0x0, write_mask=15)
at ../../src/glsl/ir.cpp:170
#5 0x00007ffff659b9b7 in ir_assignment::clone (this=0xa42880, mem_ctx=0x79f4e0, ht=0xa4ef50) at ../../src/glsl/ir_clone.cpp:271 #6 0x00007ffff659bfcf in clone_ir_list (mem_ctx=0x79f4e0, out=0x7fffffffd8e0, in=0xa41f60) at ../../src/glsl/ir_clone.cpp:432
#7 0x00007ffff65bffe5 in (anonymous namespace)::loop_unroll_visitor::simple_unroll (this=0x7fffffffdba0, ir=0xa41f40,
iterations=3) at ../../src/glsl/loop_unroll.cpp:112
#8 0x00007ffff65c03ae in (anonymous
namespace)::loop_unroll_visitor::visit_leave (this=0x7fffffffdba0, ir=0xa41f40)
at ../../src/glsl/loop_unroll.cpp:270#9 0x00007ffff65a5633 in ir_loop::accept (this=0xa41f40, v=0x7fffffffdba0) at ../../src/glsl/ir_hv_accept.cpp:94
#10 0x00007ffff65a5505 in visit_list_elements (v=0x7fffffffdba0, l=0xa41b38, statement_list=true)
at ../../src/glsl/ir_hv_accept.cpp:56
#11 0x00007ffff65a56f5 in ir_function_signature::accept (this=0xa41af0, v=0x7fffffffdba0) at ../../src/glsl/ir_hv_accept.cpp:116
#12 0x00007ffff65a5505 in visit_list_elements (v=0x7fffffffdba0, l=0xa41a58, statement_list=false)
at ../../src/glsl/ir_hv_accept.cpp:56
#13 0x00007ffff65a5789 in ir_function::accept (this=0xa41a30, v=0x7fffffffdba0) at ../../src/glsl/ir_hv_accept.cpp:128
#14 0x00007ffff65a5505 in visit_list_elements (v=0x7fffffffdba0, l=0xa3d400, statement_list=true)
at ../../src/glsl/ir_hv_accept.cpp:56
#15 0x00007ffff65a5426 in ir_hierarchical_visitor::run (this=0x7fffffffdba0,
instructions=0xa3d400)
at ../../src/glsl/ir_hierarchical_visitor.cpp:309
#16 0x00007ffff65c065d in unroll_loops (instructions=0xa3d400, ls=0xa4f3f0,
max_iterations=255)
at ../../src/glsl/loop_unroll.cpp:345
#17 0x00007ffff6591377 in do_common_optimization (ir=0xa3d400, linked=true,
uniform_locations_assigned=false,
max_unroll_iterations=255, options=0x7ffff53a6eec) at../../src/glsl/glsl_parser_extras.cpp:1507
#18 0x00007ffff65bd46b in link_shaders (ctx=0x7ffff5385010, prog=0xa30aa0) at ../../src/glsl/linker.cpp:2172
#19 0x00007ffff64f37b7 in _mesa_glsl_link_shader (ctx=0x7ffff5385010, prog=0xa30aa0) at program/ir_to_mesa.cpp:3087
#20 0x00007ffff63f97c0 in link_program (ctx=0x7ffff5385010, program=4) at main/shaderapi.c:873
#21 0x00007ffff63fa592 in _mesa_LinkProgram (programObj=4) at main/shaderapi.c:1333
#22 0x0000000000436ea4 in initProgram() ()
#23 0x00000000004372f1 in begin() ()
#24 0x0000000000438ecb in glf::run(int, char**, glm::detail::tvec2<int, (glm::precision)0> const&, int, int, int) ()
Signature · 2 lines
You are receiving this mail because: You are the assignee for the bug.
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 74717] r600g: 'invalid read' linking geometry shader
In reply to [email protected]https://bugs.freedesktop.org/show_bug.cgi?id=74717
--- Comment #3 from [email protected] ---
G-truck samples don't work for me too (similar error for ether samples):
./gl-320-primitive-shading
OpenGL Version Needed 3.2 ( 3.3 Found )
Shader Compiler: error(high) 2: 0:1(1): error: syntax error, unexpected $end Shader Compiler: error(high) 3: 0:1(1): error: syntax error, unexpected $end Shader Compiler: error(high) 4: 0:1(1): error: syntax error, unexpected $end Compiling shader
gl-320/primitive-shading.vert...
0:1(1): error: syntax error, unexpected $end
Running Test
Test Ended
glxinfo | grep OpenGL
OpenGL vendor string: X.Org
OpenGL renderer string: Gallium 0.4 on AMD TURKS
OpenGL core profile version string: 3.3 (Core Profile) Mesa 10.2.0-devel (git-020c43f saucy-oibaf-ppa)
OpenGL core profile shading language version string: 3.30 OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 3.0 Mesa 10.2.0-devel (git-020c43f saucy-oibaf-ppa) OpenGL shading language version string: 1.30
OpenGL context flags: (none)
01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Turks XT [Radeon HD 6670/7670]
Signature · 2 lines
You are receiving this mail because: You are the assignee for the bug.
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 74717] r600g: 'invalid read' linking geometry shader
In reply to [email protected]https://bugs.freedesktop.org/show_bug.cgi?id=74717
--- Comment #4 from Török Edwin <[email protected]> --- (In reply to comment #3)
Quoted 7 lines
G-truck samples don't work for me too (similar error for ether samples):
./gl-320-primitive-shading
OpenGL Version Needed 3.2 ( 3.3 Found )
Shader Compiler: error(high) 2: 0:1(1): error: syntax error, unexpected $end Shader Compiler: error(high) 3: 0:1(1): error: syntax error, unexpected $end Shader Compiler: error(high) 4: 0:1(1): error: syntax error, unexpected $end
You need to run it from the source root, like this:
$ build/build/release/gl-320-primitive-shading
Otherwise it can't find/load the shader, and thats a shortcoming in the samples, not Mesa.
Signature · 2 lines
You are receiving this mail because: You are the assignee for the bug.
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 74717] r600g: 'invalid read' linking geometry shader
In reply to [email protected]https://bugs.freedesktop.org/show_bug.cgi?id=74717
--- Comment #5 from Török Edwin <[email protected]> --- (In reply to comment #4)
Quoted 11 lines
(In reply to comment #3)
Quoted 7 lines
G-truck samples don't work for me too (similar error for ether samples):
./gl-320-primitive-shading
OpenGL Version Needed 3.2 ( 3.3 Found )
Shader Compiler: error(high) 2: 0:1(1): error: syntax error, unexpected $end Shader Compiler: error(high) 3: 0:1(1): error: syntax error, unexpected $end Shader Compiler: error(high) 4: 0:1(1): error: syntax error, unexpected $endYou need to run it from the source root, like this:
$ build/build/release/gl-320-primitive-shading
build/release/gl-320-primitive-shading
Signature · 2 lines
You are receiving this mail because: You are the assignee for the bug.
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 74717] r600g: 'invalid read' linking geometry shader
In reply to [email protected]https://bugs.freedesktop.org/show_bug.cgi?id=74717
--- Comment #6 from [email protected] ---
(In reply to comment #5)
Quoted 4 lines
Quoted 2 lines
You need to run it from the source root, like this:
$ build/build/release/gl-320-primitive-shadingbuild/release/gl-320-primitive-shading
Right, now the examples works. Except gl-320-primitive-shading
./build/release/gl-320-primitive-shading
OpenGL Version Needed 3.2 ( 3.3 Found )
Compiling shader
gl-320/primitive-shading.vert...
Compiling shader
gl-320/primitive-shading.geom...
Compiling shader
gl-320/primitive-shading.frag...
Segmentation fault
Signature · 2 lines
You are receiving this mail because: You are the assignee for the bug.
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 74717] r600g: 'invalid read' linking geometry shader
In reply to [email protected]https://bugs.freedesktop.org/show_bug.cgi?id=74717
Michel Dänzer <[email protected]> changed:
What |Removed |Added
----------------------------------------------------------------------------
Assignee|[email protected] |[email protected]. |.org |org Component|Drivers/Gallium/r600 |Mesa core
--- Comment #7 from Michel Dänzer <[email protected]> --- Looks like a GLSL compiler issue.
Signature · 2 lines
You are receiving this mail because: You are the assignee for the bug.
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel