RenderTextureTest crashing on retina iPad simulator

Hello,

I’m using Xcode 4.4.1 (4F1003) on OS X 10.8.1 with cpu 1.8 GHz Intel Core i5 and 4GB of ram. Cocos2D-X version is cocos2d-2.0-x-2.0.2.

After the following steps:

  1. Launch TestCpp on iOS Simulator - iPad (retina), either iOS 5.0 or iOS 5.1

  2. Choose RenderTextureTest from the menu

  3. Wait

The code crashes. On my system it always happens after 5 minutes. Here is the log output with with the stack trace I printed form the debugger:

2012-09-21 15:35:23.733 TestCpp[49030:c07] cocos2d: surface size: 1024x768
Cocos2d: cocos2d: cocos2d-2.0-x-2.0.2
Cocos2d: cocos2d: GL_VENDOR:     Apple Computer, Inc.
Cocos2d: cocos2d: GL_RENDERER:   Apple Software Renderer
Cocos2d: cocos2d: GL_VERSION:    OpenGL ES 2.0 APPLE
Cocos2d: cocos2d: GL_MAX_TEXTURE_SIZE: 4096
Cocos2d: cocos2d: GL_MAX_TEXTURE_UNITS: 8
Cocos2d: cocos2d: GL supports PVRTC: YES
Cocos2d: cocos2d: GL supports BGRA8888 textures: NO
Cocos2d: cocos2d: GL supports NPOT textures: YES
Cocos2d: cocos2d: GL supports discard_framebuffer: YES
Cocos2d: cocos2d: GL supports shareable VAO: YES
Cocos2d: cocos2d: compiled with Profiling Support: NO
2012-09-21 15:35:23.831 TestCpp[49030:c07] cocos2d: surface size: 2048x1536
Cocos2d: cocos2d: CCTextureCache: texture: /Users/pfedor/Library/Application Support/iPhone Simulator/5.1/Applications/D066F7B2-1111-4176-9456-C191FB9F29DF/TestCpp.app/Images/close.png
(lldb) bt
* thread #1: tid = 0x1c03, 0x1262418a, stop reason = EXC_??? (11) (code=0, subcode=0x0)
    frame #0: 0x1262418a
    frame #1: 0x126224ad
    frame #2: 0x07f5c062 GLRendererFloat`gldRenderFillPolygonPtr + 90
    frame #3: 0x1262116b
    frame #4: 0x0ed44321 GLEngine`gleDrawArraysOrElements_ExecCore + 962
    frame #5: 0x0ed41a26 GLEngine`glDrawArrays_IMM_ES2Exec + 286
    frame #6: 0x0152dc7c OpenGLES`glDrawArrays + 57
    frame #7: 0x001ecdbe TestCpp`cocos2d::CCSprite::draw() + 750 at CCSprite.cpp:605
    frame #8: 0x0015e256 TestCpp`cocos2d::CCNode::visit() + 390 at CCNode.cpp:737
    frame #9: 0x0015e233 TestCpp`cocos2d::CCNode::visit() + 355 at CCNode.cpp:731
    frame #10: 0x0015e1d3 TestCpp`cocos2d::CCNode::visit() + 259 at CCNode.cpp:716
    frame #11: 0x0015e233 TestCpp`cocos2d::CCNode::visit() + 355 at CCNode.cpp:731
    frame #12: 0x00161f29 TestCpp`cocos2d::CCDirector::drawScene() + 153 at CCDirector.cpp:229
    frame #13: 0x0016420b TestCpp`cocos2d::CCDisplayLinkDirector::mainLoop() + 75 at CCDirector.cpp:968
    frame #14: 0x001c9b45 TestCpp`-[CCDirectorCaller doCaller:] + 37 at CCDirectorCaller.mm:93
    frame #15: 0x0177b12f QuartzCore`CA::Display::DisplayLink::dispatch(unsigned long long, unsigned long long) + 105
    frame #16: 0x0177b003 QuartzCore`CA::Display::TimerDisplayLink::callback(__CFRunLoopTimer*, void*) + 161
    frame #17: 0x0225e936 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 22
    frame #18: 0x0225e3d7 CoreFoundation`__CFRunLoopDoTimer + 551
    frame #19: 0x021c1790 CoreFoundation`__CFRunLoopRun + 1888
    frame #20: 0x021c0d84 CoreFoundation`CFRunLoopRunSpecific + 212
    frame #21: 0x021c0c9b CoreFoundation`CFRunLoopRunInMode + 123
    frame #22: 0x028c67d8 GraphicsServices`GSEventRunModal + 190
    frame #23: 0x028c688a GraphicsServices`GSEventRun + 103
    frame #24: 0x009e5626 UIKit`UIApplicationMain + 1163
    frame #25: 0x00002c6f TestCpp`main + 95 at main.m:17
    frame #26: 0x00002c05 TestCpp`start + 53
(lldb) 

I am new to Xcode and iOS development so I don’t really know how to debug it any further. Any help would be very much appreciated since I have the same problem in my own app which uses CCRenderTexture.

Thanks,

Aleksander

Pawel Aleksander Fedorynski wrote:

Hello,
>
I’m using Xcode 4.4.1 (4F1003) on OS X 10.8.1 with cpu 1.8 GHz Intel Core i5 and 4GB of ram. Cocos2D-X version is cocos2d-2.0-x-2.0.2.
>
After the following steps:
>

  1. Launch TestCpp on iOS Simulator - iPad (retina), either iOS 5.0 or iOS 5.1
    >
  2. Choose RenderTextureTest from the menu
    >
  3. Wait
    >
    The code crashes. On my system it always happens after 5 minutes. Here is the log output with with the stack trace I printed form the debugger:
    >
    […]
    >
    I am new to Xcode and iOS development so I don’t really know how to debug it any further. Any help would be very much appreciated since I have the same problem in my own app which uses CCRenderTexture.
    >
    Thanks,
    >
    Aleksander

I upgraded to Xcode 4.5 and the problem’s still there (both with iOS 5.1 and 6.0 simulator.)

After poking at it some more, I noticed that the crash happens even if I don’t select any test, just launch TestCpp and wait five minutes (with iPad retina simulator.) The log and stack trace for that case:

2012-09-21 17:54:22.710 TestCpp[50845:c07] cocos2d: surface size: 1024x768
Cocos2d: cocos2d: cocos2d-2.0-x-2.0.2
Cocos2d: cocos2d: GL_VENDOR:     Apple Computer, Inc.
Cocos2d: cocos2d: GL_RENDERER:   Apple Software Renderer
Cocos2d: cocos2d: GL_VERSION:    OpenGL ES 2.0 APPLE
Cocos2d: cocos2d: GL_MAX_TEXTURE_SIZE: 4096
Cocos2d: cocos2d: GL_MAX_TEXTURE_UNITS: 8
Cocos2d: cocos2d: GL supports PVRTC: YES
Cocos2d: cocos2d: GL supports BGRA8888 textures: NO
Cocos2d: cocos2d: GL supports NPOT textures: YES
Cocos2d: cocos2d: GL supports discard_framebuffer: YES
Cocos2d: cocos2d: GL supports shareable VAO: YES
Cocos2d: cocos2d: compiled with Profiling Support: NO
2012-09-21 17:54:22.754 TestCpp[50845:c07] cocos2d: surface size: 2048x1536
(lldb) bt
* thread #1: tid = 0x1c03, 0x12501a24, stop reason = EXC_??? (11) (code=0, subcode=0x0)
    frame #0: 0x12501a24
    frame #1: 0x125014ad
    frame #2: 0x0d2e7d59 GLRendererFloat`gldRenderFillTriangleStrip + 150
    frame #3: 0x125000e9
    frame #4: 0x0ea81321 GLEngine`gleDrawArraysOrElements_ExecCore + 962
    frame #5: 0x0ea7ea26 GLEngine`glDrawArrays_IMM_ES2Exec + 286
    frame #6: 0x0153ec7c OpenGLES`glDrawArrays + 57
    frame #7: 0x001eda2e TestCpp`cocos2d::CCSprite::draw() + 750 at CCSprite.cpp:605
    frame #8: 0x0015eea6 TestCpp`cocos2d::CCNode::visit() + 390 at CCNode.cpp:737
    frame #9: 0x0015ee83 TestCpp`cocos2d::CCNode::visit() + 355 at CCNode.cpp:731
    frame #10: 0x0015ee83 TestCpp`cocos2d::CCNode::visit() + 355 at CCNode.cpp:731
    frame #11: 0x0015ee83 TestCpp`cocos2d::CCNode::visit() + 355 at CCNode.cpp:731
    frame #12: 0x0015ee83 TestCpp`cocos2d::CCNode::visit() + 355 at CCNode.cpp:731
    frame #13: 0x00162b79 TestCpp`cocos2d::CCDirector::drawScene() + 153 at CCDirector.cpp:229
    frame #14: 0x00164e5b TestCpp`cocos2d::CCDisplayLinkDirector::mainLoop() + 75 at CCDirector.cpp:968
    frame #15: 0x001ca7a5 TestCpp`-[CCDirectorCaller doCaller:] + 37 at CCDirectorCaller.mm:93
    frame #16: 0x0178c12f QuartzCore`CA::Display::DisplayLink::dispatch(unsigned long long, unsigned long long) + 105
    frame #17: 0x0178c003 QuartzCore`CA::Display::TimerDisplayLink::callback(__CFRunLoopTimer*, void*) + 161
    frame #18: 0x0226f936 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 22
    frame #19: 0x0226f3d7 CoreFoundation`__CFRunLoopDoTimer + 551
    frame #20: 0x021d2790 CoreFoundation`__CFRunLoopRun + 1888
    frame #21: 0x021d1d84 CoreFoundation`CFRunLoopRunSpecific + 212
    frame #22: 0x021d1c9b CoreFoundation`CFRunLoopRunInMode + 123
    frame #23: 0x028d77d8 GraphicsServices`GSEventRunModal + 190
    frame #24: 0x028d788a GraphicsServices`GSEventRun + 103
    frame #25: 0x009f6626 UIKit`UIApplicationMain + 1163
    frame #26: 0x00002cdf TestCpp`main + 95 at main.m:17
    frame #27: 0x00002c35 TestCpp`start + 53
(lldb)

This does not happen as reliably as the RenderTextureTest crash but happens most of the time for me.

The crash does not happen for some of the other tests I tried (ActionsTest, DrawPrimitivesTest.)

Thanks,

Aleksander

same issue happens to me, if you start your app direct from simulator, it won’t crash, but if you start from xcode to launch the app in simulator, it will crash. I guess it might be the xcode problem.

Same thing here, has anybody figured this out yet?