[Mesa-dev] Google Earth + glReleaseShaderCompiler problem

Brian Paul brianp at vmware.com
Tue Nov 27 11:03:18 PST 2012


Google Earth v7 calls glReleaseShaderCompiler() and Mesa's GLSL 
compiler is crashing.

In particular, it looks like glReleaseShaderCompiler() is getting 
called between glCompileShader() and glLinkProgram().  The 
glLinkProgram() call crashes when we try to reference some data 
structures which were freed by glReleaseShaderCompiler().

Here's an example from valgrind:

==10049== Invalid read of size 4
==10049==    at 0x14FE4B9C: ir_call::ir_call(ir_function_signature*, 
ir_dereference_variable*, exec_list*) (ir.h:1135)
==10049==    by 0x14FEC269: ir_call::clone(void*, hash_table*) const 
(ir_clone.cpp:181)
==10049==    by 0x14FEC97A: ir_function_signature::clone(void*, 
hash_table*) const (ir_clone.cpp:313)
==10049==    by 0x14FEC8A3: ir_function::clone(void*, hash_table*) 
const (ir_clone.cpp:290)
==10049==    by 0x14FECDDA: clone_ir_list(void*, exec_list*, exec_list 
const*) (ir_clone.cpp:433)
==10049==    by 0x14F0750C: link_intrastage_shaders(void*, 
gl_context*, gl_shader_program*, gl_shader**, unsigned int) 
(linker.cpp:1062)
==10049==    by 0x14F09B5E: link_shaders(gl_context*, 
gl_shader_program*) (linker.cpp:2471)
==10049==    by 0x1500064C: _mesa_glsl_link_shader (ir_to_mesa.cpp:3155)
==10049==    by 0x14F96F36: link_program (shaderapi.c:758)
==10049==    by 0x14F98165: _mesa_LinkProgram (shaderapi.c:1254)
==10049==    by 0x8927796: 
Gap::Gfx::GL2VertexShader::LinkPixelShader(unsigned int) (in 
/opt/google/earth/free/libIGGfx.so)
==10049==    by 0x893F9B2: 
Gap::Gfx::GL2VertexShader::bind(Gap::Gfx::igOglVisualContext*) (in 
/opt/google/earth/free/libIGGfx.so)
==10049==  Address 0x8fd6cf0 is 40 bytes inside a block of size 80 free'd
==10049==    at 0x402768C: free (in 
/usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==10049==    by 0x14EFB640: unsafe_free (ralloc.c:245)
==10049==    by 0x14EFB610: unsafe_free (ralloc.c:238)
==10049==    by 0x14EFB610: unsafe_free (ralloc.c:238)
==10049==    by 0x14EFB55B: ralloc_free (ralloc.c:208)
==10049==    by 0x14F02BB3: _mesa_glsl_release_functions() 
(builtin_function.cpp:14643)
==10049==    by 0x14EE7D95: _mesa_destroy_shader_compiler_caches 
(glsl_parser_extras.cpp:1101)
==10049==    by 0x14F987CC: _mesa_ReleaseShaderCompiler (shaderapi.c:1491)
==10049==    by 0x891206C: 
Gap::Gfx::GL2Shader::CompileShader(Gap::Gfx::igOglVisualContext*, 
unsigned int, char const*) (in /opt/google/earth/free/libIGGfx.so)
==10049==    by 0x89470A5: 
Gap::Gfx::GL2VertexShader::CreateVertexShader(Gap::Gfx::igOglVisualContext*, 
char const*, Gap::Gfx::igVertexDataList const*, 
Gap::Gfx::igGfxShaderConstantList const*) (in 
/opt/google/earth/free/libIGGfx.so)
==10049==    by 0x894EC64: 
Gap::Gfx::igOglVisualContext::createVertexShader_GL2(char const*, 
Gap::Gfx::igVertexDataList const*, Gap::Gfx::igGfxShaderConstantList 
const*) (in /opt/google/earth/free/libIGGfx.so)
==10049==    by 0x8916479: 
Gap::Gfx::igOglVisualContext::createVertexShader_OGL(char const*, 
Gap::Gfx::IG_GFX_SHADER_LANGUAGE, Gap::Gfx::igVertexDataList const*, 
Gap::Gfx::igGfxShaderConstantList const*, char const*, char const*, 
Gap::Gfx::igGfxShaderDefineList const*) (in 
/opt/google/earth/free/libIGGfx.so)
==10049==


I've hacked several other Mesa GLSL tests to call 
glReleaseShaderCompiler() between compile and link and get similar 
results.

Can someone look into fixing this?

-Brian



More information about the mesa-dev mailing list