EXC_CRASH (SIGABRT) in some ipad models

2

I am encountering some strange behaviors with an app that I'm developing. When I test it in Xcode it works fine - no errors or warnings! It worked ok being distributed as ad-hoc too! After it was submitted to the App Store and got approved without any problems, I downloaded it onto my iPad 2 and it worked fine.

But the client tells me that the app crashes on iPad 4th generation and iPad Air.

I was in the client's office and I tested it with their iPad 4 generation. I deleted and downloaded it again from the store and nothing, it still crashes! Then, I tested directly in Xcode and to my surprise the app runs with no errors! After deleting the Xcode build version and downloading it again from the App Store, it ran without crashing.

Below is the log that I caught from another device that crashed too.

Someone have an idea about this problem? Thank you for any information!

Incident Identifier: 1E40E435-42BE-448F-AD73-B596B0F24FD7
CrashReporter Key:   199c1d309e448e9f4ec2266b87510c50a18ca49a
Hardware Model:      iPad4,2
Process:             myapp [3498]
Path:                /var/mobile/Applications/7D97FBDC-5EAB-4186-BEE7-5C102A1243F2/myapp.app/myapp
Identifier:          com.domain.myapp
Version:             1.1.0 (1.1.0)
Code Type:           ARM (Native)
Parent Process:      launchd [1]

Date/Time:           2014-08-25 10:40:51.033 -0300
OS Version:          iOS 7.1.1 (11D201)
Report Version:      104

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Triggered by Thread:  0

Thread 0 Crashed:
0   libsystem_kernel.dylib          0x3938f1f0 __pthread_kill + 8
1   libsystem_pthread.dylib         0x393f77b3 pthread_kill + 55
2   libsystem_c.dylib               0x3933fff5 abort + 73
3   myapp                           0x000541eb -[AppDelegate persistentStoreCoordinator] (AppDelegate.m:205)
4   myapp                           0x00053cdd -[AppDelegate managedObjectContext] (AppDelegate.m:118)
5   myapp                           0x0006d70b -[Atualizacao facebookInstallAd] (Atualizacao.m:33)
6   myapp                           0x0006ce3f -[StartViewController copyStartFiles] (StartViewController.m:120)
7   Foundation                      0x2ebe4113 __NSFireDelayedPerform + 411
8   CoreFoundation                  0x2e1cff4d __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 13
9   CoreFoundation                  0x2e1cfb67 __CFRunLoopDoTimer + 791
10  CoreFoundation                  0x2e1cdeef __CFRunLoopRun + 1215
11  CoreFoundation                  0x2e138765 CFRunLoopRunSpecific + 521
12  CoreFoundation                  0x2e138547 CFRunLoopRunInMode + 103
13  GraphicsServices                0x3306f6cf GSEventRunModal + 135
14  UIKit                           0x30a9788d UIApplicationMain + 1133
15  myapp                           0x00051edf main (main.m:16)
16  libdyld.dylib                   0x392d8ab5 start + 1

Thread 1:
0   libsystem_kernel.dylib          0x3937c804 kevent64 + 24
1   libdispatch.dylib               0x392cb051 _dispatch_mgr_invoke + 229
2   libdispatch.dylib               0x392c52df _dispatch_mgr_thread + 35

Thread 2:
0   libsystem_kernel.dylib          0x3938fc70 __workq_kernreturn + 8
1   libsystem_pthread.dylib         0x393f4c1f _pthread_wqthread + 307
2   libsystem_pthread.dylib         0x393f4ad8 start_wqthread + 4

Thread 3:
0   libsystem_kernel.dylib          0x3938fc70 __workq_kernreturn + 8
1   libsystem_pthread.dylib         0x393f4c1f _pthread_wqthread + 307
2   libsystem_pthread.dylib         0x393f4ad8 start_wqthread + 4

Thread 4 name:  com.apple.coremedia.player.async
Thread 4:
0   libsystem_kernel.dylib          0x3937caa0 semaphore_wait_trap + 8
1   libdispatch.dylib               0x392c9d3d _dispatch_semaphore_wait_slow + 173
2   MediaToolbox                    0x2f6578cb fpa_AsyncMovieControlThread + 1751
3   CoreMedia                       0x2e768161 figThreadMain + 193
4   libsystem_pthread.dylib         0x393f6957 _pthread_body + 139
5   libsystem_pthread.dylib         0x393f68c7 _pthread_start + 99
6   libsystem_pthread.dylib         0x393f4ae4 thread_start + 4

Thread 5:
0   libsystem_kernel.dylib          0x3938fc70 __workq_kernreturn + 8
1   libsystem_pthread.dylib         0x393f4c1f _pthread_wqthread + 307
2   libsystem_pthread.dylib         0x393f4ad8 start_wqthread + 4

Thread 0 crashed with ARM Thread State (32-bit):
    r0: 0x00000000    r1: 0x00000000      r2: 0x00000000      r3: 0x00000306
    r4: 0x00000006    r5: 0x3b07c18c      r6: 0x146826d0      r7: 0x27db7b40
    r8: 0x0000000c    r9: 0x3b07ce30     r10: 0x1465cba0     r11: 0x1465a680
    ip: 0x00000148    sp: 0x27db7b34      lr: 0x393f77b7      pc: 0x3938f1f0
  cpsr: 0x00000010

EDIT - About the "trojanfoe" question

-[AppDelegate persistentStoreCoordinator] (AppDelegate.m:205) commented bellow.

- (NSPersistentStoreCoordinator *)persistentStoreCoordinator
{
    if (_persistentStoreCoordinator != nil) {
        return _persistentStoreCoordinator;
    }
    NSURL *storeURL = [[self applicationDocumentsDirectory] URLByAppendingPathComponent:@"database.sqlite"];

    if (![[NSFileManager defaultManager] fileExistsAtPath:[storeURL path]]) {
        NSURL *preloadURL = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"databaseStart" ofType:@"sqlite"]];
        NSError* err = nil;
        [[NSFileManager defaultManager] copyItemAtURL:preloadURL toURL:storeURL error:&err];
        [self addSkipBackupAttributeToItemAtURL:storeURL];
    }

    NSError *error = nil;
    _persistentStoreCoordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:[self managedObjectModel]];
    if (![_persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:storeURL options:nil error:&error]) {
        abort(); // line 205
    }

    return _persistentStoreCoordinator;
}
ios
objective-c
ipad
asked on Stack Overflow Aug 26, 2014 by Paulo Sigales • edited Nov 26, 2015 by pnuts

1 Answer

1

The "crash" is self-inflicted and is due to calling abort() which should only be used when the idea of living any longer is too much for the process to consider.

In this particular case you are calling a method that can fail (most can) and you need to handle this more gracefully:

  1. Report the error, that is returned, using NSLog() or a logging framework like Cocoa Lumberjack as this will help you diagnose future issues.
  2. Return nil rather than aborting. If your app cannot continue because of this issue you will need to make it sit inside some sort of "cannot continue" window, preferably containing a relevant error message allowing the user to electively terminate the app.
answered on Stack Overflow Aug 27, 2014 by trojanfoe • edited Aug 27, 2014 by trojanfoe

User contributions licensed under CC BY-SA 3.0