Engine crash on ios7

There is a 100% crash on ios7, when i use xcode5 for development and SIRI is open, when i switch to the voice input on the virtual Keyboard, cocos2d-x Engin will crash.
I also test it on v-2.1.4 and v-2.1.5.
The result is same.
could it be resolved recently?

Can you post the crash log from your device?

Date/Time: 2013-09-28 09:46:13.936 0800
OS Version: iOS 7.0.2
Report Version: 104
Exception Type: EXC_BAD_ACCESS
Exception Subtype: KERN_INVALID_ADDRESS at 0x00000000
Triggered by Thread: 0
Thread 0 Crashed:
0 libsystem_platform.dylib 0x3a04d1b4 platform_memmove$VARIANT$CortexA9 + 136
1 IMGSGX543GLDriver 0x2e01b8de glrSGXRenderVertexArray + 3190
2 GLEngine 0x31479366 glDrawElements_ACC_ES2Exec + 398
3 OpenGLES 0x314f9f28 glDrawElements + 36
4 seawar 0x0036f6c4 cocos2d::CCTextureAtlas::drawNumberOfQuads
5 seawar 0x0036f5a6 cocos2d::CCTextureAtlas::drawQuads
6 seawar 0x0035855e cocos2d::CCSpriteBatchNode::draw
7 seawar 0x00357476 cocos2d::CCSpriteBatchNode::visit
8 seawar 0x002fe216 cocos2d::CCNode::visit
9 seawar 0x003a8262 cocos2d::extension::CCScale9Sprite::visit
10 seawar 0x002fe216 cocos2d::CCNode::visit
11 seawar 0x002fe216 cocos2d::CCNode::visit
12 seawar 0x002fe216 cocos2d::CCNode::visit
13 seawar 0x002fe216 cocos2d::CCNode::visit
14 seawar 0x002fe216 cocos2d::CCNode::visit
15 seawar 0x003037c8 cocos2d::CCDirector::drawScene
16 seawar 0x00305126 cocos2d::CCDisplayLinkDirector::mainLoop
17 seawar 0x003411c4 -
18 QuartzCore 0x31746f2a CA::Display::DisplayLinkItem::dispatch + 94
19 QuartzCore 0x31746cd4 CA::Display::DisplayLink::dispatch_items + 340
20 IOMobileFramebuffer 0x3433876a IOMobileFramebufferVsyncNotifyFunc + 102
21 IOKit 0x2ffddd02 IODispatchCalloutFromCFMessage + 246
22 CoreFoundation 0x2f2bce26CFMachPortPerform + 134
23 CoreFoundation 0x2f2c79e4
CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION
_
32
24 CoreFoundation 0x2f2c797e CFRunLoopDoSource1 + 342
25 CoreFoundation 0x2f2c6152
CFRunLoopRun + 1394
26 CoreFoundation 0x2f230ce2 CFRunLoopRunSpecific + 518
27 CoreFoundation 0x2f230ac6 CFRunLoopRunInMode + 102
28 GraphicsServices 0x33f1e27e GSEventRunModal + 134
29 UIKit 0x31ad2a3c UIApplicationMain + 1132
30 seawar 0x0004e512 main (main.m:14)
31 seawar 0x00048f3c start + 36

it always crashed at the same place.

Nobody crash?

Yes, we are having this same problem. Fails every time after tapping the microphone button. Upgrading to 2.2 didn’t fix it. I’m assuming that bug 2920 is associated with this problem?

Stack trace:

0 GLEngine 0x30a9394e gleRunVertexSubmitARM + 874
1 GLEngine 0x30a91b5f gleSetVertexArrayFunc + 123
2 GLEngine 0x30a4f141 gleDrawArraysOrElements_ExecCore + 697
3 GLEngine 0x30a4d50f glDrawElements_IMM_ES2Exec + 235
4 OpenGLES 0x30acef2b glDrawElements + 38
5 WordChums 0x0020accb cocos2d::CCTextureAtlas::drawNumberOfQuads(unsigned int, unsigned int) + 147
6 WordChums 0x0020ac35 cocos2d::CCTextureAtlas::drawQuads() + 13
7 WordChums 0x00206ee5 cocos2d::CCSpriteBatchNode::draw() + 133
8 WordChums 0x002067d3 cocos2d::CCSpriteBatchNode::visit() + 71
9 WordChums 0x001e5839 cocos2d::CCNode::visit() + 161
10 WordChums 0x001e5839 cocos2d::CCNode::visit() + 161
11 WordChums 0x001e57ff cocos2d::CCNode::visit() + 103
12 WordChums 0x00105333 CCGameScene::visit() (GameScene.cpp:204)
13 WordChums 0x001e5839 cocos2d::CCNode::visit() + 161
14 WordChums 0x001e6f47 cocos2d::CCDirector::drawScene() + 67
15 WordChums 0x001e7935 cocos2d::CCDisplayLinkDirector::drawScene() + 17
16 WordChums 0x001e78e9 cocos2d::CCDisplayLinkDirector::mainLoop() + 41
17 WordChums 0x001fb7df -[CCDirectorCaller doCaller:] + 15
18 QuartzCore 0x30d1bf2f CA::Display::DisplayLinkItem::dispatch() + 99
19 QuartzCore 0x30d1bcd9 CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) + 345
20 IOMobileFramebuffer 0x3390976d IOMobileFramebufferVsyncNotifyFunc + 105
21 IOKit 0x2f5b2d05 IODispatchCalloutFromCFMessage + 248
22 CoreFoundation 0x2e891e29 CFMachPortPerform + 137
23 CoreFoundation 0x2e89c9e7
CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION*_ + 35
24 CoreFoundation 0x2e89c983**CFRunLoopDoSource1 + 347
25 CoreFoundation 0x2e89b157*_CFRunLoopRun + 1399
26 CoreFoundation 0x2e805ce7 CFRunLoopRunSpecific + 522
27 CoreFoundation 0x2e805acb CFRunLoopRunInMode + 106
28 GraphicsServices 0x334ef283 GSEventRunModal + 138
29 UIKit 0x310a7a41 UIApplicationMain + 1136
30 WordChums 0x00051c67 main (main.m:8)
31 WordChums 0x00009a98 start + 40

yes ,it is!

Is there any workaround?

Try set CC_REBIND_INDICES_BUFFER 1

reason maybe because of this.
http://stackoverflow.com/questions/6240863/use-of-vao-around-vbo-in-open-es-iphone-app-causes-exc-bad-access-when-call-to-g

@Nite Luo, thanks for the suggestion. We changed CCPlatformMacros.h to make sure

#define CC_REBIND_INDICES_BUFFER 1
always gets hit. But it did not seem to make a difference.

We have created #2920 for this issue. We don’t know how to fix it now.

The reason of the crash is:
1 siri creates opengl context in Main Thread, and create shader attach to this context
2 c2dx call mainLoop in the following steps, but it used the context generated by siri, so the shader/buffer/texture, is unable to find.

The fix is simple, just add this line in CCDirectorCaller.mm
-(void) doCaller: (id) sender
{
//add following line
[EAGLContext setCurrentContext: [[EAGLView sharedEGLView] context]];
cocos2d::CCDirector::sharedDirector()->mainLoop();
}

@cong ling
Thanks for sharing. We will checkout it ASAP.

It works. And there is a pull request for it https://github.com/cocos2d/cocos2d-x/pull/5263.