My Game is crashing after playing it for five Minutes. For debug purpose, I checked and left the game running for another 5 minutes (without touching screen) and it crashed again.
Then I checked by just loading default class that comes with the project: HelloWorld and for strange it crashed again just after 5 mins.
It seems there is bug with the Cocos2D-x? I am using cocos2d-2.1beta3-x-2.1.0
Did you just build the HelloCpp project in cocos2d-2.1beta3-x-2.1.0 and it crashed after 5 mins?
Or you copied the HelloWorldScene.* to your game project?
And what’s the platform you tested?
I used the HelloWorld file that generates by default with the project. The main culprit of crash with HelloWorld was autorelease of CCDirector.
I tested it further and removed the HelloWorld and autorelease of CCDirector this time but still game is crashing exactly after 5 min. I did couple of more test during whole night and I found that when I am using CCLayerGradient or full screen sprite image in the game then it is crashing.
To prove me wrong again, I tested it with again HelloWorld class and added a CCLayerGradient at z index = 1. The project crash just after 5 mins.
However when I check TestCpp project. It is working fine with CCLayerGradient. So definitely, I am doing something wrong here. Here is the stack trace… #0 0x031fd9de in void glgConvertTo_32<GLGConverter_ABGR8_ARGB8, (GLGMemory)2> #1 0x031fa100 in glgProcessPixelsWithProcessor #2 0x0f397173 in glGetTexImage_Exec #3 0x0f43e9f3 in gliPresentViewES #4 0x0073f884 in[EAGLContext presentRenderbuffer:] () #5 0x000bed32 in at /Volumes/Development/tools/Cocos2D-X/cocos2d-2.1beta3-x-2.1.0/TestGame/proj.ios/TestGame/TestGame/libs/cocos2dx/platform/ios/EAGLView.mm:319 #6 0x000b7402 in cocos2d::CCEGLView::swapBuffers at /Volumes/Development/tools/Cocos2D-X/cocos2d-2.1beta3-x-2.1.0/TestGame/proj.ios/TestGame/TestGame/libs/cocos2dx/platform/ios/CCEGLView.mm:70 #7 0x0003c68a in cocos2d::CCDirector::drawScene at /Volumes/Development/tools/Cocos2D-X/cocos2d-2.1beta3-x-2.1.0/TestGame/proj.ios/TestGame/TestGame/libs/cocos2dx/CCDirector.cpp:252 #8 0x0003ea3b in cocos2d::CCDisplayLinkDirector::mainLoop at /Volumes/Development/tools/Cocos2D-X/cocos2d-2.1beta3-x-2.1.0/TestGame/proj.ios/TestGame/TestGame/libs/cocos2dx/CCDirector.cpp:944 #9 0x000b6e95 in[CCDirectorCaller doCaller:] at /Volumes/Development/tools/Cocos2D-X/cocos2d-2.1beta3-x-2.1.0/TestGame/proj.ios/TestGame/TestGame/libs/cocos2dx/platform/ios/CCDirectorCaller.mm:93 #10 0x0067b2d2 in CA::Display::DisplayLink::dispatch(unsigned long long, unsigned long long) () #11 0x0067b75f in CA::Display::TimerDisplayLink::callback(CFRunLoopTimer*, void**) #12 0x02627376 inCFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION_ #13 0x02626e06 in**CFRunLoopDoTimer #14 0x0260ea82 in*_CFRunLoopRun () #15 0x0260df44 in CFRunLoopRunSpecific () #16 0x0260de1b in CFRunLoopRunInMode () #17 0x030017e3 in GSEventRunModal () #18 0x03001668 in GSEventRun () #19 0x00d4965c in UIApplicationMain () #20 0x000038d6 in main at /Volumes/Development/tools/Cocos2D-X/cocos2d-2.1beta3-x-2.1.0/TestGame/proj.ios/TestGame/TestGame/ios/main.m:14
okay I guess, I create a blank Cocos2d-x iOS project and added a GradientLayer in the HelloWorld.
The application crashes just after 5 mins. I am testing it iPad Retina emulator.
StackTrace as follows:-
#0 0x031d999a in void glgConvertTo_32<GLGConverter_ABGR8_ARGB8, (GLGMemory)2>(GLGOperationRec const**, GLDPixelModeRec const**) () #1 0x031d6100 in glgProcessPixelsWithProcessor () #2 0x0f705780 in gldRestoreTextureData () #3 0x031adaf5 in gfxUploadPluginTextureLevel () #4 0x0f5132b7 in gleSynchronizeTextureLevelOnCurrentDevicesForRead () #5 0x0f46fe26 in glGetTexImage_Exec () #6 0x0f5179f3 in gliPresentViewES () #7 0x0071b884 in ~~ #8 0x000be752 in~~[EAGLView swapBuffers] at /Volumes/Development/poc/TestProject/TestProject/libs/cocos2dx/platform/ios/EAGLView.mm:319 #9 0x000b6e22 in cocos2d::CCEGLView::swapBuffers() at /Volumes/Development/poc/TestProject/TestProject/libs/cocos2dx/platform/ios/CCEGLView.mm:70 #10 0x0003c0aa in cocos2d::CCDirector::drawScene() at /Volumes/Development/poc/TestProject/TestProject/libs/cocos2dx/CCDirector.cpp:252 #11 0x0003e45b in cocos2d::CCDisplayLinkDirector::mainLoop() at /Volumes/Development/poc/TestProject/TestProject/libs/cocos2dx/CCDirector.cpp:944 #12 0x000b68b5 in -[CCDirectorCaller doCaller:] at /Volumes/Development/poc/TestProject/TestProject/libs/cocos2dx/platform/ios/CCDirectorCaller.mm:93 #13 0x006572d2 in CA::Display::DisplayLink::dispatch(unsigned long long, unsigned long long) () #14 0x0065775f in CA::Display::TimerDisplayLink::callback(CFRunLoopTimer*, void**) #15 0x02603376 inCFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION_ #16 0x02602e06 in**CFRunLoopDoTimer #17 0x025eaa82 in*_CFRunLoopRun () #18 0x025e9f44 in CFRunLoopRunSpecific () #19 0x025e9e1b in CFRunLoopRunInMode () #20 0x02fdd7e3 in GSEventRunModal () #21 0x02fdd668 in GSEventRun () #22 0x00d2565c in UIApplicationMain () #23 0x000032f6 in main at /Volumes/Development/poc/TestProject/TestProject/ios/main.m:14 #24 0x000026b5 in start ()
The code added by me in HelloWorld::init() is as follow
@
ccColor4B startColor = ccc4(255, 255, 255, 255);
ccColor4B endColor = ccc4(255, 0, 0, 255);
CCLayerGradient **gradientLayer = CCLayerGradient::create;
this->addChild;@
Can anybody suggest or guide me what is going wrong here.
Thanks,
**Paras Mendiratta*
I tested the project our my iPad with zOrder = –1 only and it didn’t crash. I checked it about 10 mins.
Now I am checking my game over iPad again. Let’s see if that crashes too.
The game is not crashing over iPad. It is running since past 15 minutes. Looks like it was problem with emulator? not sure.
Let me run it for another 1 hour.
Yes, i couldn’t make it crash on my iphone simulator retina 4-inch now. Changing the z order to –1 also can’t make it crash. I don’t know why.
So let me know whether you game run on device crashes after one hour. Thanks.
Paras Mendiratta wrote:
@James:
>
The game is not crashing over iPad. It is running since past 15 minutes. Looks like it was problem with emulator? not sure.
Let me run it for another 1 hour.