I have the newest cocos2d, Xcode4 and iOS5 SDK. I am testing my app on my iPhone 4 (5.0.1). No crashes occur on the simulator – only on devices.
On first run, my app crashes before entering the first scene, which it does by CCTransitionFade. It crashes in CCLayer at the line:
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
If i load the app again, it boots fine – no crashes.
I removed the CCTransition and made the first scene boot up without a transition, and i received no crash on first run (great!). However, during the game there is a point where i put a colorlayer over the top of the gamescene and fade the opacity of the color layer down to 50% or so. The game crashes here.
These crashes ONLY occur if the app is being run for the first time. Both crashes have opacity fading in common. Both crashes fail at the same line, in CCLayer.
This crash occurs on iPhone 4 (iOS 5.0.1) and iPad (iOS 5.0.1), but NOT iPhone 4 (iOS 4.2.1).
Does anyone have any thoughts, ideas or suggestions? I’m at a complete loss!
debug version running on device via xcode, crash at start:
Mar 6 23:36:53 unknown Boco[10699] : cocos2d: surface size: 640×960
Mar 6 23:37:08 unknown securityd[10702] : MS:Notice: Installing: (null) [securityd] (675.00)
Mar 6 23:37:08 unknown ReportCrash[10700] : MS:Notice: Installing: (null) [ReportCrash] (675.00)
Mar 6 23:37:09 unknown ReportCrash[10700] : Formulating crash report for process Boco[10699]
Mar 6 23:37:09 unknown com.apple.launchd[1] : (UIKitApplication:com.sunlight.boco[0x79a]) Bug: launchd_core_logic.c:3730 (25147):3
Mar 6 23:37:09 unknown com.apple.launchd[1] : (UIKitApplication:com.sunlight.boco[0x79a]) Assuming job exited: : 10: No child processes
Mar 6 23:37:09 unknown com.apple.launchd[1] : (UIKitApplication:com.sunlight.boco[0x79a]) Job appears to have crashed: Segmentation fault: 11
Mar 6 23:37:09 unknown SpringBoard[10505] : Application ‘boco’ exited abnormally with signal 11: Segmentation fault: 11
Mar 6 23:37:09 unknown ReportCrash[10700] : Saved crashreport to /var/mobile/Library/Logs/CrashReporter/Boco_2012-03-06-233708_James-iPhone.plist using uid: 0 gid: 0, synthetic_euid: 501 egid: 0
release version running on device ad hoc, crashing at color layer opacity change
Mar 6 23:57:40 unknown ReportCrash[343] : MS:Notice: Installing: (null) [ReportCrash] (675.00)
Mar 6 23:57:41 unknown ReportCrash[343] : Formulating crash report for process Boco[338]
Mar 6 23:57:41 unknown com.apple.launchd[1] : (UIKitApplication:com.sunlight.boco[0xe5d6]) Job appears to have crashed: Bus error: 10
Mar 6 23:57:41 unknown SpringBoard[28] : Application ‘boco’ exited abnormally with signal 10: Bus error: 10
Mar 6 23:57:41 unknown ReportCrash[343] : Saved crashreport to /var/mobile/Library/Logs/CrashReporter/Boco_2012-03-06-235740_James-iPhone.plist using uid: 0 gid: 0, synthetic_euid: 501 egid: 0
Didn’t find a solution to this problem (see http://www.cocos2d-iphone.org/forum/topic/29958?replies=10#post-147371), so I created a new xcode project and ported all my code over. Solved the problem!