Xcode error at runtime: "EXC_BAD_ACCESS"
by Conor O'Kane · in iTorque 2D · 01/22/2009 (5:17 pm) · 13 replies
Since changing provisioning profiles in Xcode I am now getting a runtime error when I play my game on hardware...
GDB: Program received signal: "EXC_BAD_ACCESS"
compiledEval.cc line 2933 is highlighted, it reads:
if(currentNewObject->isProperlyAdded() == false
The changing provisioning profiles may be totally unrelated. I've seen this error before, but it always went away if I rebuilt the .dsos and ran the game again.
GDB: Program received signal: "EXC_BAD_ACCESS"
compiledEval.cc line 2933 is highlighted, it reads:
if(currentNewObject->isProperlyAdded() == false
The changing provisioning profiles may be totally unrelated. I've seen this error before, but it always went away if I rebuilt the .dsos and ran the game again.
About the author
www.cokane.com
#2
01/23/2009 (5:02 am)
Thanks Dale. I tried loading up the behavior shooter and it gives the same error! So there must be something wrong with my Xcode project and not my game.
#3
ps : its FuzzY , not dale :P
01/23/2009 (5:20 am)
Ah, i see. It might be that the resources/dependencies arent being compiled?? what i found is to right click on the "common" folders INSIDE of xcode, and say compile. ps : its FuzzY , not dale :P
#4
Also, when I launch the game from the iPod by pressing the icon, it displays the loading screen (default.png) and then quits back to the home screen.
01/23/2009 (5:26 am)
I restored my Xcode project from the iTGB 1.1 download and the EXC_BAD_ACCESS error on loading has gone away - however I now get one when I quit the game! When I press the home button the game freezes (with the music looping about half a second of audio) and Xcode shows another EXC_BAD_ACCESS error.Also, when I launch the game from the iPod by pressing the icon, it displays the loading screen (default.png) and then quits back to the home screen.
#5
01/23/2009 (5:44 am)
thats weird, if you have the device connected to XCode, find the console. The itge might not be able to print to the console.log file, but the console is still printed to debug in xcode, allowing you to read whats happening at run time. You can real time debug which is real nice on mobile, try breaking at "onShutdown" or the end of load level, etc... stepping through each line checking whats up
#6
01/23/2009 (6:49 am)
I didn't realise you could view the console when running on the device. How is that done?
#7
01/23/2009 (11:18 am)
Using the GDB output window. You need to call enableDebugOutput( true ); somewhere in your game, and form then on it'll output.
#8
The Debugger console shows:
TGBGame_Optimize1 : -missing2 : -this
performing mainInit()
Program received signal: "EXC_BAD_ACCESS".
It's not even getting to the stage where it begins to run any torquescript.
In Debug mode it is loading ok and the TGB console is echoing to the debugger window, but it's around 10 frames per second slower, so not much good for real tuning.
01/23/2009 (9:07 pm)
Sigh - my 'fix' was a false alarm. The game is only running when I run it in debug mode. When I switch to release mode it fails on startup with EXC_BAD_ACCESS still.The Debugger console shows:
TGBGame_Optimize1 : -missing2 : -this
performing mainInit()
Program received signal: "EXC_BAD_ACCESS".
It's not even getting to the stage where it begins to run any torquescript.
In Debug mode it is loading ok and the TGB console is echoing to the debugger window, but it's around 10 frames per second slower, so not much good for real tuning.
#9
mainInit() is where it starts all the Torque systems(platform, input, console, etc..) if I recall correctly, so one of them might be having a fatal error, you might check which one doesn't init properly.
01/23/2009 (9:59 pm)
If it runs OK in simulator, but crashes on the device, it's more than likely using too much memory.mainInit() is where it starts all the Torque systems(platform, input, console, etc..) if I recall correctly, so one of them might be having a fatal error, you might check which one doesn't init properly.
#10
If I run it on the simulator in release or debug mode I get "Error from Debugger: Failed to launch simulated application: Unknown error."
It only runs on hardware in debug mode.
My game runs fine on Windows and Mac in iTGB.
01/23/2009 (11:26 pm)
Thanks Mat. The game is only 6Mb in total so it's unlikely to be a memory issue.If I run it on the simulator in release or debug mode I get "Error from Debugger: Failed to launch simulated application: Unknown error."
It only runs on hardware in debug mode.
My game runs fine on Windows and Mac in iTGB.
#11
01/24/2009 (5:48 am)
Reinstalled Xcode, iPhone SDK and iTGB and now it works ok in release mode. phew!
#12
02/04/2009 (7:00 am)
glad to hear it, and to clear something up , when the device runs out of memory you can know by the error status 101 on exit
#13
05/26/2009 (12:22 am)
I just got this error too.... the only thing I did was $pref::iPhone::enableMultipleTouch = true; from false. I am going to see if I can build in release mode like mentioned above, bug maybe with enabling multitouch?
Torque Owner Dale Best
Default Studio Name
This error is simply saying its trying to access a null pointer. Step through the code at that point and see what exactly its trying to access. When you have found what it is, its normally missing datablocks, or missing files (cos it doesnt make dsos ON the device, as suggested.) EXC_BAD_ACCESS = null pointer