Klaus
Klaus

Reputation: 53

iOS App (Using Core Data) Crashes After Update, But Only App Store Version

I have a serious problem with an iOS 9.1 app: I have updated the app, successfully tested it on several iPhone devices, submitted it to the App Store and Apple reviewed and rolled out the app. The app uses Core Data.

The problem is, however, that the app crashes immediately after start up for users that installed it as an update. A crash report is listed below, however, I cannot find the real problem with it (also because not everything is symbolised). If I run it on the same device directly via Xcode, the app works fine and does not crash.

Any ideas of how I could find the error?

Thanks very much for any hint!

Incident Identifier: 82CFBBFB-D78F-45B8-B7B1-5CA927889673
CrashReporter Key:   b74b72673e3b94fca688b2e61a466eb9826dc424
Hardware Model:      iPhone7,1
Process:             MyAppName [826]
Path:                /private/var/mobile/Containers/Bundle/Application/13C779F5-8CEB-4815-AF64-18B08827CDEE/MyAppName.app/MyAppName
Identifier:          com.myappdomain.MyAppName
Version:             20151128 (1.4)
Code Type:           ARM-64 (Native)
Parent Process:      launchd [1]

Date/Time:           2015-12-02 07:07:58.58 +0100
Launch Time:         2015-12-02 07:07:57.57 +0100
OS Version:          iOS 9.1 (13B143)
Report Version:      105

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x200000001576a714
Triggered by Thread:  0

Filtered syslog:
None found

Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   MyAppName                   0x0000000100071a64 0x100040000 + 203364
1   MyAppName                   0x00000001000721a0 0x100040000 + 205216
2   MyAppName                   0x0000000100071d2c 0x100040000 + 204076
3   MyAppName                   0x0000000100073624 0x100040000 + 210468
4   MyAppName                   0x00000001000718d8 0x100040000 + 202968
5   MyAppName                   0x0000000100071978 0x100040000 + 203128
6   MyAppName                   0x0000000100071a20 0x100040000 + 203296
7   MyAppName                   0x0000000100072848 0x100040000 + 206920
8   MyAppName                   0x0000000100072e08 0x100040000 + 208392
9   MyAppName                   0x000000010006c6f8 0x100040000 + 182008
10  MyAppName                   0x000000010006fe68 0x100040000 + 196200
11  MyAppName                   0x000000010006afdc 0x100040000 + 176092
12  UIKit                           0x00000001883f4654 -[UIViewController _setViewAppearState:isAnimating:] + 724
13  UIKit                           0x00000001884b45c8 -[UINavigationController viewDidAppear:] + 220
14  UIKit                           0x00000001883f4654 -[UIViewController _setViewAppearState:isAnimating:] + 724
15  UIKit                           0x00000001885239b8 -[UITabBarController viewDidAppear:] + 128
16  UIKit                           0x00000001883f4654 -[UIViewController _setViewAppearState:isAnimating:] + 724
17  UIKit                           0x00000001884654f0 __64-[UIViewController viewDidMoveToWindow:shouldAppearOrDisappear:]_block_invoke + 44
18  UIKit                           0x000000018846548c -[UIViewController _executeAfterAppearanceBlock] + 92
19  UIKit                           0x000000018868c674 _runAfterCACommitDeferredBlocks + 556
20  UIKit                           0x00000001886994bc _cleanUpAfterCAFlushAndRunDeferredBlocks + 92
21  CoreFoundation                  0x0000000182e0042c __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 20
22  CoreFoundation                  0x0000000182dffd64 __CFRunLoopDoBlocks + 308
23  CoreFoundation                  0x0000000182dfdcc8 __CFRunLoopRun + 708
24  CoreFoundation                  0x0000000182d2cca0 CFRunLoopRunSpecific + 384
25  GraphicsServices                0x000000018df68088 GSEventRunModal + 180
26  UIKit                           0x0000000188444ffc UIApplicationMain + 204
27  MyAppName                   0x00000001000581e4 0x100040000 + 98788
28  libdyld.dylib                   0x000000019824a8b8 start + 4

Thread 1 name:  Dispatch queue: com.apple.libdispatch-manager
Thread 1:
0   libsystem_kernel.dylib          0x00000001983684fc kevent_qos + 8
1   libdispatch.dylib               0x000000019822ca04 _dispatch_mgr_invoke + 232
2   libdispatch.dylib               0x000000019821b874 _dispatch_source_invoke + 0

Thread 2:
0   libsystem_kernel.dylib          0x0000000198367b6c __workq_kernreturn + 8
1   libsystem_pthread.dylib         0x000000019842d530 _pthread_wqthread + 1284
2   libsystem_pthread.dylib         0x000000019842d020 start_wqthread + 4

Thread 3:
0   libsystem_kernel.dylib          0x0000000198367b6c __workq_kernreturn + 8
1   libsystem_pthread.dylib         0x000000019842d530 _pthread_wqthread + 1284
2   libsystem_pthread.dylib         0x000000019842d020 start_wqthread + 4

Thread 4:
0   libsystem_kernel.dylib          0x0000000198367b6c __workq_kernreturn + 8
1   libsystem_pthread.dylib         0x000000019842d530 _pthread_wqthread + 1284
2   libsystem_pthread.dylib         0x000000019842d020 start_wqthread + 4

Thread 5:
0   libsystem_kernel.dylib          0x0000000198367b6c __workq_kernreturn + 8
1   libsystem_pthread.dylib         0x000000019842d530 _pthread_wqthread + 1284
2   libsystem_pthread.dylib         0x000000019842d020 start_wqthread + 4

Thread 6:
0   libsystem_kernel.dylib          0x0000000198367b6c __workq_kernreturn + 8
1   libsystem_pthread.dylib         0x000000019842d530 _pthread_wqthread + 1284
2   libsystem_pthread.dylib         0x000000019842d020 start_wqthread + 4

Thread 0 crashed with ARM Thread State (64-bit):
    x0: 0x00000001576a7350   x1: 0x000000015769c200   x2: 0x0000000000000000   x3: 0x0000000100071a40
    x4: 0x000000016fdbdf60   x5: 0x000000016fdbdf68   x6: 0x0000000000000000   x7: 0x0000000000000004
    x8: 0x200000001576a69c   x9: 0x0000000000000018  x10: 0x0000000000000000  x11: 0x0000000300000003
   x12: 0x000000015755f2f0  x13: 0x0000000000003fff  x14: 0xffffffffffffc000  x15: 0x0000000000003fff
   x16: 0x000000010027da54  x17: 0x0000000182e438dc  x18: 0x0000000000000000  x19: 0x000000015769c200
   x20: 0x00000001576a7350  x21: 0x000000016fdbe260  x22: 0x000000015769c200  x23: 0x000000015769c200
   x24: 0x000000015769ccd0  x25: 0x000000015808fc20  x26: 0x000000010006ff58  x27: 0x000000016fdbe198
   x28: 0x0000000000000002  fp: 0x000000016fdbe060   lr: 0x00000001000721a0
    sp: 0x000000016fdbe020   pc: 0x0000000100071a64 cpsr: 0x20000000

Upvotes: 2

Views: 487

Answers (1)

Klaus
Klaus

Reputation: 53

Just in case someone else experiences this issue: The problem is actually a bug in Swift's implementation of array. The following code crashes in release mode:

myarr.sortInPlace($0.date < $1.date)

However, this code works just fine:

myarr = myarr.sort($0.date < $1.date)

More about this issue (which is hopefully solved soon by Apple) can be found here: https://forums.developer.apple.com/thread/23455

Upvotes: 0

Related Questions