Summary: | Invalid read during geometry program build | ||
---|---|---|---|
Product: | Mesa | Reporter: | pavol |
Component: | glsl-compiler | Assignee: | Ian Romanick <idr> |
Status: | RESOLVED FIXED | QA Contact: | Intel 3D Bugs Mailing List <intel-3d-bugs> |
Severity: | normal | ||
Priority: | medium | CC: | pavol |
Version: | git | ||
Hardware: | x86-64 (AMD64) | ||
OS: | Linux (All) | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Attachments: |
mc
fixed mc fix for valgrind warnings MC with filtering MC with filtering zip |
Created attachment 105095 [details]
fixed mc
I have tested new version on nvidia driver and test it on mesa when I get home. In original version there was a bug where UBOs were not binded (I am not sure if KHR_debug should report this). I tested modified version and it still crashes Testing "fixed_mc" with a debug-enabled mesa build I get: Mesa: User error: GL_INVALID_ENUM in glGetString(GL_EXTENSIONS) - this is from GLFW as far as i can tell, its trying to get the extension string using the old method which is not supported in a >= 3.3 core context. Otherwise unrelated to this bug though. valgrind: ==30990== Invalid read of size 8 ==30990== at 0x9F90847: ast_interface_block::hir(exec_list*, _mesa_glsl_parse_state*) (ast_to_hir.cpp:5688) ==30990== by 0x9F875FC: _mesa_ast_to_hir(exec_list*, _mesa_glsl_parse_state*) (ast_to_hir.cpp:100) ==30990== by 0x9FDB07A: _mesa_glsl_compile_shader (glsl_parser_extras.cpp:1462) ==30990== by 0x9EB843D: compile_shader (shaderapi.c:849) ==30990== by 0x9EBA1AD: _mesa_create_shader_program (shaderapi.c:1830) ==30990== by 0x9EBA7C7: _mesa_CreateShaderProgramv (shaderapi.c:1919) ==30990== by 0x6C29EED: shared_dispatch_stub_892 (glapi_mapi_tmp.h:20555) ==30990== by 0x404B0D: main (in /recording/download/20140803/mc/mc) and a number of further errors in that function, then later the gallium state tracker throws an assertion: ../../src/mesa/state_tracker/st_glsl_to_tgsi.cpp:2104:visit: Assertion `var->data.location != -1' failed. In release mode this check drops through and the r600 tgsi translator rejects it with: EE ../../../../../../src/gallium/drivers/r600/r600_shader.c:353 tgsi_is_supported - unsupported src 0 (dimension 1) and replaces the shader with a no-op dummy shader to not crash. Basically the gallium driver layer is getting bad data out from the GLSL compiler. How do you compile the example? With "gcc mc.c `pkg-config --cflags --libs glfw3` -std=c99 -lGL -lGLEW" I'm still getting: mc.c:(.text+0x702): undefined reference to `glBufferStorage' (In reply to Tapani Pälli from comment #5) > How do you compile the example? With "gcc mc.c `pkg-config --cflags --libs > glfw3` -std=c99 -lGL -lGLEW" I'm still getting: > mc.c:(.text+0x702): undefined reference to `glBufferStorage' forget it, I got it building eventually, intel driver crashes when running this when compiling the geometry shader ... Created attachment 107763 [details] [review] fix for valgrind warnings This fix removes invalid access to the deleted resource making valgrind happy, it does not fix this bug though. (In reply to Tapani Pälli from comment #7) > Created attachment 107763 [details] [review] [review] > fix for valgrind warnings > > This fix removes invalid access to the deleted resource making valgrind > happy, it does not fix this bug though. you can simplify one if statement, here is a proof: ((!earlier && !is_gl_identifier(var->name)) || earlier == NULL) (!A && !B) || !(A != NULL) (!A && !B) || !A (!A || !A) && (!A || !B) true && (!A || !B) !A || !B hence (!earlier || !is_gl_identifier(var->name)) Scratch that; I ashamed. Was this also fixed by the fix for bug #82585? commit a909b995d95892798a189818454905fdefd4bc9b Author: Ian Romanick <ian.d.romanick@intel.com> Date: Mon Dec 1 14:07:30 2014 -0800 linker: Assign varying locations geometry shader inputs for SSO Previously only geometry shader outputs would be assigned locations if the geometry shader was the only stage in the linked program. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Cc: pavol@klacansky.com Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82585 Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> No, it just shows black screen. Created attachment 112476 [details]
MC with filtering
Created attachment 112477 [details]
MC with filtering zip
I have added nearest filtering to the 3D texture (not sure if immutable levels are handled correctly in the driver) and it works on Mac and locks gpu on linux. Can you please test it so we can close this? I will have to report separate bug for lockup. The latest example program runs on i965. If there as still issue with r600 I suggest you file a fresh bug. Yes, even software rendering works. https://bugs.freedesktop.org/show_bug.cgi?id=94179 |
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.
Created attachment 105060 [details] mc When I try to compile marching cubes geometry program I get a lot of these ==31997== Invalid read of size 8 ==31997== at 0x9B51ED0: ??? (in /usr/lib/x86_64-linux-gnu/dri/r600_dri.so) ==31997== by 0x9B49F4F: ??? (in /usr/lib/x86_64-linux-gnu/dri/r600_dri.so) ==31997== by 0x9B93E56: ??? (in /usr/lib/x86_64-linux-gnu/dri/r600_dri.so) ==31997== by 0x9A7CB2E: ??? (in /usr/lib/x86_64-linux-gnu/dri/r600_dri.so) ==31997== by 0x9A7ED00: ??? (in /usr/lib/x86_64-linux-gnu/dri/r600_dri.so) ==31997== by 0x405371: main (mc.c:155) and these EE ../../../../../../src/gallium/drivers/r600/r600_shader.c:353 tgsi_is_supported - unsupported src 0 (dimension 1) EE ../../../../../../src/gallium/drivers/r600/r600_shader.c:157 r600_pipe_shader_create - translation from TGSI failed ! EE ../../../../../../src/gallium/drivers/r600/r600_state_common.c:751 r600_shader_select - Failed to build shader variant (type=2) -22 I have attached whole program. It needs GLFW3 and GLEW.