cit
cit

Reputation: 215

iPhone App crashing on startup on some devices (not all)

I'm starting to get desperate and I need advice. Here's the situation:

The crash logs do not tell me anything useful. Here is one, perhaps someone smarter than me knows what happened:

            Incident Identifier: 52C11BF9-A202-4ECC-B227-4A57899CB2E1
            CrashReporter Key:   3129de7e18ddccceb41bf4d0ad0465bc2e66df29
            Hardware Model:      iPhone3,1
            Process:         GT-BetApp [3364]
            Path:            /var/mobile/Applications/5E9BA5D7-4337-44CD-BDAB-CE653680EEB3/GT-BetApp.app/GT-BetApp
            Identifier:      GT-BetApp
            Version:         ??? (???)
            Code Type:       ARM (Native)
            Parent Process:  launchd [1]

            Date/Time:       2012-01-24 18:59:34.573 +0100
            OS Version:      iPhone OS 5.0.1 (9A405)
            Report Version:  104

            Exception Type:  EXC_CRASH (SIGABRT)
            Exception Codes: 0x00000000, 0x00000000
            Crashed Thread:  0

            Last Exception Backtrace:
            0   CoreFoundation                  0x344258bf __exceptionPreprocess + 163
            1   libobjc.A.dylib                 0x346751e5 objc_exception_throw + 33
            2   CoreFoundation                  0x344257b9 +[NSException raise:format:] + 1
            3   CoreFoundation                  0x344257db +[NSException raise:format:] + 35
            4   UIKit                           0x37a42747 -[UINib instantiateWithOwner:options:] + 1567
            5   UIKit                           0x37a43bb9 -[NSBundle(UINSBundleAdditions) loadNibNamed:owner:options:] + 137
            6   UIKit                           0x3797ca45 -[UIApplication _loadMainNibFileNamed:bundle:] + 37
            7   UIKit                           0x37806227 -[UIApplication _loadMainInterfaceFile] + 223
            8   UIKit                           0x37800313 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 227
            9   UIKit                           0x377ce921 -[UIApplication handleEvent:withNewEvent:] + 1017
            10  UIKit                           0x377ce3bf -[UIApplication sendEvent:] + 55
            11  UIKit                           0x377cdd2d _UIApplicationHandleEvent + 5809
            12  GraphicsServices                0x30c00df3 PurpleEventCallback + 883
            13  CoreFoundation                  0x343f9553 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 39
            14  CoreFoundation                  0x343f94f5 __CFRunLoopDoSource1 + 141
            15  CoreFoundation                  0x343f8343 __CFRunLoopRun + 1371
            16  CoreFoundation                  0x3437b4dd CFRunLoopRunSpecific + 301
            17  CoreFoundation                  0x3437b3a5 CFRunLoopRunInMode + 105
            18  UIKit                           0x377ff457 -[UIApplication _run] + 551
            19  UIKit                           0x377fc743 UIApplicationMain + 1091
            20  GT-BetApp                       0x00002c79 main (main.m:15)
            21  GT-BetApp                       0x00002c44 0x1000 + 7236


            Thread 0 name:  Dispatch queue: com.apple.main-thread
            Thread 0 Crashed:
            0   libsystem_kernel.dylib          0x3634032c __pthread_kill + 8
            1   libsystem_c.dylib               0x33209f54 pthread_kill + 48
            2   libsystem_c.dylib               0x33202fe4 abort + 88
            3   libc++abi.dylib                 0x3384cf64 abort_message + 40
            4   libc++abi.dylib                 0x3384a346 _ZL17default_terminatev + 18
            5   libobjc.A.dylib                 0x346752dc _objc_terminate + 140
            6   libc++abi.dylib                 0x3384a3be _ZL19safe_handler_callerPFvvE + 70
            7   libc++abi.dylib                 0x3384a44a std::terminate() + 14
            8   libc++abi.dylib                 0x3384b81e __cxa_rethrow + 82
            9   libobjc.A.dylib                 0x3467522e objc_exception_rethrow + 6
            10  CoreFoundation                  0x3437b53e CFRunLoopRunSpecific + 398
            11  CoreFoundation                  0x3437b39e CFRunLoopRunInMode + 98
            12  UIKit                           0x377ff450 -[UIApplication _run] + 544
            13  UIKit                           0x377fc73c UIApplicationMain + 1084
            14  GT-BetApp                       0x00002c72 main (main.m:14)
            15  GT-BetApp                       0x00002c3c 0x1000 + 7228

            Thread 1 name:  Dispatch queue: com.apple.libdispatch-manager
            Thread 1:
            0   libsystem_kernel.dylib          0x363303b4 kevent + 24
            1   libdispatch.dylib               0x3705ae78 _dispatch_mgr_invoke + 708
            2   libdispatch.dylib               0x3705ab96 _dispatch_mgr_thread + 30

            Thread 2:
            0   libsystem_kernel.dylib          0x36340cd4 __workq_kernreturn + 8
            1   libsystem_c.dylib               0x331c630a _pthread_wqthread + 610
            2   libsystem_c.dylib               0x331c609c start_wqthread + 0

            Thread 3:
            0   libsystem_kernel.dylib          0x36340cd4 __workq_kernreturn + 8
            1   libsystem_c.dylib               0x331c630a _pthread_wqthread + 610
            2   libsystem_c.dylib               0x331c609c start_wqthread + 0

            Thread 4 name:  WebThread
            Thread 4:
            0   libsystem_kernel.dylib          0x36330010 mach_msg_trap + 20
            1   libsystem_kernel.dylib          0x36330206 mach_msg + 50
            2   CoreFoundation                  0x343f941c __CFRunLoopServiceMachPort + 120
            3   CoreFoundation                  0x343f8154 __CFRunLoopRun + 876
            4   CoreFoundation                  0x3437b4d6 CFRunLoopRunSpecific + 294
            5   CoreFoundation                  0x3437b39e CFRunLoopRunInMode + 98
            6   WebCore                         0x3684f128 _ZL12RunWebThreadPv + 396
            7   libsystem_c.dylib               0x331cbc16 _pthread_start + 314
            8   libsystem_c.dylib               0x331cbad0 thread_start + 0

            Thread 0 crashed with ARM Thread State:
                r0: 0x00000000    r1: 0x00000000      r2: 0x00000001      r3: 0x00000000
                r4: 0x00000006    r5: 0x3eaf3ce8      r6: 0x00000002      r7: 0x2fdffa60
                r8: 0x3fd97dec    r9: 0x3384da4a     r10: 0x0015d9e0     r11: 0x00156150
                ip: 0x00000148    sp: 0x2fdffa54      lr: 0x33209f5b      pc: 0x3634032c
              cpsr: 0x00000010

As the only reference to my code in the report is to main.m, here it is:

            #import <UIKit/UIKit.h>

            int main(int argc, char *argv[])
            {
                NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
                int retVal = UIApplicationMain(argc, argv, nil, nil);
                [pool release];
                return retVal;
            }

So here is my question: How can I determine the cause? What can I do to get more information on this crash (I can send versions to someone who experiences this crash)? What can I do to prevent it?

Any advice is much appreciated and thank you in advance!

UPDATE:

I found the solution and it was a silly mistake on my part.

The MainWindow.xib could not load when there was no localization for the device's language. I always thought, it would fall back English, but it did not (anymore).

In previous versions, this was never an issue. I don't know why this behavior changed.

Thanks for all the replies, you helped me search in the right direction!

Upvotes: 4

Views: 3280

Answers (1)

Nikolai Ruhe
Nikolai Ruhe

Reputation: 81878

The application is trying to read the main nib file, as specified in your app's Info.plist file.

In the plist file there is an entry like

NSMainNibFile -> MyMainWindow

which UIApplicationMain uses to load your initial view controller from. This file seems to be damaged. A common error is to use a custom class for a contained object and then change/remove that class later without changing the nib file.

To further understand the error it would be very helpful to know the description of the exception that's being raised. You'll find that in the console log.

Upvotes: 3

Related Questions