0

I am working on an app written in Swift 5.

Following IDE I am using:

XCode 14.2 with Command-Line Tools 14.2 App minimum support iOS 12

The problem only occurs on production/testflight environment.

Here is the crash log:

Incident Identifier: 8C544E91-D8F2-420C-A232-330CC2B9D46D
Hardware Model:      iPhone11,8
Process:             censored [738]
Path:                /private/var/containers/Bundle/Application/B7C22718-CCAB-42BD-B15B-EE18FA327E8D/censored.app/censored
Identifier:          censored
Version:             1.2.4 (5)
AppStoreTools:       14C17
AppVariant:          1:iPhone11,8:16
Beta:                YES
Code Type:           ARM-64 (Native)
Role:                unknown
Parent Process:      launchd [1]
Coalition:           censored [738]

Date/Time:           2023-01-23 06:55:36.5057 +0100
Launch Time:         2023-01-22 09:54:05.5881 +0100
OS Version:          iPhone OS 16.2 (20C65)
Release Type:        User
Baseband Version:    5.01.01
Report Version:      104

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x0000000000000004
Exception Codes: 0x0000000000000001, 0x0000000000000004
VM Region Info: 0x4 is not in any region.  Bytes before following region: 68719476732
      REGION TYPE                 START - END      [ VSIZE] PRT/MAX SHRMOD  REGION DETAIL
      UNUSED SPACE AT START
--->  
      commpage (reserved)     1000000000-7000000000 [384.0G] ---/--- SM=NUL  ...(unallocated)
Termination Reason: SIGNAL 11 Segmentation fault: 11
Terminating Process: exc handler [738]

Triggered by Thread:  0


Thread 0 name:
Thread 0 Crashed:
0   CoreData                        0x00000001bd15cb1c _PFObjectIDFastHash64 + 40 (NSBasicObjectID.m:728)
1   CoreData                        0x00000001bd15cb18 _PFObjectIDFastHash64 + 36 (NSBasicObjectID.m:727)
2   CoreFoundation                  0x00000001b5875a30 __CFBasicHashRehash + 968 (CFBasicHash.c:502)
3   CoreFoundation                  0x00000001b58c16b4 CFBasicHashRemoveValue + 2332 (CFBasicHash.c:1415)
4   CoreFoundation                  0x00000001b58e8310 CFDictionaryRemoveValue + 328 (CFDictionary.c:496)
5   CoreData                        0x00000001bd07813c -[NSManagedObjectContext(_NSInternalAdditions) _forgetObject:propagateToObjectStore:removeFromRegistry:] + 120 (NSManagedObjectContext.m:5170)
6   CoreData                        0x00000001bd077d08 -[_PFManagedObjectReferenceQueue _processReferenceQueue:] + 616 (NSManagedObjectContext.m:5159)
7   CoreData                        0x00000001bd07863c _performRunLoopAction + 364 (NSManagedObjectContext.m:0)
8   CoreFoundation                  0x00000001b58e5d40 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 36 (CFRunLoop.c:1789)
9   CoreFoundation                  0x00000001b586e290 __CFRunLoopDoObservers + 532 (CFRunLoop.c:1902)
10  CoreFoundation                  0x00000001b58cfc60 __CFRunLoopRun + 1048 (CFRunLoop.c:2981)
11  CoreFoundation                  0x00000001b58d4ec0 CFRunLoopRunSpecific + 612 (CFRunLoop.c:3418)
12  GraphicsServices                0x00000001ef92b368 GSEventRunModal + 164 (GSEvent.c:2196)
13  UIKitCore                       0x00000001b7dca86c -[UIApplication _run] + 888 (UIApplication.m:3754)
14  UIKitCore                       0x00000001b7dca4d0 UIApplicationMain + 340 (UIApplication.m:5344)
15  censored                    0x00000001047c7e54 0x1047c0000 + 32340
16  dyld                            0x00000001d40f6960 start + 2528 (dyldMain.cpp:1170)

Thread 1:
0   libsystem_pthread.dylib         0x00000002038e5b90 start_wqthread + 0

Thread 2:
0   libsystem_pthread.dylib         0x00000002038e5b90 start_wqthread + 0

Thread 3 name:
Thread 3:
0   libsystem_kernel.dylib          0x00000001f31c8aa8 mach_msg2_trap + 8
1   libsystem_kernel.dylib          0x00000001f31dafc4 mach_msg2_internal + 80 (mach_msg.c:201)
2   libsystem_kernel.dylib          0x00000001f31db204 mach_msg_overwrite + 388 (mach_msg.c:0)
3   libsystem_kernel.dylib          0x00000001f31c8fec mach_msg + 24 (mach_msg.c:323)
4   CoreFoundation                  0x00000001b58cead4 __CFRunLoopServiceMachPort + 160 (CFRunLoop.c:2622)
5   CoreFoundation                  0x00000001b58cfd18 __CFRunLoopRun + 1232 (CFRunLoop.c:3005)
6   CoreFoundation                  0x00000001b58d4ec0 CFRunLoopRunSpecific + 612 (CFRunLoop.c:3418)
7   Foundation                      0x00000001afc1b0d4 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 212 (NSRunLoop.m:373)
8   Foundation                      0x00000001afc1afbc -[NSRunLoop(NSRunLoop) runUntilDate:] + 64 (NSRunLoop.m:420)
9   UIKitCore                       0x00000001b7eff72c -[UIEventFetcher threadMain] + 436 (UIEventFetcher.m:1385)
10  Foundation                      0x00000001afc345a8 __NSThread__start__ + 716 (NSThread.m:963)
11  libsystem_pthread.dylib         0x00000002038e66cc _pthread_start + 148 (pthread.c:893)
12  libsystem_pthread.dylib         0x00000002038e5ba4 thread_start + 8

Thread 4:
0   libsystem_pthread.dylib         0x00000002038e5b90 start_wqthread + 0

Thread 5 name:
Thread 5:
0   libsystem_kernel.dylib          0x00000001f31c8aa8 mach_msg2_trap + 8
1   libsystem_kernel.dylib          0x00000001f31dafc4 mach_msg2_internal + 80 (mach_msg.c:201)
2   libsystem_kernel.dylib          0x00000001f31db204 mach_msg_overwrite + 388 (mach_msg.c:0)
3   libsystem_kernel.dylib          0x00000001f31c8fec mach_msg + 24 (mach_msg.c:323)
4   CoreFoundation                  0x00000001b58cead4 __CFRunLoopServiceMachPort + 160 (CFRunLoop.c:2622)
5   CoreFoundation                  0x00000001b58cfd18 __CFRunLoopRun + 1232 (CFRunLoop.c:3005)
6   CoreFoundation                  0x00000001b58d4ec0 CFRunLoopRunSpecific + 612 (CFRunLoop.c:3418)
7   CoreFoundation                  0x00000001b5918ce4 CFRunLoopRun + 64 (CFRunLoop.c:3444)
8   CoreMotion                      0x00000001c0e92e84 CLMotionCore::runMotionThread(void*) + 1208 (CLMotionCore.mm:376)
9   libsystem_pthread.dylib         0x00000002038e66cc _pthread_start + 148 (pthread.c:893)
10  libsystem_pthread.dylib         0x00000002038e5ba4 thread_start + 8

Thread 6 name:
Thread 6:
0   libsystem_kernel.dylib          0x00000001f31c8aa8 mach_msg2_trap + 8
1   libsystem_kernel.dylib          0x00000001f31dafc4 mach_msg2_internal + 80 (mach_msg.c:201)
2   libsystem_kernel.dylib          0x00000001f31db204 mach_msg_overwrite + 388 (mach_msg.c:0)
3   libsystem_kernel.dylib          0x00000001f31c8fec mach_msg + 24 (mach_msg.c:323)
4   CoreFoundation                  0x00000001b58cead4 __CFRunLoopServiceMachPort + 160 (CFRunLoop.c:2622)
5   CoreFoundation                  0x00000001b58cfd18 __CFRunLoopRun + 1232 (CFRunLoop.c:3005)
6   CoreFoundation                  0x00000001b58d4ec0 CFRunLoopRunSpecific + 612 (CFRunLoop.c:3418)
7   CFNetwork                       0x00000001b6c40078 +[__CFN_CoreSchedulingSetRunnable _run:] + 392 (CoreSchedulingSet.mm:1372)
8   Foundation                      0x00000001afc345a8 __NSThread__start__ + 716 (NSThread.m:963)
9   libsystem_pthread.dylib         0x00000002038e66cc _pthread_start + 148 (pthread.c:893)
10  libsystem_pthread.dylib         0x00000002038e5ba4 thread_start + 8

Thread 7:
0   libsystem_pthread.dylib         0x00000002038e5b90 start_wqthread + 0

Thread 8:
0   libsystem_pthread.dylib         0x00000002038e5b90 start_wqthread + 0

Thread 9:
0   libsystem_pthread.dylib         0x00000002038e5b90 start_wqthread + 0

Thread 10 name:
Thread 10:
0   CoreData                        0x00000001bd0782ec -[NSManagedObjectContext(_NSInternalAdditions) _forgetObject:propagateToObjectStore:removeFromRegistry:] + 552 (NSManagedObjectContext.m:5198)
1   CoreData                        0x00000001bd07813c -[NSManagedObjectContext(_NSInternalAdditions) _forgetObject:propagateToObjectStore:removeFromRegistry:] + 120 (NSManagedObjectContext.m:5170)
2   CoreData                        0x00000001bd077d08 -[_PFManagedObjectReferenceQueue _processReferenceQueue:] + 616 (NSManagedObjectContext.m:5159)
3   CoreData                        0x00000001bd0d18c0 -[_PFAutoreleasePoolThunk dealloc] + 48 (_PFRoutines.m:4766)
4   libobjc.A.dylib                 0x00000001aeb195d8 AutoreleasePoolPage::releaseUntil(objc_object**) + 196 (NSObject.mm:938)
5   libobjc.A.dylib                 0x00000001aeb1cf80 objc_autoreleasePoolPop + 256 (NSObject.mm:1208)
6   libdispatch.dylib               0x00000001bce786a8 _dispatch_lane_serial_drain + 692 (inline_internal.h:2632)
7   libdispatch.dylib               0x00000001bce79214 _dispatch_lane_invoke + 436 (queue.c:3940)
8   libdispatch.dylib               0x00000001bce83e10 _dispatch_workloop_worker_thread + 652 (queue.c:6846)
9   libsystem_pthread.dylib         0x00000002038e5df8 _pthread_wqthread + 288 (pthread.c:2618)
10  libsystem_pthread.dylib         0x00000002038e5b98 start_wqthread + 8

Thread 11:
0   libsystem_pthread.dylib         0x00000002038e5b90 start_wqthread + 0


Thread 0 crashed with ARM Thread State (64-bit):
    x0: 0x0000000000000000   x1: 0x0000000000000000   x2: 0x0000000000000000   x3: 0x000000010b04dfc0
    x4: 0x000000010b04be80   x5: 0x0000000000000010   x6: 0x0000000000000002   x7: 0x0000000000000000
    x8: 0x0000000000000005   x9: 0x00000001bd15caf4  x10: 0x0000000283475900  x11: 0x000000020bdaf4f8
   x12: 0x000000000000e9e9  x13: 0x00000000ffff81a3  x14: 0x000000000000022f  x15: 0x000000010b04be00
   x16: 0x00000001aeb1df14  x17: 0x000000020d1fed10  x18: 0x0000000000000000  x19: 0x0000000000000000
   x20: 0x0000000000000000  x21: 0x000000010b820400  x22: 0x000000010b822600  x23: 0x00000000a5baadb9
   x24: 0x0000000000000000  x25: 0xb12e8688d6f54e96  x26: 0x00000000000004a0  x27: 0x0000000281d55f28
   x28: 0x0000000000000af3   fp: 0x000000016b63d000   lr: 0x6f76ee81bd15cb18
    sp: 0x000000016b63cff0   pc: 0x00000001bd15cb1c cpsr: 0x80000000
   esr: 0x92000006 (Data Abort) byte read Translation fault


Binary Images:
0x1047c0000 - 0x105373fff censored arm64  <c0f346398f7d30cd9a5ed7c19798f756> /private/var/containers/Bundle/Application/B7C22718-CCAB-42BD-B15B-EE18FA327E8D/censored.app/censored
0x1aeb18000 - 0x1aeb5be1f libobjc.A.dylib arm64e  <d6ecfb730ca23a21a3a919e450d3b49c> /usr/lib/libobjc.A.dylib
0x1afbd9000 - 0x1b0522fff Foundation arm64e  <07a92f05d8ec327eab3341db9f77ba16> /System/Library/Frameworks/Foundation.framework/Foundation
0x1b5854000 - 0x1b5c39fff CoreFoundation arm64e  <725e49f4653b39bf9a7a8a3250911ecb> /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
0x1b69e8000 - 0x1b6db1fff CFNetwork arm64e  <8a75357d7e213fb38b1e4c0f63e8dc02> /System/Library/Frameworks/CFNetwork.framework/CFNetwork
0x1b7a29000 - 0x1b9214fff UIKitCore arm64e  <59cbc9b530ae396ea269a986640001bc> /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore
0x1bce6d000 - 0x1bceb3fff libdispatch.dylib arm64e  <24db930d870b31ceac69534d7896b4a8> /usr/lib/system/libdispatch.dylib
0x1bd074000 - 0x1bd3d2fff CoreData arm64e  <d4bb4c9df564335994671723093ccf9e> /System/Library/Frameworks/CoreData.framework/CoreData
0x1c0e7f000 - 0x1c1286fff CoreMotion arm64e  <b60e13f1eeef3b76bb8d421893a11b6f> /System/Library/Frameworks/CoreMotion.framework/CoreMotion
0x1d40e1000 - 0x1d416408f dyld arm64e  <7b63c57361613b33a3a29944ba59722f> /usr/lib/dyld
0x1ef92a000 - 0x1ef932fff GraphicsServices arm64e  <5adda888f38735f787a7e01fcb9bb928> /System/Library/PrivateFrameworks/GraphicsServices.framework/GraphicsServices
0x1f31c4000 - 0x1f31fefe3 libsystem_kernel.dylib arm64e  <9daa5c2993e03768a3e1e139995dc4af> /usr/lib/system/libsystem_kernel.dylib
0x2038e5000 - 0x2038f0fff libsystem_pthread.dylib arm64e  <f2ba7ec0f75a3345b4f6f7da4979b902> /usr/lib/system/libsystem_pthread.dylib

How can I fix this issue?

I tried to activate Address Sanitizer, Thread Sanitizer and Zombie Objects but I can't catch this CoreData Error in the Debugger. The App doesn't use any Concurrency/MOC implementations.

Teesirup
  • 1
  • 3
  • It’s hard to say from that error, but it would be a really good idea to use Core Data SQL debugging and Core Data concurrency debugging, as described [here](https://stackoverflow.com/questions/41176098/is-this-a-valid-way-of-debugging-coredata-concurrency-issues). – Tom Harrington Jan 23 '23 at 17:02

0 Answers0