Runs from XCode not from Device.
by rennie moffat · in iTorque 2D · 09/10/2010 (5:43 pm) · 53 replies
Hi there,
My app runs from XCode to the device but when I run it, directly from the device it crashes. Any thoughts, concerns (should I be), clues?
Thanks.
My app runs from XCode to the device but when I run it, directly from the device it crashes. Any thoughts, concerns (should I be), clues?
Thanks.
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.
#22
However, the game is being killed by iOS before it gets anywhere near to hitting the TorqueScript stuff. How is War evolved on iOS4 and the 3G, any feedback?
09/12/2010 (4:00 pm)
Thanks Justin, I do have the _d and _i images but removing the hover is a good idea.However, the game is being killed by iOS before it gets anywhere near to hitting the TorqueScript stuff. How is War evolved on iOS4 and the 3G, any feedback?
#23
if that is no option recheck twice if your per level datablocks are layed out correctly, that you have an intro level which basically has no datablocks at all so the initial loading terminates correctly and in time
don't do any kind of heavy loading (optimally none) there nor calculation.
an easy trick is to have the torque init handler being called as a selector with a 0.1s delay, that normally is enough
09/12/2010 (7:25 pm)
Make the application an iOS4 one and specify ARMV7 as requirement so you cut iOS3 and pre3GS completely.if that is no option recheck twice if your per level datablocks are layed out correctly, that you have an intro level which basically has no datablocks at all so the initial loading terminates correctly and in time
don't do any kind of heavy loading (optimally none) there nor calculation.
an easy trick is to have the torque init handler being called as a selector with a 0.1s delay, that normally is enough
#24
Loading the game loads and compiles every .cs and .gui file and then validates the files, checking GUI profiles, bitmaps etc - it takes way too long on the 3G. Even having the pre-compiled .dso files made very little difference.
I'm in the process of refactoring the loading of "game" into a schedule. Just trying to get a splash to work between loading common (will use Default.png) and loading "game" which will use another splash/loading screen.
I like the idea though of having the Torque init handler as a selector - I'll give that a try.
09/12/2010 (8:11 pm)
Thanks Marc, I figured this is the problem in top level main.cs:loadPath( "common" ); // THIS TAKE AGES!! loadPath( "game" );
Loading the game loads and compiles every .cs and .gui file and then validates the files, checking GUI profiles, bitmaps etc - it takes way too long on the 3G. Even having the pre-compiled .dso files made very little difference.
I'm in the process of refactoring the loading of "game" into a schedule. Just trying to get a splash to work between loading common (will use Default.png) and loading "game" which will use another splash/loading screen.
I like the idea though of having the Torque init handler as a selector - I'll give that a try.
#25
I haven't tested War Evolved on an iPhone 3G with iOS4 - I haven't wanted to upgrade mine because I'd like it still to be somewhat usable. War Evolved has gotten a few negative reviews saying that it crashes, but nothing out of the ordinary. I haven't gotten an email in awhile so that's a good sign I guess.
Honestly I've stopped worrying about the negative reviews saying that it crashes. It works on the devices that I've tested it on (it loads in about 15 seconds on an iPod Touch 2G), so that's really all I care about. Sales are still steady and I've been able to make progress on my new game, so I can't complain... Although I am working on an update for War Evolved because the win percentage on the hardest difficulty level is too high - I think the AI needs to cheat a little bit more :)
09/12/2010 (8:31 pm)
Marc's trick is a good one.I haven't tested War Evolved on an iPhone 3G with iOS4 - I haven't wanted to upgrade mine because I'd like it still to be somewhat usable. War Evolved has gotten a few negative reviews saying that it crashes, but nothing out of the ordinary. I haven't gotten an email in awhile so that's a good sign I guess.
Honestly I've stopped worrying about the negative reviews saying that it crashes. It works on the devices that I've tested it on (it loads in about 15 seconds on an iPod Touch 2G), so that's really all I care about. Sales are still steady and I've been able to make progress on my new game, so I can't complain... Although I am working on an update for War Evolved because the win percentage on the hardest difficulty level is too high - I think the AI needs to cheat a little bit more :)
#26
also as itouch it has on average 25%+ more ram available as the phone services are not exactly "friendly" on that end.
09/12/2010 (8:40 pm)
the iTouch 2nd gen is 30% faster than the iphone 3G and first gen so yeah possible that it makes it straight "below the border" :)also as itouch it has on average 25%+ more ram available as the phone services are not exactly "friendly" on that end.
#27
Here is my code in TGBAppDelegate.mm
Every time it runs I get:
In:
Any ideas?
Cheers
09/12/2010 (9:19 pm)
@Marc, nice idea but I can't get it to work :(Here is my code in TGBAppDelegate.mm
- (void)applicationDidFinishLaunching:(UIApplication *)application {
[self performSelector:@selector(startTorque:) withObject: application afterDelay:0.1];
}
- (void)startTorque:(UIApplication *)application {
if(!_iPhoneRunTorqueMain( self, window, application ))
{
_iPhoneTorqueFatalError = true;
};
NSDictionary* settings = [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithInt:UIInterfaceOrientationLandscapeRight], OpenFeintSettingDashboardOrientation,
[NSNumber numberWithBool:YES], OpenFeintSettingDisableUserGeneratedContent,
nil
];
OFDelegatesContainer* delegates = [OFDelegatesContainer containerWithOpenFeintDelegate:self
andChallengeDelegate:nil
andNotificationDelegate:nil];
[OpenFeint setDashboardOrientation:UIInterfaceOrientationLandscapeLeft];
[OpenFeint initializeWithProductKey:OF_PRODUCT_KEY
andSecret:OF_PRODUCT_SECRET
andDisplayName:OF_DISPLAY_NAME
andSettings:settings
andDelegates:delegates];
}Every time it runs I get:
Running… [Switching to thread 11523] [Switching to thread 11523] sharedlibrary apply-load-rules all continue Initial Command Line 0 : /var/mobile/Applications/2386AFB0-6F00-41DD-AC2D-D68AF26E0560/iTorque2DGame.app/iTorque2DGame Merged Command Line 0 : /var/mobile/Applications/2386AFB0-6F00-41DD-AC2D-D68AF26E0560/iTorque2DGame.app/iTorque2DGame Program received signal: “EXC_BAD_ACCESS”.
In:
//--------------------------------------
StringTableEntry _StringTable::insert(const char* val, const bool caseSens)
{
Node **walk, *temp;
U32 key = hashString(val);
walk = &buckets[key % numBuckets]; <<<<<<<<<< FAILS HERE - EXC_BAD_ACCESS!!!
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;
}Any ideas?
Cheers
#28
It works, but still with the killing the app for failing to launch in time problem. So seems to be the selector or my use of the selector which is bad.
09/12/2010 (9:28 pm)
Should also add that if I comment out the selector and have this line instead:[self startTorque:application];
It works, but still with the killing the app for failing to launch in time problem. So seems to be the selector or my use of the selector which is bad.
#29
09/13/2010 (2:54 am)
Scott, it's interesting to hear that your publisher insists on making the game work on the iPhone 3G. I am also planning to go through them, so I guess I should think about the 3G. I have a friend who is currently using a 3G and he'll be upgrading soon to v4, so I'll try to get hold of his old one. I also want to get an iPod Touch v4, but I'm running out of money. I wish Apple would slow down a bit, lol!
#30
09/13/2010 (5:20 am)
Scott, I was just wondering. Is it iOS v4 that is the only problem, or is there a problem with v3 also? This whole OS version thing is starting to irritate me. I've upgraded to v4 on my iPod 3rd gen and now it appears as though I am unable to downgrade back to v3. Does anyone know if there is a way for a developer to easily change the OS up and down? If we can't downgrade the OS how are we supposed to test with different OSs. This sucks.
#32
Baseband upgrades are one way and that way is up and only up.
For testing with different OS you need different devices
09/13/2010 (12:21 pm)
Right, there is no way to move down again without jailbreaking and a lot of manual workBaseband upgrades are one way and that way is up and only up.
For testing with different OS you need different devices
#33
I checked the devices log via XCode as you suggested. The only thing that I could see as noticably wrong was this...
"Unknown thread crashed with unknown flavor: 5, state_count: 1"
I created a google doc which has the entire stack (correct term?) If you feel you would be able to help me by flipping thru it, please send me your email and you will be granted access. I am not sure how else to post over a 1000 characters.
Cheers.
::))((((
PS. you can post here or email me at renniemoffat@gmail.com
09/14/2010 (12:14 am)
@ Scott or whom ever. I checked the devices log via XCode as you suggested. The only thing that I could see as noticably wrong was this...
"Unknown thread crashed with unknown flavor: 5, state_count: 1"
I created a google doc which has the entire stack (correct term?) If you feel you would be able to help me by flipping thru it, please send me your email and you will be granted access. I am not sure how else to post over a 1000 characters.
Cheers.
::))((((
PS. you can post here or email me at renniemoffat@gmail.com
#34
09/14/2010 (8:10 am)
Rennie, just post the top five lines from the trace - that should be enough, and we can take a look.
#35
Incident Identifier: 35F2D440-28CA-4A4A-ABD4-CF5532D888BC
CrashReporter Key: a40bb64aa1faf01d45f4518ee9c2d34f82c42f70
Hardware Model: iPod2,1
Process: iTorque2DGame [564]
Path: /var/mobile/Applications/F0297ED6-DEC6-4233-9CB7-ACCF028F0515/iTorque2DGame.app/iTorque2DGame
09/14/2010 (1:46 pm)
I believe these are the first five lines. If not, please let me know... and thanks! This is a big help.Incident Identifier: 35F2D440-28CA-4A4A-ABD4-CF5532D888BC
CrashReporter Key: a40bb64aa1faf01d45f4518ee9c2d34f82c42f70
Hardware Model: iPod2,1
Process: iTorque2DGame [564]
Path: /var/mobile/Applications/F0297ED6-DEC6-4233-9CB7-ACCF028F0515/iTorque2DGame.app/iTorque2DGame
#36
09/14/2010 (7:54 pm)
Rennie, can you give us the rest of the lines, up to the stack trace please?
#37
Incident Identifier: 72EEB1DF-A6E0-4BC6-93D1-8809480B48DF
CrashReporter Key: a40bb64aa1faf01d45f4518ee9c2d34f82c42f70
Hardware Model: iPod2,1
Process: iTorque2DGame [894]
Path: /var/mobile/Applications/F0297ED6-DEC6-4233-9CB7-ACCF028F0515/iTorque2DGame.app/iTorque2DGame
Identifier: iTorque2DGame
Version: ??? (???)
Code Type: ARM (Native)
Parent Process: launchd [1]
Date/Time: 2010-09-14 16:14:20.717 -0400
OS Version: iPhone OS 4.0.2 (8A400)
Report Version: 104
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x00000000, 0x00000000
Crashed Thread: 0
Thread 0 Crashed:
0 libSystem.B.dylib 0x00088c24 __kill + 8
1 libSystem.B.dylib 0x00088c12 kill + 4
2 libSystem.B.dylib 0x00088c06 raise + 10
3 libSystem.B.dylib 0x0009f902 abort + 54
4 GraphicsServices 0x00004530 GSRegisterPurpleNamedPort + 268
5 GraphicsServices 0x00004920 GSEventInitialize + 228
6 UIKit 0x00005e08 UIApplicationMain + 532
7 iTorque2DGame 0x0019d788 main (iPhoneMain.mm:212)
8 iTorque2DGame 0x000388c0 start + 44
Thread 1:
0 libSystem.B.dylib 0x00034e84 kevent + 24
1 libSystem.B.dylib 0x00102a48 _dispatch_mgr_invoke + 88
2 libSystem.B.dylib 0x00102494 _dispatch_queue_invoke + 96
3 libSystem.B.dylib 0x00102634 _dispatch_worker_thread2 + 120
4 libSystem.B.dylib 0x0008b53c _pthread_wqthread + 392
5 libSystem.B.dylib 0x00082b6c start_wqthread + 0
Thread 2:
0 libSystem.B.dylib 0x0008c3b4 __workq_kernreturn + 8
1 libSystem.B.dylib 0x0008b718 _pthread_wqthread + 868
2 libSystem.B.dylib 0x00082b6c start_wqthread + 0
Thread 3:
0 libSystem.B.dylib 0x00000ab0 mach_msg_trap + 20
1 libSystem.B.dylib 0x00002f94 mach_msg + 60
2 CoreFoundation 0x00074b18 __CFRunLoopServiceMachPort + 88
3 CoreFoundation 0x000770e0 __CFRunLoopRun + 400
4 CoreFoundation 0x0001e0bc CFRunLoopRunSpecific + 220
5 CoreFoundation 0x0001dfca CFRunLoopRunInMode + 54
6 WebCore 0x0000370c RunWebThread(void*) + 552
7 libSystem.B.dylib 0x0008af80 _pthread_start + 364
8 libSystem.B.dylib 0x0007d014 thread_start + 0
Thread 0 crashed with ARM Thread State:
r0: 0x00000000 r1: 0x00000000 r2: 0x00000001 r3: 0x3e1da26c
r4: 0x00000006 r5: 0x00510560 r6: 0x3e1d8480 r7: 0x2ffff800
r8: 0x3e1d8488 r9: 0x00000888 r10: 0x3e5c3004 r11: 0x00000001
ip: 0x00000025 sp: 0x2ffff800 lr: 0x311aec19 pc: 0x311aec24
cpsr: 0x00000010
09/14/2010 (8:16 pm)
This might be better.Incident Identifier: 72EEB1DF-A6E0-4BC6-93D1-8809480B48DF
CrashReporter Key: a40bb64aa1faf01d45f4518ee9c2d34f82c42f70
Hardware Model: iPod2,1
Process: iTorque2DGame [894]
Path: /var/mobile/Applications/F0297ED6-DEC6-4233-9CB7-ACCF028F0515/iTorque2DGame.app/iTorque2DGame
Identifier: iTorque2DGame
Version: ??? (???)
Code Type: ARM (Native)
Parent Process: launchd [1]
Date/Time: 2010-09-14 16:14:20.717 -0400
OS Version: iPhone OS 4.0.2 (8A400)
Report Version: 104
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x00000000, 0x00000000
Crashed Thread: 0
Thread 0 Crashed:
0 libSystem.B.dylib 0x00088c24 __kill + 8
1 libSystem.B.dylib 0x00088c12 kill + 4
2 libSystem.B.dylib 0x00088c06 raise + 10
3 libSystem.B.dylib 0x0009f902 abort + 54
4 GraphicsServices 0x00004530 GSRegisterPurpleNamedPort + 268
5 GraphicsServices 0x00004920 GSEventInitialize + 228
6 UIKit 0x00005e08 UIApplicationMain + 532
7 iTorque2DGame 0x0019d788 main (iPhoneMain.mm:212)
8 iTorque2DGame 0x000388c0 start + 44
Thread 1:
0 libSystem.B.dylib 0x00034e84 kevent + 24
1 libSystem.B.dylib 0x00102a48 _dispatch_mgr_invoke + 88
2 libSystem.B.dylib 0x00102494 _dispatch_queue_invoke + 96
3 libSystem.B.dylib 0x00102634 _dispatch_worker_thread2 + 120
4 libSystem.B.dylib 0x0008b53c _pthread_wqthread + 392
5 libSystem.B.dylib 0x00082b6c start_wqthread + 0
Thread 2:
0 libSystem.B.dylib 0x0008c3b4 __workq_kernreturn + 8
1 libSystem.B.dylib 0x0008b718 _pthread_wqthread + 868
2 libSystem.B.dylib 0x00082b6c start_wqthread + 0
Thread 3:
0 libSystem.B.dylib 0x00000ab0 mach_msg_trap + 20
1 libSystem.B.dylib 0x00002f94 mach_msg + 60
2 CoreFoundation 0x00074b18 __CFRunLoopServiceMachPort + 88
3 CoreFoundation 0x000770e0 __CFRunLoopRun + 400
4 CoreFoundation 0x0001e0bc CFRunLoopRunSpecific + 220
5 CoreFoundation 0x0001dfca CFRunLoopRunInMode + 54
6 WebCore 0x0000370c RunWebThread(void*) + 552
7 libSystem.B.dylib 0x0008af80 _pthread_start + 364
8 libSystem.B.dylib 0x0007d014 thread_start + 0
Thread 0 crashed with ARM Thread State:
r0: 0x00000000 r1: 0x00000000 r2: 0x00000001 r3: 0x3e1da26c
r4: 0x00000006 r5: 0x00510560 r6: 0x3e1d8480 r7: 0x2ffff800
r8: 0x3e1d8488 r9: 0x00000888 r10: 0x3e5c3004 r11: 0x00000001
ip: 0x00000025 sp: 0x2ffff800 lr: 0x311aec19 pc: 0x311aec24
cpsr: 0x00000010
#38
This is still a huge issue for me. If anyone can help work through this I will buy them a shiny lamp.
09/18/2010 (12:51 pm)
Hi there,This is still a huge issue for me. If anyone can help work through this I will buy them a shiny lamp.
#39
09/18/2010 (4:38 pm)
Unfortunately the stack trace gives us no clues.
#40
09/18/2010 (6:10 pm)
is that the correct info (that I supplied)?
Torque Owner Justin Mosiman
Opsive
One of the things that I noticed with War Evolved was that it was spending a lot of time trying to load gui buttons that didn't exist. For every gui button, it tries to load the normal, hover, depressed, and inactive images. If you have a lot of gui buttons this can really slow things down.
To stop it from loading the unnecessary images, open guiBitmapButtonCtrl::setBitmap and choose which lines to remove:
You can definitely remove the _h code since hover images aren't applicable on the iPhone. Then the rest depend on your game. If you don't have any depressed images, remove the _d block of code. Same goes for inactive.
Hope that helps!