Game Development Community

Problem getting game onto iPhone: EXC_BAD_ACCESS

by Zeinad · in iTorque 2D · 04/24/2009 (7:57 am) · 14 replies

I got my game working on the simulator yesterday, it runs smoothly in there (took me a while just to get it that far though). However, when I try to build to an iPhone I get the following error:

GDB: Program received signal: "EXC_BAD_ACCESS".

When the error happens it takes me to line 246 in stringStack.h, the middle line in this function:

void popFrame()
{
mStartStackSize = mFrameOffsets[--mNumFrames];
mStart = mStartOffsets[mStartStackSize];
mLen = 0;
}

The point at which this all happens is after the build is finished, and after it installs the game on the iPhone. The iPhone starts to load up the app, but stops on the iTGB load screen that comes up.

#1
04/24/2009 (10:13 am)
That's probably due to a mismatch in DSO versions. Make sure your DSOs are compiled with a binary that has the same flags as your iPhone build (i.e they should both either have or not have PUAP_SCRIPT_CHANGE).
#2
04/24/2009 (4:48 pm)
Where would I go and what would I do to check this?
#3
04/24/2009 (6:06 pm)
Check the build settings for your project, in XCode, you do that by double-clicking in the side bar on the target you are using.
#4
04/24/2009 (7:16 pm)
I didn't see anything there about PUAP_SCRIPT_CHANGE in either my xcode project or my xcode_iphone project, however there is a TON of information in the window that comes up when I double click the target and I am not sure exactly where in there it would be.

One thing that is really weird, I think its weird anyway, I made a totally new project in iTGB, but when I go to open the project.t2dproj file by double clicking on it it seems to open in regular TGB (no iPhone options under preferences), however when I go into where my iTGB engine is and use the Torque Game Builder app located there, and use that to open my project.t2dproj it seems to open in iTGB.
#5
04/24/2009 (10:16 pm)
.t2dproj files are tied to whichever TGB editor OS X thinks is the king right now. No way to make it choose the correct one every time when the filetypes are the same. It's best to have shortcuts in a launcher to each specific TGB editor (dock or better tools, like Overflow or Himmelbar) to make sure you start the right one. You'll see similar problems if you have beta Xcode installed in addition to the stable version.
#6
11/28/2009 (12:00 am)
I am seeing this exact problem, the same crash point. Building with iTGB 1.2 and trying to deploy to an iPhone 3.1. I've been trying for the better part of a day to see what could be mismatched. I'm still working my way through this so sorry if this is a newb question - I've dredged the boards and whatever docs I can find for the better part of a week looking before I asked.
#7
11/28/2009 (12:17 am)
Clear out everything, ensure all three important builds have the same settings (editor, desktop game app and iDevice app). Right-click the target in the tree on the left of Xcode and choose Get Info rather than going by any global settings. Make sure every single SDK matches for the iPhone builds (General and Build tab, all targets). Set it to GCC 4.0, use latest SDK and deploy to whatever minimum OS level you want to support.
#8
11/28/2009 (12:59 am)
Thank you very much - I will try to do exactly that and let you know how this works out.

UPDATE: I triple-checked all the settings, they were correct including use of gcc 4.0 (not 4.2) - I've also wiped iTGB from the mini (it unpacked into the downloads directory where I'd left it) and re-extracted it and rechecked to ensure the deploy settings were consistent but it was no better.
#9
11/28/2009 (2:08 am)
It looks this was actually a maximum load timeout condition (20 seconds had been passed) or maybe it ran out of memory and then hit maximum load time as a result. I found it in the crash log (though wierdly the crash log was not refreshed for some reason in real time, I had to close and reopen).

The actual code being run is a heavily cut-down version of the Kart Kit and I can see that someone else is reporting it just seems to have faults with SDK 3.0 and iTGB 1.2 on Snow Leopard. http://www.garagegames.com/community/forums/viewthread/98529

So it looks like the fault is not my configuration whatsoever but a faulty kit which continues to be sold without warning that it will NOT work on the iPhone. Notes like that should be on the web site - no ifs ands or buts, we bought a commercial license and this just isn't what we've paid for.

Unfortunately by all the attempts to clean up and check things, etc. something has been broken.

I am now stuck with this problem, the dreaded "Couldn't inspect the application package" even with the iPhone Test app now. I've been forced to try to use the iTGB Beta 1.3 which is ongoing. http://www.garagegames.com/community/forums/viewthread/93331

As information or a solution presents, I will try to post it here. I'm currently on 3 hours of sleep trying to do what should be simple - this isn't boding well.

Coupled with the sporadic documentation the "hit one bug then the next" and seeing the SAME reports from over half a year ago makes me very concerned we bought into a lame duck. I hope that is not the case.
#10
11/29/2009 (8:38 pm)
I resolved (finally) the issue with the "Could not inspect the application package" (details on how to fix it posted in full in the other thread).

Reverted back to 1.2 iTGB and was able to compile/launch (details in other thread).

The string issue shown is due to an issue with how XCode bundled the 3.0 SDK, using 3.1 SDK and hacking the project that is built manually to reference the 2.2.1 device target addresses it.

The modified Kart Kit code now blows out with

FATAL: ../../source/dgl/gBitmap.h@187
GetBitmap::getWidth mip level out of range (0,0)
[Cancel] [Retry]

UPDATE: Trying version 1.0 of the Kart Kit crashes slightly differently:
FATAL: /engine/compilers/XCode_iPhone/../../source/sim/actionMap.cc @ 311
Error, no key was specified!
[Cancel] [Retry]


So it's clear that this Kart genre kit is unsuited for use with iTGB and should have a warning on it as such. Vanilla code with vanilla iTGB blows up - it doesn't even launch. That's not a demo.

So far a full 2 weeks has been spent on things which (if documented at all) should have taken no more than 1-2 hours. With a price tag of $2,500 and the relative dearth of support within the forums (it seems like developers who are surviving are helping other developers who are surviving) this is not impressing me at all.

I'm at the point now where we have a second developer evaluating Unity3D and seeing if he can get an equal demo running before I do. I do not have a good feeling about this and since we do NOT want TGB itself but were forced to buy it just to have iTGB, we'll have no reusable assets after a large cash outlay if his project works out faster.

Garage Games - if any of you are reading this, you need to support your buyers. This isn't cutting it. I like your product and the potential it has to allow focus on the game itself rather than building your own engine. But if we have to constantly rewrite the engine portions or debug the hell out of basic things there's no savings and the significant cash outlay can't be justified for iPhone work.
#11
11/29/2009 (8:42 pm)
It's clearly impossible to make anything with this kit.
#12
11/29/2009 (8:47 pm)
Ronny, that would have more credibility if the Zombie Kart developer was not ALSO the developer who created the Kart Kit to begin with.

www.cascadiagames.com/blog_sep_oct_09.html

"I've submitted version 1.1 of the TGB Kart Kit to GarageGames...most of our income, however, comes from the TGB Kart Kit."

How many developers who bought that Kart Kit were able to make anything with it and iTGB? (and I refer to purchases here - not the developer of the kit who has the full source of it to start with and is as a result an expert with it).

Purchasing that kit is done by buyers in order to simplify things and provide a WORKING EXAMPLE - not something that immediately crashes.

If it's going to dump immediately and leave newer buyers struggling with trying to make anything at all from it, there should be clear warnings before blowing significant amounts of money on unusable project kits. If it ran (no matter how slowly) and required heavy optimizing - that is one thing. But not to run at all - that's not acceptable to not have a clear warning "DOES NOT WORK WITH TORQUE 2D FOR IPHONE"
#13
11/29/2009 (8:56 pm)
the part in your question that currently kind of fails is the "and iTGB" part as most expect to be able to take TGB games, put into iTGB, click to deploy and thats it, which is nowhere realistic, thus many fail.
#14
11/29/2009 (8:59 pm)
UPDATE3:
www.garagegames.com/community/forums/viewthread/105567

The developer has confirmed yes it should work directly and that he believes this is a configuration issue and will help to resolve.


There's no way I misinterpreted this - I've quoted it here:

Quote:
"The TGB Kart Kit lays the technical foundation for a "mode 7" style racing game such as F-Zero or Super Mario Kart. Engine modifications, designed for Torque Game Builder and Torque 2D for iPhone, combined with an example kart racing game enable the developer to rapidly produce a game in weeks instead of months. The kit includes two powerups, two karts, and two tracks with boosts, jumps, particle effects, animated effects, "3D" objects, waypoints, lap tracking, racer ranking, a speedometer, and more.

The example game provided --complete with script, art, and documentation-- will help you produce a prototype game within hours, instead of days or weeks. Why struggle with heavyweight solutions when you can push your racing game onto multiple platforms rapidly with this kit?

The TGB Kart Kit comes with full documentation for Torque users to modify their games' source code. The kit also comes with pre-built PC and Mac TGB 1.7.4 executables, thus TGB Pro is not required to utilize this kit."

That sure isn't my experience but it is very clear that the description SAYS it should work.

EDIT1: in fact it is so absolutely OPPOSITE my experience, I'm wondering if somehow the files downloaded were damaged in transit or something. I will re-download and re-unpack just to verify.

UPDATE2: nope, re-downloading/installing makes no difference at all. Which makes me wonder - do other people get this prototype game in the Kart Kit running on their iPhone with iTGB? Because I sure don't.

UPDATE3: the developer of the Kart Kit assures me they do on 2nd gen iPod Touch but that there are some combinations which can cause it an issue. The support group is sending a patch.


I've tried iTGB 1.3 and 1.2 and both 1.0 and 1.1 of the Kart Kit in all combinations. They all crash on startup.

- is it possibly due to some unknown in the environment, something I have or don't that is different (e.g. Snow Leopard) so I have asked the developer directly:

www.garagegames.com/community/forums/viewthread/105567