Imagination PowerVR SDK Blog

glShaderSource deadlock based on function name


#1

(moved from wrong forum)





OGLES2_WINDOWS_X86EMULATION_2.08.28.0634 windows 7 64 (AMD x4, nvidia 480)





This was strange but I’ve found a function name with the word “main” somewhere in it causes glShaderSource to deadlock. main must be in lowercase. ie Foomain(), mainfoo(), foomainfoo(). see shader below. glsl es spec says this is ok.





For reproducible test case in the example OGLES2Shader directional_lighting.pfx rename DirectionalLight to DirectionalLightmain. glShaderSource deadlocks.





glShaderSource doesn’t compile the shader but should just do a copy so something fishy is afoot.





—valid glShaderSource —


mediump float foo(in mediump float value)


{


    return value;


}





void main(void)


{


    gl_FragColor = vec4(foo(1.0));


}





—deadlock glShaderSource —





mediump float foomain(in mediump float value)


{


    return value;


}





void main(void)


{


    gl_FragColor = vec4(foomain(1.0));


}



#2

Obviously there’s an easy workaround in this case, but I’ve reproduced this bug here (it is now issue BRN33632) and an engineer should look at it shortly.

Thanks for the report.