msgBox.cpp @ 50 app freeze
by rennie moffat · in iTorque 2D · 09/27/2010 (3:27 pm) · 40 replies
Hi there,
I just got a major issue I am hoping I can have remedied easily.
My Game no longer loads on device. I get the message
Warning: (/Applications/iTorque2D_1_4/MyProjects/myGame/buildFiles/XCode_iPhone/../../../../engine/source/platform/nativeDialogs/msgBox.cpp @ 50) getIDFromName(): didn't find that name
right before the crash, or freeze. Two things of note.
. I removed a good chunk of behavior.dso's right before this, with out unlinking the objects in the levels.
. I replaced the removed dso's, still freezes.
. I removed an audio file ( i know, not much, but i did )
*** One major thing, that really bugs me tho is that I made a copy of my working project so I could do things like remove dso's without worry, however the untouched original has the same freeze point.
I just got a major issue I am hoping I can have remedied easily.
My Game no longer loads on device. I get the message
Warning: (/Applications/iTorque2D_1_4/MyProjects/myGame/buildFiles/XCode_iPhone/../../../../engine/source/platform/nativeDialogs/msgBox.cpp @ 50) getIDFromName(): didn't find that name
right before the crash, or freeze. Two things of note.
. I removed a good chunk of behavior.dso's right before this, with out unlinking the objects in the levels.
. I replaced the removed dso's, still freezes.
. I removed an audio file ( i know, not much, but i did )
*** One major thing, that really bugs me tho is that I made a copy of my working project so I could do things like remove dso's without worry, however the untouched original has the same freeze point.
About the author
My thanks to Garage Games and the Garage Games Community combined with owned determination I got one game up, Temple Racer and I am looking to build more interesting, fun games for the mass market of the iOS app store.
#2
I get this in the report:
Process: Torque Game Builder [318]
Path: /Applications/T2D_iPhone_1_3/tgb/Torque Game Builder.app/Contents/MacOS/Torque Game Builder
Identifier: com.garagegames.torqueGameBuilder
Version: Copyright 2001-2006 GarageGames.com, Inc. All rights reserved. (1.5)
Code Type: X86 (Native)
Parent Process: launchd [141]
Date/Time: 2010-09-27 11:54:30.862 -0400
OS Version: Mac OS X 10.6.4 (10F569)
Report Version: 6
Interval Since Last Report: 274383 sec
Crashes Since Last Report: 7
Per-App Interval Since Last Report: 206394 sec
Per-App Crashes Since Last Report: 6
Anonymous UUID: 1ACA1750-70D9-4D01-9AD5-587C06C87460
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Application Specific Information:
abort() called
Thread 0 Crashed: Dispatch queue: com.apple.main-thread
0 libSystem.B.dylib 0x983ecef6 __kill + 10
1 libSystem.B.dylib 0x983ecee8 kill$UNIX2003 + 32
2 libSystem.B.dylib 0x9847f62d raise + 26
3 libSystem.B.dylib 0x984956e4 abort + 93
4 libstdc++.6.dylib 0x96036fda __gnu_cxx::__verbose_terminate_handler() + 433
5 libstdc++.6.dylib 0x9603517a __cxxabiv1::__terminate(void (*)()) + 10
6 libstdc++.6.dylib 0x960351ba __cxxabiv1::__unexpected(void (*)()) + 0
7 libstdc++.6.dylib 0x960352b8 __gxx_exception_cleanup(_Unwind_Reason_Code, _Unwind_Exception*) + 0
8 libstdc++.6.dylib 0x96035658 operator new(unsigned long) + 101
9 libstdc++.6.dylib 0x96035703 operator new[](unsigned long) + 17
09/27/2010 (3:57 pm)
Also the project itself, will no longer load in iTGB. I get this in the report:
Process: Torque Game Builder [318]
Path: /Applications/T2D_iPhone_1_3/tgb/Torque Game Builder.app/Contents/MacOS/Torque Game Builder
Identifier: com.garagegames.torqueGameBuilder
Version: Copyright 2001-2006 GarageGames.com, Inc. All rights reserved. (1.5)
Code Type: X86 (Native)
Parent Process: launchd [141]
Date/Time: 2010-09-27 11:54:30.862 -0400
OS Version: Mac OS X 10.6.4 (10F569)
Report Version: 6
Interval Since Last Report: 274383 sec
Crashes Since Last Report: 7
Per-App Interval Since Last Report: 206394 sec
Per-App Crashes Since Last Report: 6
Anonymous UUID: 1ACA1750-70D9-4D01-9AD5-587C06C87460
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Application Specific Information:
abort() called
Thread 0 Crashed: Dispatch queue: com.apple.main-thread
0 libSystem.B.dylib 0x983ecef6 __kill + 10
1 libSystem.B.dylib 0x983ecee8 kill$UNIX2003 + 32
2 libSystem.B.dylib 0x9847f62d raise + 26
3 libSystem.B.dylib 0x984956e4 abort + 93
4 libstdc++.6.dylib 0x96036fda __gnu_cxx::__verbose_terminate_handler() + 433
5 libstdc++.6.dylib 0x9603517a __cxxabiv1::__terminate(void (*)()) + 10
6 libstdc++.6.dylib 0x960351ba __cxxabiv1::__unexpected(void (*)()) + 0
7 libstdc++.6.dylib 0x960352b8 __gxx_exception_cleanup(_Unwind_Reason_Code, _Unwind_Exception*) + 0
8 libstdc++.6.dylib 0x96035658 operator new(unsigned long) + 101
9 libstdc++.6.dylib 0x96035703 operator new[](unsigned long) + 17
#4
1. Corrupt or out of step DSOs
2. You have references a name of an object in your code that hasn't been assigned that name - it is trying to lookup the internal id for a given name.
It would have been nice if the assert had printed that name.
My suggestion is to remove all DSOs from your game and reload it in TGB or on the device - this will cause a rebuild of everything.
You can play the game on the device using the debugger - this way you wont be timed out by the watch monitor. Once the game is stable and functioning correctly then you could start to reduce the loading.
My colleague at MeYuMe, An, very kindly solved the loading issue that I was seeing by making the following changes to the source ...
iPhoneMain.mm
TGBAppDelegate.h
TGBAppDelegate.mm
Notice that the start of the game is split into two
- a lightweight applicationDidFinishLaunching that finishes very quickly, overcoming the watch monitor killing your app.
- a startTorque method that runs (current thread) and starts the Torque game platform.
Hopefully you can feed this into your iTGB source BUT don't do this until you are back to a stable position
Good luck.
09/27/2010 (9:06 pm)
Rennie, it looks like:1. Corrupt or out of step DSOs
2. You have references a name of an object in your code that hasn't been assigned that name - it is trying to lookup the internal id for a given name.
It would have been nice if the assert had printed that name.
My suggestion is to remove all DSOs from your game and reload it in TGB or on the device - this will cause a rebuild of everything.
You can play the game on the device using the debugger - this way you wont be timed out by the watch monitor. Once the game is stable and functioning correctly then you could start to reduce the loading.
My colleague at MeYuMe, An, very kindly solved the loading issue that I was seeing by making the following changes to the source ...
iPhoneMain.mm
void _iPhoneGameBecomeActive(){
TGBAppDelegate *delegate = (TGBAppDelegate*)[[UIApplication sharedApplication] delegate];
if (![delegate isGameStarting]) {
Con::executef( 1, "oniPhoneBecomeActive" );
}
}TGBAppDelegate.h
@property (nonatomic) BOOL isGameStarting;
TGBAppDelegate.mm
- (void)applicationDidFinishLaunching:(UIApplication *)application {
isGameStarting = YES;
[self performSelector:@selector(startTorque:) withObject: application afterDelay:0.1];
}
- (void)startTorque:(UIApplication *)application {
if(!_iPhoneRunTorqueMain( self, window, application ))
{
_iPhoneTorqueFatalError = true;
};
isGameStarting = NO;
}Notice that the start of the game is split into two
- a lightweight applicationDidFinishLaunching that finishes very quickly, overcoming the watch monitor killing your app.
- a startTorque method that runs (current thread) and starts the Torque game platform.
Hopefully you can feed this into your iTGB source BUT don't do this until you are back to a stable position
Good luck.
#5
Interestingly enough, the program began to load again with out any idea of what was done (from my end) to make it work. I had just finished an e-conversation with David Montgomery Blake and it began to work. But that being said I think I will unload all dso and have them reset the dso's.
So.... Let me be clear (Obama), you are saying that with this bit of code your colleague provided, when plugged in, loads the essentials of an app, leaving all TGB stuff out, securing it's load and then loads the iTGB?
09/27/2010 (9:48 pm)
Thank you Scott,Interestingly enough, the program began to load again with out any idea of what was done (from my end) to make it work. I had just finished an e-conversation with David Montgomery Blake and it began to work. But that being said I think I will unload all dso and have them reset the dso's.
So.... Let me be clear (Obama), you are saying that with this bit of code your colleague provided, when plugged in, loads the essentials of an app, leaving all TGB stuff out, securing it's load and then loads the iTGB?
#6
09/27/2010 (10:13 pm)
Yep
#7
09/27/2010 (10:15 pm)
ohhhh you are the man.
#8
I did not have time to recompile all my dso's tonight, but I did plug in the scripts. I am getting errors tho. most suggest, pointing to my added in scripts...
. No declaration of property 'window' found in interface
. "isGameStarting" was not declared in this scope
. "isGameStarting" was not declared in this scope
one thing that concerned me about the inserted script for the TGBAppDelegate.mm is...
the full function, naturally looks like this.
I simply replaced the whole thing to look like how you posted.
Anyhow, thats where I am at. Will be fiddling tonight, hope to get it. If you have any thoughts, please pass them along and thanks.
09/27/2010 (11:54 pm)
Hi Scott, I did not have time to recompile all my dso's tonight, but I did plug in the scripts. I am getting errors tho. most suggest, pointing to my added in scripts...
. No declaration of property 'window' found in interface
. "isGameStarting" was not declared in this scope
. "isGameStarting" was not declared in this scope
one thing that concerned me about the inserted script for the TGBAppDelegate.mm is...
the full function, naturally looks like this.
- (void)applicationDidFinishLaunching:(UIApplication *)application {
_iPhoneTorqueFatalError = false;
if(!_iPhoneRunTorqueMain( self, window, application ))
{
_iPhoneTorqueFatalError = true;
return;
};
#ifdef TORQUE_ALLOW_ORIENTATIONS
[[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];
//Also we set the currentRotation up so its not invalid
currentOrientation = [UIDevice currentDevice].orientation;
//So we make a selector to handle that, called didRotate (lower down in the code)
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(didRotate:)
name:UIDeviceOrientationDidChangeNotification
object:nil];
#endif //TORQUE_ALLOW_ORIENTATIONS
#if defined(_USE_SOCIAL_NETWORKING)
socialNetworkingInit(self);
#endif //_USE_SOCIAL_NETWORKING
}I simply replaced the whole thing to look like how you posted.
- (void)applicationDidFinishLaunching:(UIApplication *)application {
isGameStarting = YES;
[self performSelector:@selector(startTorque:) withObject: application afterDelay:0.1];
}
- (void)startTorque:(UIApplication *)application {
if(!_iPhoneRunTorqueMain( self, window, application ))
{
_iPhoneTorqueFatalError = true;
};
isGameStarting = NO;
}Anyhow, thats where I am at. Will be fiddling tonight, hope to get it. If you have any thoughts, please pass them along and thanks.
#9
09/28/2010 (9:08 am)
sorry Rennie, that script was for 1.3, you will have to adjust for 1.4 - I don't need it for the iPad. At work at the moment so no access to my code. Will post later tonight,
#10
Do you think it would be wise to simply create a new project in 1.3 and simply copy over my game file? Just wondering a loud.
Cheers
09/28/2010 (10:32 am)
Sounds great.Do you think it would be wise to simply create a new project in 1.3 and simply copy over my game file? Just wondering a loud.
Cheers
#11
09/28/2010 (10:45 am)
Nope, don't do any more flip-flopping between projects ;-)
#12
09/28/2010 (10:48 am)
So how would I easily replicate 30 days of work, if I wanted to use your plug in?
#13
09/28/2010 (1:27 pm)
Just need to fix the code to work with 1.4, it should be easy.
#14
09/28/2010 (2:09 pm)
Not for me. I sure I will be harassed over this, but is there anyway someone could make those tweaks? I am really unsure how I would do this.
#15
no declaration of property 'window' found in the interface
It comes up twice at the line...
Would you know how to correct this?
09/28/2010 (2:30 pm)
Sorry to plug you with anything else, but I am getting an error in the TGBAppDelegate.mm.no declaration of property 'window' found in the interface
It comes up twice at the line...
@synthesize window;
Would you know how to correct this?
#16
It has the window defined in it.
09/28/2010 (8:01 pm)
Rennie, here is my code for TGBAppDelegate.hIt has the window defined in it.
#import <UIKit/UIKit.h>
@interface TGBAppDelegate : NSObject <UIApplicationDelegate, UIAlertViewDelegate> {
IBOutlet UIWindow *window;
NSString *cpUrl;
BOOL isGameStarting;
}
@property (nonatomic, retain) UIWindow *window;
@property (nonatomic, retain) NSString *cpUrl;
@property (nonatomic) BOOL isGameStarting;
@end
#17
Thanks,
the code works. For some reason I thought I had copied that file over from an example project. Anyhow, that is great, stupid on my part, but it is ok as it gave me a chance to work on the next app's graphics!
Dude,
is there any way you could convert that code you posted for 1.4. I really have no faith in my abilities to do something like that. I was looking at it, but it made no sense. I imagine a book on XCode will be the ultimate solution, but I dont have one now and if it is really easy, and not too much trouble I would really appreciate it actually.
Thanks a lot Scott!
09/28/2010 (9:18 pm)
Hey Scott, Thanks,
the code works. For some reason I thought I had copied that file over from an example project. Anyhow, that is great, stupid on my part, but it is ok as it gave me a chance to work on the next app's graphics!
Dude,
is there any way you could convert that code you posted for 1.4. I really have no faith in my abilities to do something like that. I was looking at it, but it made no sense. I imagine a book on XCode will be the ultimate solution, but I dont have one now and if it is really easy, and not too much trouble I would really appreciate it actually.
Thanks a lot Scott!
#18
09/28/2010 (10:16 pm)
Rennie, try this for 1.4, TGBAppDelegate:- (void)applicationDidFinishLaunching:(UIApplication *)application {
isGameStarting = YES;
[self performSelector:@selector(startTorque:) withObject: application afterDelay:0.1];
}
- (void)startTorque:(UIApplication *)application {
_iPhoneTorqueFatalError = false;
if(!_iPhoneRunTorqueMain( self, window, application ))
{
_iPhoneTorqueFatalError = true;
return;
};
#ifdef TORQUE_ALLOW_ORIENTATIONS
[[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];
//Also we set the currentRotation up so its not invalid
currentOrientation = [UIDevice currentDevice].orientation;
//So we make a selector to handle that, called didRotate (lower down in the code)
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(didRotate:)
name:UIDeviceOrientationDidChangeNotification
object:nil];
#endif //TORQUE_ALLOW_ORIENTATIONS
#if defined(_USE_SOCIAL_NETWORKING)
socialNetworkingInit(self);
#endif //_USE_SOCIAL_NETWORKING
isGameStarting = NO;
}
#19
I just tried it, but get this a EXC_BAD_ACCESS call.
here is the console read out.
Switching to remote-macosx protocol
mem 0x1000 0x3fffffff cache
mem 0x40000000 0xffffffff none
mem 0x00000000 0x0fff none
run
Running…
[Switching to thread 11523]
[Switching to thread 11523]
continue
Initial Command Line
0 : /var/mobile/Applications/BE71B5B6-081E-4870-AD9D-EEFF39F0C2D6/iTorque2DGame.app/iTorque2DGame
Merged Command Line
0 : /var/mobile/Applications/BE71B5B6-081E-4870-AD9D-EEFF39F0C2D6/iTorque2DGame.app/iTorque2DGame
Current language: auto; currently c++
Program received signal: “EXC_BAD_ACCESS”.
09/28/2010 (10:34 pm)
Hi Scott, I just tried it, but get this a EXC_BAD_ACCESS call.
here is the console read out.
Switching to remote-macosx protocol
mem 0x1000 0x3fffffff cache
mem 0x40000000 0xffffffff none
mem 0x00000000 0x0fff none
run
Running…
[Switching to thread 11523]
[Switching to thread 11523]
continue
Initial Command Line
0 : /var/mobile/Applications/BE71B5B6-081E-4870-AD9D-EEFF39F0C2D6/iTorque2DGame.app/iTorque2DGame
Merged Command Line
0 : /var/mobile/Applications/BE71B5B6-081E-4870-AD9D-EEFF39F0C2D6/iTorque2DGame.app/iTorque2DGame
Current language: auto; currently c++
Program received signal: “EXC_BAD_ACCESS”.
#20
it comes from this function...
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);
}
char *ret = 0;
if(!*walk) {
*walk = (Node *) mempool.alloc(sizeof(Node));
(*walk)->next = 0;
(*walk)->val = (char *) mempool.alloc(dStrlen(val) + 1);
dStrcpy((*walk)->val, val);
ret = (*walk)->val;
itemCount ++;
}
if(itemCount > 2 * numBuckets) {
resize(4 * numBuckets - 1);
}
return ret;
}
09/28/2010 (10:36 pm)
I am not sure if this is proper programming skill but I believe with the debugger going, I get a larger read arrow, beside this line in the stringTable.cc.walk = &buckets[key % numBuckets];
it comes from this function...
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);
}
char *ret = 0;
if(!*walk) {
*walk = (Node *) mempool.alloc(sizeof(Node));
(*walk)->next = 0;
(*walk)->val = (char *) mempool.alloc(dStrlen(val) + 1);
dStrcpy((*walk)->val, val);
ret = (*walk)->val;
itemCount ++;
}
if(itemCount > 2 * numBuckets) {
resize(4 * numBuckets - 1);
}
return ret;
}
Torque Owner rennie moffat
Renman3000
static S32 getIDFromName(EnumTable::Enums *table, const char *name, S32 def = -1)
{
for(S32 i = 0;table[i].label != NULL;++i)
{
if(dStricmp(table[i].label, name) == 0)
return table[i].index;
}
AssertWarn(false,"getIDFromName(): didn't find that name" );
return def;
}
I have no idea, what this might mean beyond, that I see no way that this AssertWarn would not be called. Unless of course it was true.