BUG: iTGB 1.2 - Setting Target to iTGB_Script_Optimize results in EXC_BAD_ACCESS
by Geoff Rowland · in iTorque 2D · 05/12/2009 (10:32 am) · 19 replies
It seems if you try to compile using the iTGB_Script_Optimize Target and Executable, it will crash when deployed to the iPhone on line 246 of stringStack.h. I believe this also happens when using the iTGB_Script target. It does not happen with the iTGB target.
This happens on a clean installation of iTGB 1.2 while using the Behavior Shooter Components as the game.
This happens on a clean installation of iTGB 1.2 while using the Behavior Shooter Components as the game.
About the author
Recent Threads
#2
05/12/2009 (10:56 am)
Interesting, as I am using behavior shooter that is included in the 1.2 distro. I will try cleaning DSOs first.
#3
edit: see below for the proper flag name :) I couldn't remember off the top of my head
05/12/2009 (10:59 am)
Just to clarify: Do a build for your Mac with the script_optimize flag, create your DSOs with that and then deploy to your iPhone.edit: see below for the proper flag name :) I couldn't remember off the top of my head
#4
05/12/2009 (11:04 am)
So it seems the script_optimize flag is not set by default for the OSX app (it is for 1.1) and like you said, that is probably causing the problem.
#5
05/12/2009 (11:08 am)
Yea I opened a defect for this. The OS X TGBGame needs to be built with the same flags/optimizations as the iPhone project. This way your application behaves consistently on the MAC/iphone during development. Additionally the dso's need to be compatible which requires them to be built the with at least the same PUAP_SCRIPT_CHANGE flag.
#6
If I run the Torque Game Builder app - it will start up with the flag set - it hangs once I try and open a project. If I remove the PUAP_SCRIPT_CHANGE flag, I can open projects without issue.
anyone else run into this problem? This is using a clean version of 1.2
05/12/2009 (1:07 pm)
if I enable PUAP_SCRIPT_CHANGE for the OSX apps, they hang and eventually crash. It makes my mac mini so unresponsive it isn't possible to debug what is going on.If I run the Torque Game Builder app - it will start up with the flag set - it hangs once I try and open a project. If I remove the PUAP_SCRIPT_CHANGE flag, I can open projects without issue.
anyone else run into this problem? This is using a clean version of 1.2
#7
05/12/2009 (1:10 pm)
Actually, You know what Geoff, I ran into that same problem. I have all the same flags except PUAP_SCRIPT_CHANGE enabled on TGB and TGBGame builds, but have that enabled on my iphone build. So I wonder how the DSO files are getting created correctly?
#8
05/12/2009 (1:23 pm)
I was finding on a PC if I enabled PUAP_SCRIPT_CHANGE for TorqueGameBuilder project it would compile but it would hang every time I tried to use it. Instead I just added PUAP_OPTIMIZE and everything worked fine for me.
#9
If not, I will log this.
05/30/2009 (1:12 pm)
@All - Has this issue persisted? Any change in replicating this problem or has anyone found a fix to post yet?If not, I will log this.
#11
I haven't seen anybody figure out how to resolve it yet (but somebody please correct me if I'm wrong, I'd be interested to see how my game runs with this target), I think all of us just switch over to the iTGB_Optimize target.
05/31/2009 (9:45 am)
@Michael,I haven't seen anybody figure out how to resolve it yet (but somebody please correct me if I'm wrong, I'd be interested to see how my game runs with this target), I think all of us just switch over to the iTGB_Optimize target.
#12
05/31/2009 (10:30 am)
I did not spent any time trying to track down what the issue was since I decided not to update to 1.2 for our game, however can confirm that the issue still exists in a clean build of 1.2
#13
(the details to the issue was originally mentioned on www.garagegames.com/community/forums/viewthread/91189/1#comment-619085 -> issue #2)
Please log this and fix it soon!
Thanks!
06/01/2009 (9:56 am)
I have also seen this issue ever since I upgraded to v1.2 and like Justin said, I just switched over to iTGB_Optimize for the time being.(the details to the issue was originally mentioned on www.garagegames.com/community/forums/viewthread/91189/1#comment-619085 -> issue #2)
Please log this and fix it soon!
Thanks!
#14
06/08/2009 (8:02 am)
arhhh....... this one got me too...
#15
I know there is a thread with more info about these flags but I can't recall which one off the top of my head. The preprocessor macros I am using right now are:
__IPHONE__
TORQUE_PLAYER
TORQUE_RELEASE
TORQUE_DISABLE_MEMORY_MANAGER
PUAP_SCRIPT_CHANGE
PUAP_OPTIMIZE
USE_COMPONENTS
To get it working I just set up all targets to have all of these. Also note that by default the 'R' is missing off of the memory_manager one so be sure to add that on as well.
06/08/2009 (11:45 am)
I am using the iTGB_Script_Optimize target, if I recall correctly what I had to do was change the preprocessor macros on the target to be the same as they are for the target in the xcode project for the mac.I know there is a thread with more info about these flags but I can't recall which one off the top of my head. The preprocessor macros I am using right now are:
__IPHONE__
TORQUE_PLAYER
TORQUE_RELEASE
TORQUE_DISABLE_MEMORY_MANAGER
PUAP_SCRIPT_CHANGE
PUAP_OPTIMIZE
USE_COMPONENTS
To get it working I just set up all targets to have all of these. Also note that by default the 'R' is missing off of the memory_manager one so be sure to add that on as well.
#16
In that same area, I've decided to reduce the number of targets for the Xcode_iPhone project to 1. There is no point to allowing the toggle of optimizations. From here on the engine will be running on full optimization mode (PUAP_OPTIMIZE and PUAP_SCRIPT_CHANGE).
Because there are certain quirks or hassles, such as having to call setUsesPhysics() on every object, I'm going to expose the flexibility in the editor itself. Instead of calling that function in every behavior or separate script, a T2DSceneObject in your level will have a new checkbox that enables/disables the calling of physics.
The Torque 2D team is already working their engine, so we are passing optimizations back and forth at this point. Both systems are going to benefit from each other now that they are being developed concurrently.
06/24/2009 (3:05 pm)
At this very minute, I am unifying the targets and their preproc flags. The Mac Xcode project (for the builder and base game) will still have the four targets (Debug_Builder, Release_Builder, Debug_Game, Release_Game). However, all four of those will be using the same flags as what the Xcode_iPhone project will be using.In that same area, I've decided to reduce the number of targets for the Xcode_iPhone project to 1. There is no point to allowing the toggle of optimizations. From here on the engine will be running on full optimization mode (PUAP_OPTIMIZE and PUAP_SCRIPT_CHANGE).
Because there are certain quirks or hassles, such as having to call setUsesPhysics() on every object, I'm going to expose the flexibility in the editor itself. Instead of calling that function in every behavior or separate script, a T2DSceneObject in your level will have a new checkbox that enables/disables the calling of physics.
The Torque 2D team is already working their engine, so we are passing optimizations back and forth at this point. Both systems are going to benefit from each other now that they are being developed concurrently.
#17
06/24/2009 (11:03 pm)
Sweet news, Michael. Just got an unexpected EXC_BAD_ACCESS and I'm literally banging my head over all the optimization flags and settings.
#18
07/10/2009 (9:00 am)
EXC_BAD_ACCESS can also show up if you have installed iphone SDK 3.0 and haven't set the build targets correctly. If you have 3.0 SDK installed a quick fix is to set project Base SDK as 3.0 and Deployment Target as 2.2.1 or 2.x. Obviously GCC 4.2 introduced some weirdness into the build process.
#19
you only have to ensure that the gcc version is 4.0 if it didn't happen automatically.
building it as 2.x with base sdk 3 makes little sense as you build it against 3.0 libraries
07/11/2009 (10:44 am)
I can easily build for 2.x with a 2.x base sdk, no prob there.you only have to ensure that the gcc version is 4.0 if it didn't happen automatically.
building it as 2.x with base sdk 3 makes little sense as you build it against 3.0 libraries
Associate Craig Fortune
Sounds like your DSOs are of an old version. Using a script optimized build requires your DSOs to be compiled with a similarly setup build.