[Bug 74717] New: r600g: 'invalid read' linking geometry shader

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Sat Feb 8 09:49:07 PST 2014


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

          Priority: medium
            Bug ID: 74717
                CC: airlied at freedesktop.org
          Assignee: dri-devel at lists.freedesktop.org
           Summary: r600g: 'invalid read' linking geometry shader
          Severity: normal
    Classification: Unclassified
                OS: All
          Reporter: edwin+mesa at etorok.net
          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

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20140208/e16fc2fc/attachment.html>


More information about the dri-devel mailing list