Game Development Community

iTGB error GDB: Program received signal: "EXC_BAD_ACCESS".

by Carlos G. Varela · in iTorque 2D · 08/01/2009 (8:03 am) · 26 replies

After successful compilation...(16 hours after... : )) ) when already installed on the iphone and trying to run xcode say: GDB: Program received signal: "EXC_BAD_ACCESS". The program freeze on the GG iTGB initial image.

I did can install and test the BehaviorShooter demo game, both with and without components, using SDK 3.0, I need to assign the target OS to device 3.0 in order to do that, the only way, in may case.

When I did try to the same with KartKit I did receive this error.

iTGB 1.2

Which is the correct way in order to have a game on the iphone with SDK 3.0 right now???

Thanks,

Varela
Page «Previous 1 2
#1
08/01/2009 (1:43 pm)
When you get that error, just switch to debug mode and you will get the exact call stack that lead to the crash.
#2
08/01/2009 (4:17 pm)
What Marc said...

(Tbh I'd bet you'd probably overcome this by running your TGBGame app on your mac so as to compile the .dso files necessary. A common issue for new starters to iTGB)
#3
08/02/2009 (3:21 am)
Well...
iTGB 1.2

I did run the game with TGBGame app after, after clean all builds and rebuld & go the iTGB_script_optimize.

Base SDK 3.0 for the xcode project and the same base SDK 3.0 for each target too but set the target device to SDK 2.2.1 on each target, On the Device popup menu on the top of the xcode IDE I did try with both 3.0 and 2.2.1
When I try with 3.0 I get 1 error with the GCC 4.2
When I tray with 2.2.1 it compile well, but When install the app on my iphone3G os 3.0 it say on the mobile on a messagebox that it can load main.cs, after that xcode bring me the debugger with the filestringTable.cc at line 103
...
//--------------------------------------
StringTableEntry _StringTable::insert(const char* val, const bool caseSens)
{
Node **walk, *temp;
U32 key = hashString(val);
walk = &buckets[key % numBuckets];
while((temp = *walk) != NULL) {
if(caseSens && !dStrcmp(temp->val, val))
return temp->val;
else if(!caseSens && !dStricmp(temp->val, val))
return temp->val;
walk = &(temp->next);
}
...

the line pointed is:
walk = &buckets[key % numBuckets];

and after that its say again the past error:
GDB: Program received signal: "EXC_BAD_ACCESS"

HELP!!! ; ))P

#4
08/02/2009 (4:03 am)
Make sure that, in Xcode, under the Resources folder, you have a 'Common' and a 'Game' directory, and a main.cs file. If not, drag / drop those over from the game project.
#5
08/03/2009 (2:58 am)
Yes of course, I did delete the references for thouse files and add again after compile. : (
#6
08/03/2009 (3:03 am)
I think that maybe need to be a first sdk 3.0 version for iTGB and TGB that only fix the need to compile with GCC 4.2 for example and so on... And after that incorporate the rest.
#7
08/03/2009 (10:32 am)
@Carlos: As I noted in the other forum, the kart kit will still run with 1.2. So if it's not at the very least starting up and playing, then there's an error in your setup.

The EXC_BAD_ACCESS has happened with the kit in 1.2, but only a handful of times. I suspect it may be a minor issue due to something I've done wrong.

The error I'm seeing, and mentioned to you that I'm working on fixing, is the game runs fine for the first race, then crashes early when you race a second time.
#8
08/03/2009 (11:33 am)
I have had this problem a few times and each time for the same reason, I don't know if there could be other causes or not. The problem I had was with the preprocessor macros.

Basically, the DSOs that you use need to be compiled with the same preprocessor macros that you are using to build your app, to fix this I just had to look at the macros that were being used in the xcode_iphone project as well as the regular xcode project and make sure that they were the same.

It did require me to rebuild the xcode project and use the newly built Torque Game Builder to run my game and recompile my dso files but after I got it set up I haven't had any more problems with it.
#9
08/04/2009 (1:54 am)
In my case, I can not start the game, after that I did receive the error : ((
Is the os of your iPhone the 3.0? Do you have the situation? Base sdk 3.0 and target device 2.2.1 and installing this on an iphone with os 3.0?
Somebody have the same and Is working well?
Thanks!
#10
08/04/2009 (1:57 am)
If you get an EXC_BAD_ACCESS your application has crashed.
There is no continue option or anything alike anymore if it messes that ugly.

the error is not related to the OS at all. If you switch to the debug tab when you receive the error you can look what is causing it.
#11
08/04/2009 (2:18 am)
On the post #3 as I say, the error stop in the file filestringTable.cc at line 103

the line pointed is:
walk = &buckets[key % numBuckets];

and after that its say again the past error:
GDB: Program received signal: "EXC_BAD_ACCESS"

#12
08/04/2009 (5:43 am)
You can check the callstack actually and see where it came from and especially what script it sent in that lead there.
The buckets, at least so far for me, where errors related to the networking and I haven't seen them anymore since I "if falsed" out the networking code because I don't require any networking (should I decide that I want networking above simple highscore posting, it will either be SmartFoxServer Pro or Neutron / Photon based)

The earlier you learn to work with those tools, the larger the chance that you will be able to develop a game.
#13
08/04/2009 (3:07 pm)
Well guys ; ) I have another situation. (I am gonna die, maybe eating some part of my body, a neck for ex.)
I review all my step, one by one, and did notice that I had selected "multitouch checkbox" when I hit build target device on iTGB, no network checkbox past and present, I did uncheck multitouch and now I did receive a black screen, the app is running, but in black ???
I did change everything again, base sdk 3.0 target 2.2.1, base 3 target 3, fresh copy os xcode project, etc. steell in black with all the options.
I am downloading the new upgrade from apple 3.01 for the device iphone, tomorrow more...
Thanks for all your comments!
#14
08/04/2009 (10:55 pm)
running in black sounds like your scripts were not correctly built.
did you ensure that you used the same compiler flags on itgb as you have on the desktop? or said differently: are you sure you didn't use any optimize build on the iphone as the regular DSO from TGB / TGBGame won't work without beeing recompiled with the script change flag?
#15
08/11/2009 (9:07 am)
Steel getting the same error!

EXC_BAD_ACCESS ERROR
walk = &buckets[key % numBuckets];

Now I have an iPod Touch 2.2.1, sdk 3.0 with base sdk 2.2.1 target device 2.2.1 ann the same error.

I did replace everything, iTGB again, etc. clean all dso, etc., just the fresh copy of iTGB_1_2 and the same error.
#16
08/11/2009 (10:21 am)
I agree. It sounds like you have a bad DSO. Try manually removing the DSO's and then recompiling them.
#17
08/11/2009 (11:16 am)
I supouse that i did it, with The fresh copy Of itgb, i delete all dso in the game folder and run tgbgame.app and after that i did clean build on xcode and build and debug again.

It happen with every project.
#18
08/11/2009 (1:56 pm)
When you build your game in the builder, what are you selecting for the target (optimized/script optimized/etc)?
#19
08/13/2009 (5:25 am)
Well, I did install the sdk 2.2.1 too.
I did compile iTGB and TGBGame with these options:

Torque Game Builder.app
__MACOSX__
TORQUE_DISABLE_MEMORY_MANAGER
USE_COMPONENTS
PUAP_SCRIPT_CHANGE
PUAP_OPTIMIZE

TGBGame.app
__MACOSX__
TORQUE_DISABLE_MEMORY_MANAGER
USE_COMPONENTS
TORQUE_PLAYER
PUAP_SCRIPT_CHANGE
PUAP_OPTIMIZE

I am using the iPhoneTest sample project.

I did run the CleanDSO.command and after that I did copy the TGBGamea.app into this iPhoneTest project's folder, did run the TGBGame.app and go to xcode project.
I did delete and add the main.cs, common and game files and folders.
I did clean all targets, and just build and start or debug the target optimize_script, device ipod touch 2.2.1 and steel the same error.
The only diffence into debug and release, is that with release are 2 error message on the device, the fisrt is that can't open the main.cs file and the second that can't start. On debug configuration just the second message, after that the xcode say the:

EXC_BAD_ACCESS ERROR
filestringTable.cc
line 103
walk = &buckets[key % numBuckets];

Thanks and Regards,

Varela
#20
08/17/2009 (12:43 pm)
Make sure that your targets are the same in iTGB and in the XCode project. If you are optimizing script compilation when you build the project for the iPhone, then make sure you are using the optimize profile in XCode. As Mich noted in another topic, the various profiles will be going away in the next rev since it confuses the issue and everyone really wants optimized compiles anyway.
Page «Previous 1 2