# IMGSGX535GLDriver crash

**URL:** <https://forums.imgtec.com/t/imgsgx535gldriver-crash/759>\
**Category:** PowerVR Insider\
**Created:** [July 9, 2010, 10:24pm UTC](https://forums.imgtec.com/t/imgsgx535gldriver-crash/759 "2010-07-09T22:24:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kris](https://avatars.discourse-cdn.com/v4/letter/k/82dd89/32.png) [@kris](https://forums.imgtec.com/u/kris)\
**Post date:** [July 9, 2010, 10:24pm UTC](https://forums.imgtec.com/t/imgsgx535gldriver-crash/759/1 "2010-07-09T22:24:46Z")

</div>

My app's testers&nbsp;got an intermittent crash&nbsp;from iPad w/OS 3.2 that I'm finding it difficult&nbsp;to reproduce, but I did get this callstack in the report.&nbsp; It looks like the IMGSGX535GLDriver&nbsp;is trying to compile my simple fragment shader and crashing for some reason.&nbsp; Is there anything I could have done to cause this, or is it most likely a driver bug?&nbsp; The test in question has worked under every other circumstance I know of.
  

&nbsp;
  

The only thing I can think of is that I called glReleaseShaderCompiler() long before the crash occurred.&nbsp; I assumed that since all my shaders had already been compiled at glCompileShader() time (at app init for me), shader compiler resources wouldnt be needed afterwards, so it's a bit of a mystery why the driver is trying to&nbsp;'recompiling' them later on.&nbsp;&nbsp; Does it need to do that to 'patch' every updated shader constants into the fragment program?
  

&nbsp;
  

* * *

  

0&nbsp;&nbsp; libSystem.B.dylib&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;0x000790a0 \_\_kill + 8  
1&nbsp;&nbsp; libSystem.B.dylib&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;0x00079090 kill + 4  
2&nbsp;&nbsp; libSystem.B.dylib&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;0x00079082 raise + 10  
3&nbsp;&nbsp; libSystem.B.dylib&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;0x0008d20a abort + 50  
4&nbsp;&nbsp; IMGSGX535GLDriver&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;0x0001fe96 UscAbort + 18  
5&nbsp;&nbsp; IMGSGX535GLDriver&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;0x00024620 PVRUniFlexCompileToHw + 688  
6&nbsp;&nbsp; IMGSGX535GLDriver&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;0x00017922 ppimgCompile + 986  
7&nbsp;&nbsp; IMGSGX535GLDriver&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;0x00009824 sgxUpdateCtxSysProgram + 92  
8&nbsp;&nbsp; IMGSGX535GLDriver&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;0x00009a36 glrUpdateCtxSysFragmentProgram + 234  
9&nbsp;&nbsp; IMGSGX535GLDriver&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;0x000034de glrUpdateFragmentProgramInline + 106  
10&nbsp; IMGSGX535GLDriver&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;0x000037b2 glrLoadCurrentPipelinePrograms + 626  
11&nbsp; IMGSGX535GLDriver&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;0x0000ad9c gldUpdateDispatch + 548  
12&nbsp; GLEngine&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;0x000a3f94 gleDoDrawDispatchCore + 208  
13&nbsp; GLEngine&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;0x00030360 glDrawArrays\_IMM\_Exec + 340  
14&nbsp; OpenGLES&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;0x000039c2 glDrawArrays + 26  
15&nbsp;&nbsp;mytestapp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0x0033caa0 Renderer::IPhone2xDevice::DrawTextured2DRect(Renderer::ShaderInfo const\*, bool, float, float, float, float) (iphone2xdevice.mm:401)
  

&nbsp;
  

* * *

  

&nbsp;
  

&nbsp;
  

&nbsp;
  

&nbsp;

---

<div class="post-metadata">

**Author:** ![JoeDavis](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.imgtec.com/joedavis/32/71_2.png) [@JoeDavis](https://forums.imgtec.com/u/JoeDavis)\
**Post date:** [July 30, 2010, 8:49am UTC](https://forums.imgtec.com/t/imgsgx535gldriver-crash/759/2 "2010-07-30T08:49:48Z")

</div>

Ki Kris,  
  
  
  
  
  
This is most likely a driver bug. You should submit a bug report to Apple for this.  
  
  
  
  
  
Calling glReleaseShaderCompiler mearly informs the driver that you no longer require the compiler. This gives the driver the option of releasing the compiler from memory at a later stage if additional resources are required. If at any point after calling glReleaseShaderCompiler you then call glCompileShader, the driver will load the compiler back into memory and perform the required compilation.  
  
  
  
  
  
The recompilation you are seeing here is most likely the result of a state change that has occurred that will affect the way in which the shader operates, such as enabling/disabling blending or changing the format of textures that are passed into the shader. You should be able to work around this issue by creating separate shader programs for different states, i.e. create one program for alpha blending and another for rendering opaque objects.  
  
  
  
  
  
Let me know if this helps.  
  
  
  
  
  
Regards,  
  
  
Joe
