EXC_BAD_ACCESS at gleRunVertexSubmitARM()

hi, i’ve got an interesting issue. neither me nor my colleagues can give any key during hours of debugging.

it happens at certain gameplay moment 1 of 3 times. at the time it happens I add one CCLayer and remove another one. game code seemds to be transparent and clean. the point is that crash can be fixed in a few different ways:

  1. do not manually remove CCMenu from the removed layer (it will be done later through removing childs of the CCLayer).
  2. change CCScale9Sprites from the removed layer on simple CCSrites.
  3. drop CC_ENABLE_GL_STATE_CACHE to 0.

main-thread’s stack on crash:
0 gleRunVertexSubmitARM
1 gleSetVertexArrayFunc

no other user’s thread is active during crash. PC build seems to work out this moment, crash happens only at iOS builds (5.0+, iPhone 3g, iPhone 5).

I’ll appreciate any information according to the issue.