iCloud/CoreData Crashing [NSFetchResultsController _computeSectionInfo:error]

Incident Identifier: C6D65C96-2F92-4C4E-8959-4B329D8FF7D0
Hardware Model:      iPhone14,2
Process:             iPhemeris [36641]
Path:                /private/var/containers/Bundle/Application/4AD53A22-66DA-4817-AB75-58AB2D1D6323/iPhemeris.app/iPhemeris
Identifier:          cribaudo.iphemeris
Version:             11.6 (141)
AppStoreTools:       14C17
AppVariant:          1:iPhone14,2:15
Code Type:           ARM-64 (Native)
Role:                Foreground
Parent Process:      launchd [1]
Coalition:           cribaudo.iphemeris [10572]

Date/Time:           2023-03-21 11:29:41.0431 -0500
Launch Time:         2023-03-20 07:40:23.0692 -0500
OS Version:          iPhone OS 16.2 (20C65)
Release Type:        User
Baseband Version:    2.21.00
Report Version:      104

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x00005dda938ea6b0 -> 0x0000005a938ea6b0 (possible pointer authentication failure)
Exception Codes: 0x0000000000000001, 0x00005dda938ea6b0
VM Region Info: 0x5a938ea6b0 is in 0x1000000000-0x7000000000;  bytes after start: 320303179440  bytes before end: 92013680975
      REGION TYPE                 START - END      [ VSIZE] PRT/MAX SHRMOD  REGION DETAIL
      commpage (reserved)      fc0000000-1000000000 [  1.0G] ---/--- SM=NUL  ...(unallocated)
--->  GPU Carveout (reserved) 1000000000-7000000000 [384.0G] ---/--- SM=NUL  ...(unallocated)
      UNUSED SPACE AT END
Termination Reason: SIGNAL 11 Segmentation fault: 11
Terminating Process: exc handler [36641]

Triggered by Thread:  0


Kernel Triage:
VM - pmap_enter retried due to resource shortage
VM - pmap_enter retried due to resource shortage
VM - pmap_enter retried due to resource shortage
VM - pmap_enter retried due to resource shortage
VM - pmap_enter retried due to resource shortage


Thread 0 name:
Thread 0 Crashed:
0   libobjc.A.dylib               	0x00000001a1e01c20 objc_msgSend + 32
1   CoreFoundation                	0x00000001a8b4d918 isEqualToString + 100 (NSTaggedPointerString.m:263)
2   CoreData                      	0x00000001b0424748 -[NSFetchedResultsController _computeSectionInfo:error:] + 712 (NSFetchedResultsController.m:1184)
3   CoreData                      	0x00000001b03adbf0 __43-[NSFetchedResultsController performFetch:]_block_invoke + 520 (NSFetchedResultsController.m:486)
4   CoreData                      	0x00000001b03e6de0 developerSubmittedBlockToNSManagedObjectContextPerform + 156 (NSManagedObjectContext.m:3964)
5   CoreData                      	0x00000001b03e6930 -[NSManagedObjectContext performBlockAndWait:] + 208 (NSManagedObjectContext.m:4075)
6   CoreData                      	0x00000001b03c3b0c -[NSFetchedResultsController _recursivePerformBlockAndWait:withContext:] + 152 (NSFetchedResultsController.m:548)
7   CoreData                      	0x00000001b03c19f8 -[NSFetchedResultsController performFetch:] + 252 (NSFetchedResultsController.m:524)
8   iPhemeris                     	0x0000000102087e14 -[SavedChartViewController initializeFetchedResultsController] + 460 (SavedChartViewController.m:502)
9   CoreFoundation                	0x00000001a8b7b3c4 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 148 (CFNotificationCenter.c:661)
10  CoreFoundation                	0x00000001a8c22454 ___CFXRegistrationPost_block_invoke + 88 (CFNotificationCenter.c:175)
11  CoreFoundation                	0x00000001a8c05704 _CFXRegistrationPost + 440 (CFNotificationCenter.c:201)
12  CoreFoundation                	0x00000001a8b8f9c8 _CFXNotificationPost + 704 (CFNotificationCenter.c:1193)
13  Foundation                    	0x00000001a2f1dd9c -[NSNotificationCenter postNotificationName:object:userInfo:] + 92 (NSNotification.m:518)
14  iPhemeris                     	0x00000001021011a4 CoreDataUtil.sendMOCReadyNotificationForPlatform() + 24 (CoreDataUtil.swift:162)
15  iPhemeris                     	0x00000001021011a4 closure #1 in CoreDataUtil.initCoreDataStack() + 188 (CoreDataUtil.swift:66)
16  iPhemeris                     	0x0000000102101448 thunk for @escaping @callee_guaranteed (@guaranteed NSPersistentStoreDescription, @guaranteed Error?) -> () + 80 (:0)
17  CoreData                      	0x00000001b03bf894 -[NSPersistentStoreCoordinator _doAddPersistentStoreWithDescription:privateCopy:completeOnMainThread:withHandler:] + 668 (NSPersistentStoreCoordinator.m:1366)
18  CoreData                      	0x00000001b042321c -[NSPersistentStoreCoordinator addPersistentStoreWithDescription:completionHandler:] + 228 (NSPersistentStoreCoordinator.m:1412)
19  CoreData                      	0x00000001b0422fd8 -[NSPersistentContainer _loadStoreDescriptions:withCompletionHandler:] + 184 (NSPersistentContainer.m:291)
20  CoreData                      	0x00000001b0422cfc -[NSPersistentCloudKitContainer _loadStoreDescriptions:withCompletionHandler:] + 536 (NSPersistentCloudKitContainer.m:156)
21  CoreData                      	0x00000001b0422ee4 -[NSPersistentContainer loadPersistentStoresWithCompletionHandler:] + 248 (NSPersistentContainer.m:274)
22  iPhemeris                     	0x0000000102101044 CoreDataUtil.initCoreDataStack() + 1308 (CoreDataUtil.swift:61)
23  iPhemeris                     	0x000000010210148c @objc CoreDataUtil.initCoreDataStack() + 28 (:0)
24  iPhemeris                     	0x000000010207febc -[iPhemerisAppDelegate application:didFinishLaunchingWithOptions:] + 1944 (iPhemerisAppDelegate.m:413)
25  UIKitCore                     	0x00000001ab072c54 -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 300 (UIApplication.m:2518)
26  UIKitCore                     	0x00000001ab072378 -[UIApplication _callInitializationDelegatesWithActions:forCanvas:payload:fromOriginatingProcess:] + 2848 (UIApplication.m:2949)
27  UIKitCore                     	0x00000001ab071354 -[UIApplication _runWithMainScene:transitionContext:completion:] + 856 (UIApplication.m:4754)
28  UIKitCore                     	0x00000001ab070fa0 -[_UISceneLifecycleMultiplexer completeApplicationLaunchWithFBSScene:transitionContext:] + 132 (_UISceneLifecycleMultiplexer.m:451)
29  UIKitCore                     	0x00000001aadb720c _UIScenePerformActionsWithLifecycleActionMask + 108 (_UISceneLifecycleState.m:109)
30  UIKitCore                     	0x00000001ab0f8e98 __101-[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:]_block_invoke + 216 (_UISceneLifecycleMultiplexer.m:564)
31  UIKitCore                     	0x00000001aafa9ce0 -[_UISceneLifecycleMultiplexer _performBlock:withApplicationOfDeactivationReasons:fromReasons:] + 220 (_UISceneLifecycleMultiplexer.m:513)
32  UIKitCore                     	0x00000001aafa9b08 -[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:] + 620 (_UISceneLifecycleMultiplexer.m:563)
33  UIKitCore                     	0x00000001aafa96b8 -[_UISceneLifecycleMultiplexer uiScene:transitionedFromState:withTransitionContext:] + 252 (_UISceneLifecycleMultiplexer.m:469)
34  UIKitCore                     	0x00000001aafa9584 __186-[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:]_block... + 148 (_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction.m:73)
35  UIKitCore                     	0x00000001ab68d2b8 +[BSAnimationSettings(UIKit) tryAnimatingWithSettings:fromCurrentState:actions:completion:] + 736 (BSAnimationSettings+UIKit.m:54)
36  UIKitCore                     	0x00000001ab726a8c _UISceneSettingsDiffActionPerformChangesWithTransitionContextAndCompletion + 224 (_UISceneSettingsDiffAction.m:27)
37  UIKitCore                     	0x00000001aae5558c -[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:] + 316 (_UISceneSettingsDiffAction.m:20)
38  UIKitCore                     	0x00000001ab2c8184 __64-[UIScene scene:didUpdateWithDiff:transitionContext:completion:]_block_invoke.214 + 556 (UIScene.m:2000)
39  UIKitCore                     	0x00000001aaf27bb8 -[UIScene _emitSceneSettingsUpdateResponseForCompletion:afterSceneUpdateWork:] + 216 (UIScene.m:1676)
40  UIKitCore                     	0x00000001aaf27a28 -[UIScene scene:didUpdateWithDiff:transitionContext:completion:] + 244 (UIScene.m:1962)
41  UIKitCore                     	0x00000001aaf26f7c -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 520 (UIApplication.m:4203)
42  UIKitCore                     	0x00000001aaf26d08 -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 288 (UIApplicationSceneClientAgent.m:47)
43  FrontBoardServices            	0x00000001be874e90 -[FBSScene _callOutQueue_agent_didCreateWithTransitionContext:completion:] + 344 (FBSScene.m:440)
44  FrontBoardServices            	0x00000001be8b48f8 __92-[FBSWorkspaceScenesClient createSceneWithIdentity:parameters:transitionContext:completion:]_block_invoke.78 + 120 (FBSWorkspaceScenesClient.m:383)
45  FrontBoardServices            	0x00000001be878c24 -[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:] + 168 (FBSWorkspace.m:359)
46  FrontBoardServices            	0x00000001be8b4530 __92-[FBSWorkspaceScenesClient createSceneWithIdentity:parameters:transitionContext:completion:]_block_invoke + 360 (FBSWorkspaceScenesClient.m:382)
47  libdispatch.dylib             	0x00000001b0160fdc _dispatch_client_callout + 20 (object.m:560)
48  libdispatch.dylib             	0x00000001b0164a5c _dispatch_block_invoke_direct + 264 (queue.c:496)
49  FrontBoardServices            	0x00000001be882d40 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 52 (FBSSerialQueue.m:157)
50  FrontBoardServices            	0x00000001be8828dc -[FBSSerialQueue _targetQueue_performNextIfPossible] + 220 (FBSSerialQueue.m:181)
51  FrontBoardServices            	0x00000001be885184 -[FBSSerialQueue _performNextFromRunLoopSource] + 28 (FBSSerialQueue.m:194)
52  CoreFoundation                	0x00000001a8c19f34 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28 (CFRunLoop.c:1957)
53  CoreFoundation                	0x00000001a8c2630c __CFRunLoopDoSource0 + 176 (CFRunLoop.c:2001)
54  CoreFoundation                	0x00000001a8baa230 __CFRunLoopDoSources0 + 340 (CFRunLoop.c:2046)
55  CoreFoundation                	0x00000001a8bbfb8c __CFRunLoopRun + 836 (CFRunLoop.c:2953)
56  CoreFoundation                	0x00000001a8bc4ec0 CFRunLoopRunSpecific + 612 (CFRunLoop.c:3418)
57  GraphicsServices              	0x00000001e2c1b368 GSEventRunModal + 164 (GSEvent.c:2196)
58  UIKitCore                     	0x00000001ab0ba86c -[UIApplication _run] + 888 (UIApplication.m:3754)
59  UIKitCore                     	0x00000001ab0ba4d0 UIApplicationMain + 340 (UIApplication.m:5344)
60  iPhemeris                     	0x0000000102079f3c main + 72 (main.m:15)
61  dyld                          	0x00000001c73e6960 start + 2528 (dyldMain.cpp:1170)

Thread 1 name:
Thread 1:
0   libsystem_kernel.dylib        	0x00000001e64b95e0 __ulock_wait + 8 (:-1)
1   libdispatch.dylib             	0x00000001b01619cc _dlock_wait + 56 (lock.c:326)
2   libdispatch.dylib             	0x00000001b0161780 _dispatch_thread_event_wait_slow + 56 (lock.c:368)
3   libdispatch.dylib             	0x00000001b0170860 __DISPATCH_WAIT_FOR_QUEUE__ + 368 (lock.h:330)
4   libdispatch.dylib             	0x00000001b017040c _dispatch_sync_f_slow + 144 (queue.c:1769)
5   AXCoreUtilities               	0x00000001b3d20208 AXPerformBlockSynchronouslyOnMainThread + 108 (AXConcurrencyUtilities.m:82)
6   AccessibilityUtilities        	0x00000001b2234b14 ___AXSharedDisplayManager_block_invoke_2 + 40 (AXDevice.m:555)
7   libdispatch.dylib             	0x00000001b015f4b4 _dispatch_call_block_and_release + 32 (init.c:1518)
8   libdispatch.dylib             	0x00000001b0160fdc _dispatch_client_callout + 20 (object.m:560)
9   libdispatch.dylib             	0x00000001b01640c8 _dispatch_queue_override_invoke + 788 (inline_internal.h:2632)
10  libdispatch.dylib             	0x00000001b0172a6c _dispatch_root_queue_drain + 396 (inline_internal.h:0)
11  libdispatch.dylib             	0x00000001b0173284 _dispatch_worker_thread2 + 164 (queue.c:7052)
12  libsystem_pthread.dylib       	0x00000001f6bd5dbc _pthread_wqthread + 228 (pthread.c:2631)
13  libsystem_pthread.dylib       	0x00000001f6bd5b98 start_wqthread + 8 (:-1)

Thread 2:
0   libsystem_pthread.dylib       	0x00000001f6bd5b90 start_wqthread + 0 (:-1)

Thread 3 name:
Thread 3:
0   libsystem_kernel.dylib        	0x00000001e64b95e0 __ulock_wait + 8 (:-1)
1   libdispatch.dylib             	0x00000001b01619cc _dlock_wait + 56 (lock.c:326)
2   libdispatch.dylib             	0x00000001b0161780 _dispatch_thread_event_wait_slow + 56 (lock.c:368)
3   libdispatch.dylib             	0x00000001b0170860 __DISPATCH_WAIT_FOR_QUEUE__ + 368 (lock.h:330)
4   libdispatch.dylib             	0x00000001b017040c _dispatch_sync_f_slow + 144 (queue.c:1769)
5   UIKitCore                     	0x00000001ab0bab40 __37-[_UIRemoteKeyboards startConnection]_block_invoke_3 + 156 (_UIRemoteKeyboards.m:1137)
6   CoreFoundation                	0x00000001a8bb86c4 __invoking___ + 148 (:-1)
7   CoreFoundation                	0x00000001a8b64b2c -[NSInvocation invoke] + 428 (NSForwarding.m:3377)
8   Foundation                    	0x00000001a2f62908 __NSXPCCONNECTION_IS_CALLING_OUT_TO_REPLY_BLOCK__ + 16 (NSXPCConnection.m:170)
9   Foundation                    	0x00000001a2f33c90 -[NSXPCConnection _decodeAndInvokeReplyBlockWithEvent:sequence:replyInfo:] + 520 (NSXPCConnection.m:316)
10  Foundation                    	0x00000001a350d244 __88-[NSXPCConnection _sendInvocation:orArguments:count:methodSignature:selector:withProxy:]_block_invoke_5 + 188 (NSXPCConnection.m:1662)
11  libxpc.dylib                  	0x00000001f6c36d48 _xpc_connection_reply_callout + 124 (serializer.c:119)
12  libxpc.dylib                  	0x00000001f6c29b90 _xpc_connection_call_reply_async + 88 (connection.c:857)
13  libdispatch.dylib             	0x00000001b016105c _dispatch_client_callout3 + 20 (object.m:586)
14  libdispatch.dylib             	0x00000001b017ef58 _dispatch_mach_msg_async_reply_invoke + 344 (mach.c:2462)
15  libdispatch.dylib             	0x00000001b016856c _dispatch_lane_serial_drain + 376 (inline_internal.h:0)
16  libdispatch.dylib             	0x00000001b0169214 _dispatch_lane_invoke + 436 (queue.c:3940)
17  libdispatch.dylib             	0x00000001b0173e10 _dispatch_workloop_worker_thread + 652 (queue.c:6846)
18  libsystem_pthread.dylib       	0x00000001f6bd5df8 _pthread_wqthread + 288 (pthread.c:2618)
19  libsystem_pthread.dylib       	0x00000001f6bd5b98 start_wqthread + 8 (:-1)

Thread 4 name:
Thread 4:
0   CoreFoundation                	0x00000001a8bc7b5c __CFStringHash + 264 (CFString.c:1314)
1   CoreFoundation                	0x00000001a8b4640c -[__NSDictionaryM setObject:forKey:] + 348 (NSDictionaryM_Common.h:19)
2   CoreData                      	0x00000001b039a5f4 -[NSEntityDescription(_NSEntityDescriptionPrivateMethods) _addProperty:] + 224 (NSEntityDescription.m:1795)
3   CoreData                      	0x00000001b039a488 -[NSEntityDescription _setProperties:preserveIndices:] + 424 (NSEntityDescription.m:1178)
4   CoreData                      	0x00000001b03ca578 +[_PFModelUtilities addAttributes:toPropertiesOfEntity:] + 148 (_PFModelUtilities.m:43)
5   CoreData                      	0x00000001b04a45b4 +[PFCloudKitMetadataModel _newMetadataModelV13] + 3852 (PFCloudKitMetadataModel.m:2692)
6   CoreData                      	0x00000001b042a8ec +[PFCloudKitMetadataModel identifyModelForStore:withConnection:hasOldMetadataTables:] + 204 (PFCloudKitMetadataModel.m:324)
7   CoreData                      	0x00000001b042e4c0 __71-[PFCloudKitMetadataModelMigrator checkAndPerformMigrationIfNecessary:]_block_invoke + 340 (PFCloudKitMetadataModelMigrator.m:94)
8   CoreData                      	0x00000001b03a2c60 -[NSSQLBlockRequestContext executeRequestCore:] + 52 (NSSQLBlockRequestContext.m:34)
9   CoreData                      	0x00000001b03a08e8 -[NSSQLStoreRequestContext executeRequestUsingConnection:] + 252 (NSSQLStoreRequestContext.m:183)
10  CoreData                      	0x00000001b03a052c __52-[NSSQLDefaultConnectionManager handleStoreRequest:]_block_invoke + 60 (NSSQLConnectionManager.m:301)
11  CoreData                      	0x00000001b044854c __37-[NSSQLiteConnection performAndWait:]_block_invoke + 48 (NSSQLiteConnection.m:738)
12  libdispatch.dylib             	0x00000001b0160fdc _dispatch_client_callout + 20 (object.m:560)
13  libdispatch.dylib             	0x00000001b0170574 _dispatch_lane_barrier_sync_invoke_and_complete + 56 (queue.c:1023)
14  CoreData                      	0x00000001b04483ec -[NSSQLiteConnection performAndWait:] + 176 (NSSQLiteConnection.m:735)
15  CoreData                      	0x00000001b038ff78 -[NSSQLDefaultConnectionManager handleStoreRequest:] + 248 (NSSQLConnectionManager.m:296)
16  CoreData                      	0x00000001b038fe48 -[NSSQLCoreDispatchManager routeStoreRequest:] + 228 (NSSQLCoreDispatchManager.m:60)
17  CoreData                      	0x00000001b037f074 -[NSSQLCore dispatchRequest:withRetries:] + 164 (NSSQLCore.m:3905)
18  CoreData                      	0x00000001b03e4bc4 -[PFCloudKitMetadataModelMigrator checkAndPerformMigrationIfNecessary:] + 276 (PFCloudKitMetadataModelMigrator.m:1158)
19  CoreData                      	0x00000001b0439c68 +[PFCloudKitMetadataModel checkAndRepairSchemaOfStore:withManagedObjectContext:error:] + 232 (PFCloudKitMetadataModel.m:180)
20  CoreData                      	0x00000001b03e447c __56-[PFCloudKitSetupAssistant _checkAndInitializeMetadata:]_block_invoke + 244 (PFCloudKitSetupAssistant.m:128)
21  CoreData                      	0x00000001b046a214 -[PFCloudKitStoreMonitor performBlock:] + 92 (PFCloudKitStoreMonitor.m:144)
22  CoreData                      	0x00000001b051de54 -[PFCloudKitSetupAssistant _initializeCloudKitForObservedStore:andNoteMetadataInitialization:] + 272 (PFCloudKitSetupAssistant.m:112)
23  CoreData                      	0x00000001b03f9490 __52-[NSCloudKitMirroringDelegate _performSetupRequest:]_block_invoke + 380 (NSCloudKitMirroringDelegate.m:1087)
24  CoreData                      	0x00000001b0466248 __92-[NSCloudKitMirroringDelegate _openTransactionWithLabel:assertionLabel:andExecuteWorkBlock:]_block_invoke + 72 (NSCloudKitMirroringDelegate.m:918)
25  libdispatch.dylib             	0x00000001b015f4b4 _dispatch_call_block_and_release + 32 (init.c:1518)
26  libdispatch.dylib             	0x00000001b0160fdc _dispatch_client_callout + 20 (object.m:560)
27  libdispatch.dylib             	0x00000001b0168694 _dispatch_lane_serial_drain + 672 (inline_internal.h:2632)
28  libdispatch.dylib             	0x00000001b0169214 _dispatch_lane_invoke + 436 (queue.c:3940)
29  libdispatch.dylib             	0x00000001b0173e10 _dispatch_workloop_worker_thread + 652 (queue.c:6846)
30  libsystem_pthread.dylib       	0x00000001f6bd5df8 _pthread_wqthread + 288 (pthread.c:2618)
31  libsystem_pthread.dylib       	0x00000001f6bd5b98 start_wqthread + 8 (:-1)

Thread 5:
0   libsystem_pthread.dylib       	0x00000001f6bd5b90 start_wqthread + 0 (:-1)

Thread 6 name:
Thread 6:
0   libsystem_kernel.dylib        	0x00000001e64b8aa8 mach_msg2_trap + 8 (:-1)
1   libsystem_kernel.dylib        	0x00000001e64cafc4 mach_msg2_internal + 80 (mach_msg.c:201)
2   libsystem_kernel.dylib        	0x00000001e64cb204 mach_msg_overwrite + 388 (mach_msg.c:0)
3   libsystem_kernel.dylib        	0x00000001e64b8fec mach_msg + 24 (mach_msg.c:323)
4   CoreFoundation                	0x00000001a8bbead4 __CFRunLoopServiceMachPort + 160 (CFRunLoop.c:2622)
5   CoreFoundation                	0x00000001a8bbfd18 __CFRunLoopRun + 1232 (CFRunLoop.c:3005)
6   CoreFoundation                	0x00000001a8bc4ec0 CFRunLoopRunSpecific + 612 (CFRunLoop.c:3418)
7   Foundation                    	0x00000001a2f030d4 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 212 (NSRunLoop.m:373)
8   Foundation                    	0x00000001a2f02fbc -[NSRunLoop(NSRunLoop) runUntilDate:] + 64 (NSRunLoop.m:420)
9   UIKitCore                     	0x00000001ab1ef72c -[UIEventFetcher threadMain] + 436 (UIEventFetcher.m:1385)
10  Foundation                    	0x00000001a2f1c5a8 __NSThread__start__ + 716 (NSThread.m:963)
11  libsystem_pthread.dylib       	0x00000001f6bd66cc _pthread_start + 148 (pthread.c:893)
12  libsystem_pthread.dylib       	0x00000001f6bd5ba4 thread_start + 8 (:-1)

Thread 7 name:
Thread 7:
0   CoreFoundation                	0x00000001a8b4d47c __CFSimpleMergeSort + 560 (CFSortFunctions.c:106)
1   CoreFoundation                	0x00000001a8b4d3c8 __CFSimpleMergeSort + 380 (CFSortFunctions.c:111)
2   CoreFoundation                	0x00000001a8bc33f0 CFSortIndexes + 320 (CFSortFunctions.c:322)
3   CoreFoundation                	0x00000001a8b68928 -[NSArray sortedArrayFromRange:options:usingComparator:] + 704 (NSArray.m:632)
4   CoreFoundation                	0x00000001a8b68540 -[NSMutableArray sortedArrayFromRange:options:usingComparator:] + 60 (NSMutableArray.m:602)
5   CoreFoundation                	0x00000001a8b6845c -[NSArray sortedArrayUsingFunction:context:] + 160 (NSArray.m:658)
6   CoreData                      	0x00000001b03c9e7c -[NSEntityDescription _newVersionHashInStyle:] + 272 (NSEntityDescription.m:1324)
7   CoreData                      	0x00000001b03e0128 -[NSEntityDescription _versionHashInStyle:] + 84 (NSEntityDescription.m:2631)
8   CoreData                      	0x00000001b03854dc _computeVersionHashesOnBackgroundThread + 168 (NSManagedObjectModel.m:3121)
9   CoreData                      	0x00000001b0408eb4 minion_duties2 + 76 (_PFRoutines.m:214)
10  libdispatch.dylib             	0x00000001b0160fdc _dispatch_client_callout + 20 (object.m:560)
11  libdispatch.dylib             	0x00000001b01640c8 _dispatch_queue_override_invoke + 788 (inline_internal.h:2632)
12  libdispatch.dylib             	0x00000001b0172a6c _dispatch_root_queue_drain + 396 (inline_internal.h:0)
13  libdispatch.dylib             	0x00000001b0173284 _dispatch_worker_thread2 + 164 (queue.c:7052)
14  libsystem_pthread.dylib       	0x00000001f6bd5dbc _pthread_wqthread + 228 (pthread.c:2631)
15  libsystem_pthread.dylib       	0x00000001f6bd5b98 start_wqthread + 8 (:-1)

Thread 8 name:
Thread 8:
0   libsystem_kernel.dylib        	0x00000001e64b9150 getattrlist + 8 (:-1)
1   libremovefile.dylib           	0x000000021da79940 removefile + 188 (removefile.c:116)
2   Foundation                    	0x00000001a2f3c490 -[NSFilesystemItemRemoveOperation main] + 296 (NSFileOperations.m:849)
3   Foundation                    	0x00000001a2f3c1d0 __NSOPERATION_IS_INVOKING_MAIN__ + 16 (NSOperation.m:2189)
4   Foundation                    	0x00000001a2efd578 -[NSOperation start] + 708 (NSOperation.m:2206)
5   Foundation                    	0x00000001a2eff0e4 -[NSFileManager removeItemAtPath:error:] + 48 (NSFileManager.m:4998)
6   CoreData                      	0x00000001b04693d8 __49-[_PFGarbageManager _doCleanupForDir:exceptURLs:]_block_invoke + 248 (_PFRoutines.m:3787)
7   libdispatch.dylib             	0x00000001b015f4b4 _dispatch_call_block_and_release + 32 (init.c:1518)
8   libdispatch.dylib             	0x00000001b0160fdc _dispatch_client_callout + 20 (object.m:560)
9   libdispatch.dylib             	0x00000001b0172b8c _dispatch_root_queue_drain + 684 (inline_internal.h:2632)
10  libdispatch.dylib             	0x00000001b0173284 _dispatch_worker_thread2 + 164 (queue.c:7052)
11  libsystem_pthread.dylib       	0x00000001f6bd5dbc _pthread_wqthread + 228 (pthread.c:2631)
12  libsystem_pthread.dylib       	0x00000001f6bd5b98 start_wqthread + 8 (:-1)

Thread 9 name:
Thread 9:
0   libsystem_kernel.dylib        	0x00000001e64b937c __psynch_cvwait + 8 (:-1)
1   libsystem_pthread.dylib       	0x00000001f6bdd06c _pthread_cond_wait + 1232 (pthread_cond.c:636)
2   JavaScriptCore                	0x00000001bc2de43c scavenger_thread_main + 1164 (pas_scavenger.c:145)
3   libsystem_pthread.dylib       	0x00000001f6bd66cc _pthread_start + 148 (pthread.c:893)
4   libsystem_pthread.dylib       	0x00000001f6bd5ba4 thread_start + 8 (:-1)


Thread 0 crashed with ARM Thread State (64-bit):
    x0: 0x0000000282b8a6a0   x1: 0x00000001a4276ab8   x2: 0x0000000282b8a6a0   x3: 0x000000016dd93801
    x4: 0x0000000000000001   x5: 0x0000000013e00000   x6: 0x0000000000000041   x7: 0x0000000000000000
    x8: 0x0000000000002089   x9: 0x0000000000000007  x10: 0x6ae1000282b8a6a0  x11: 0x007f0001048f0000
   x12: 0x000000000000003e  x13: 0x00000001048f03d0  x14: 0x00005dda938ea6a0  x15: 0x00005dda938ea6a0
   x16: 0x00005dda938ea6a0  x17: 0x00000002004eeee0  x18: 0x0000000000000000  x19: 0x0000000282b8a6a0
   x20: 0x0000000000000001  x21: 0xbf7eff24e52e58f1  x22: 0x00000001ff08adf0  x23: 0x8000000000000001
   x24: 0xc000000000000007  x25: 0x0000000000000002  x26: 0x0000000282b8a6a0  x27: 0x00000002804ff7f0
   x28: 0xbf7eff24e52e58f1   fp: 0x000000016dd93890   lr: 0x00000001a8b4d918
    sp: 0x000000016dd93820   pc: 0x00000001a1e01c20 cpsr: 0x20001000
   esr: 0x92000004 (Data Abort) byte read Translation fault


Binary Images:
0x102068000 - 0x102303fff iPhemeris arm64  <3dd90416ef51369dbb64a1002b4d6008> /private/var/containers/Bundle/Application/4AD53A22-66DA-4817-AB75-58AB2D1D6323/iPhemeris.app/iPhemeris
0x1a1e00000 - 0x1a1e43e1f libobjc.A.dylib arm64e   /usr/lib/libobjc.A.dylib
0x1a2ec1000 - 0x1a380afff Foundation arm64e  <07a92f05d8ec327eab3341db9f77ba16> /System/Library/Frameworks/Foundation.framework/Foundation
0x1a8b44000 - 0x1a8f29fff CoreFoundation arm64e  <725e49f4653b39bf9a7a8a3250911ecb> /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
0x1aad19000 - 0x1ac504fff UIKitCore arm64e  <59cbc9b530ae396ea269a986640001bc> /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore
0x1b015d000 - 0x1b01a3fff libdispatch.dylib arm64e  <24db930d870b31ceac69534d7896b4a8> /usr/lib/system/libdispatch.dylib
0x1b0364000 - 0x1b06c2fff CoreData arm64e   /System/Library/Frameworks/CoreData.framework/CoreData
0x1b2187000 - 0x1b2342fff AccessibilityUtilities arm64e   /System/Library/PrivateFrameworks/AccessibilityUtilities.framework/AccessibilityUtilities
0x1b3d1e000 - 0x1b3d40fff AXCoreUtilities arm64e  <44bf5b5d880d35fcb8986f444a801172> /System/Library/PrivateFrameworks/AXCoreUtilities.framework/AXCoreUtilities
0x1bc1e8000 - 0x1bd6a3fff JavaScriptCore arm64e  <8c4289de9d14382386c8c749af87c8da> /System/Library/Frameworks/JavaScriptCore.framework/JavaScriptCore
0x1be872000 - 0x1be918fff FrontBoardServices arm64e  <2cec922bdd383ca7b826f3de9118f37a> /System/Library/PrivateFrameworks/FrontBoardServices.framework/FrontBoardServices
0x1c73d1000 - 0x1c745408f dyld arm64e  <7b63c57361613b33a3a29944ba59722f> /usr/lib/dyld
0x1e2c1a000 - 0x1e2c22fff GraphicsServices arm64e  <5adda888f38735f787a7e01fcb9bb928> /System/Library/PrivateFrameworks/GraphicsServices.framework/GraphicsServices
0x1e64b4000 - 0x1e64eefe3 libsystem_kernel.dylib arm64e  <9daa5c2993e03768a3e1e139995dc4af> /usr/lib/system/libsystem_kernel.dylib
0x1f6bd5000 - 0x1f6be0fff libsystem_pthread.dylib arm64e   /usr/lib/system/libsystem_pthread.dylib
0x1f6c19000 - 0x1f6c59fff libxpc.dylib arm64e  <9826b3aa0ca03ca4b664d86869fb33f2> /usr/lib/system/libxpc.dylib
0x21da78000 - 0x21da7afff libremovefile.dylib arm64e  <3a478fa2cbb832059692cda5ea3db0cb> /usr/lib/system/libremovefile.dylib

EOF

Since iOS 16 code that has been working for many years has been randomly crashing on some devices. We have NEVER seen it on any of our devices, but we are getting a lot of complaints and bad reviews from a small percentage of our installed base but which amounts to A LOT of users.

This appears to be an iOS 16 bug that only manifests if users are allowing us to store data in iCloud. below is a typical crash report. Anyone else seeing this and have any ideas on a workaround.

AND APPLE please get on this issue!

Incident Identifier: 1AB6F163-8B35-4D8E-A78A-9514BFD2410B Beta Identifier: 82FFD7BA-5E70-40B9-B45E-B98F320675DF Hardware Model: iPhone14,5 Process: iPhemeris [9907] Path: /private/var/containers/Bundle/Application/5F6EDD27-0AB7-4AFC-B62C-88D29545C12C/iPhemeris.app/iPhemeris Identifier: cribaudo.iphemeris Version: 11.6.1 (146) AppStoreTools: 14E221 AppVariant: 1:iPhone14,5:16 Beta: YES Code Type: ARM-64 (Native) Role: Foreground Parent Process: launchd [1] Coalition: cribaudo.iphemeris [1985]

Date/Time: 2023-03-22 23:17:38.5970 +0800 Launch Time: 2023-03-22 23:17:37.9265 +0800 OS Version: iPhone OS 16.3.1 (20D67) Release Type: User Baseband Version: 2.40.01 Report Version: 104

Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Subtype: KERN_INVALID_ADDRESS at 0x00000e387afc8fa0 -> 0x000000387afc8fa0 (possible pointer authentication failure) Exception Codes: 0x0000000000000001, 0x00000e387afc8fa0 VM Region Info: 0x387afc8fa0 is in 0x1000000000-0x7000000000; bytes after start: 173862064032 bytes before end: 238454796383 REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL commpage (reserved) fc0000000-1000000000 [ 1.0G] ---/--- SM=NUL ...(unallocated) ---> GPU Carveout (reserved) 1000000000-7000000000 [384.0G] ---/--- SM=NUL ...(unallocated) UNUSED SPACE AT END Termination Reason: SIGNAL 11 Segmentation fault: 11 Terminating Process: exc handler [9907]

Triggered by Thread: 0

Kernel Triage: VM - pmap_enter retried due to resource shortage VM - pmap_enter retried due to resource shortage VM - pmap_enter retried due to resource shortage VM - pmap_enter retried due to resource shortage VM - pmap_enter retried due to resource shortage

Thread 0 name: Dispatch queue: com.apple.main-thread Thread 0 Crashed: 0 libobjc.A.dylib 0x1cf9e5c20 objc_msgSend + 32 1 CoreFoundation 0x1d6864908 isEqualToString + 100 2 CoreData 0x1de140760 -[NSFetchedResultsController _computeSectionInfo:error:] + 712 3 CoreData 0x1de0c9c08 __43-[NSFetchedResultsController performFetch:]_block_invoke + 520 4 CoreData 0x1de102df8 developerSubmittedBlockToNSManagedObjectContextPerform + 156 5 CoreData 0x1de102948 -[NSManagedObjectContext performBlockAndWait:] + 208 6 CoreData 0x1de0dfb24 -[NSFetchedResultsController _recursivePerformBlockAndWait:withContext:] + 152 7 CoreData 0x1de0dda10 -[NSFetchedResultsController performFetch:] + 252 8 iPhemeris 0x104f26df8 -[SavedChartViewController initializeFetchedResultsController] + 460 9 iPhemeris 0x104f24560 -[SavedChartViewController viewDidLoad] + 1960 10 UIKitCore 0x1d8db205c -[UIViewController _sendViewDidLoadWithAppearanceProxyObjectTaggingEnabled] + 84 11 UIKitCore 0x1d8a4a35c -[UIViewController loadViewIfRequired] + 712 12 UIKitCore 0x1d8d10d68 -[UINavigationController _updateScrollViewFromViewController:toViewController:] + 124 13 UIKitCore 0x1d8bd7470 -[UINavigationController _startTransition:fromViewController:toViewController:] + 196 14 UIKitCore 0x1d8bd6928 -[UINavigationController _startDeferredTransitionIfNeeded:] + 608 15 UIKitCore 0x1d8bd5f78 -[UINavigationController __viewWillLayoutSubviews] + 96 16 UIKitCore 0x1d8bd5edc -[UILayoutContainerView layoutSubviews] + 172 17 UIKitCore 0x1d8a344c8 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1980 18 QuartzCore 0x1d7f077fc CA::Layer::layout_if_needed(CA::Transaction*) + 500 19 QuartzCore 0x1d7f1aeb0 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 148 20 QuartzCore 0x1d7f2c234 CA::Context::commit_transaction(CA::Transaction*, double, double*) + 444 21 QuartzCore 0x1d7f61630 CA::Transaction::commit() + 652 22 UIKitCore 0x1d8ec32b0 __34-[UIApplication _firstCommitBlock]_block_invoke_2 + 36 23 CoreFoundation 0x1d689e514 CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK + 28 24 CoreFoundation 0x1d6906d6c __CFRunLoopDoBlocks + 368 25 CoreFoundation 0x1d68d6b90 __CFRunLoopRun + 856 26 CoreFoundation 0x1d68dbeb0 CFRunLoopRunSpecific + 612 27 GraphicsServices 0x210ad1368 GSEventRunModal + 164 28 UIKitCore 0x1d8dd1668 -[UIApplication _run] + 888 29 UIKitCore 0x1d8dd12cc UIApplicationMain + 340 30 iPhemeris 0x104f18d1c main + 72 31 dyld 0x1f51d4960 start + 2528

From the crash report you provided, the crash seems to be related to the Core Data framework, specifically when fetching data using NSFetchedResultsController. Since you mentioned that it only happens for users who have iCloud enabled, it might be related to how the data is synchronized between the local store and iCloud.

Here are a few suggestions to help you investigate and potentially fix the issue:

Make sure your Core Data stack is set up correctly to handle iCloud integration. Review your NSPersistentStoreCoordinator setup to ensure it has the necessary iCloud options.

Check if there are any issues with the data model, such as missing or incorrect relationships, which might be causing issues when fetching data from the store.

If possible, attempt to reproduce the issue using a device or simulator running iOS 16 and iCloud enabled. This will allow you to debug the issue in a more controlled environment.

Since the crash happens during the execution of NSFetchedResultsController, you may want to try different ways of fetching data, such as using NSFetchRequest directly, to see if it resolves the issue.

Make sure your app is not holding on to any stale NSManagedObject instances that may have been deleted or changed in the background. This can cause unexpected behavior when fetching data.

Keep an eye on the Apple Developer Forums and related resources for any reports of similar issues or workarounds that may be available.

Lastly, if you have identified this as an iOS 16 bug, you should file a bug report with Apple using their Feedback Assistant tool, providing as much information as possible to help them investigate and resolve the issue.

@iAmBowser - We have never seen the crash on any of our devices or connected to Xcode. Only via reports and now users on TestFlight.

  1. Yes it is in CoreData framework, we think it is a framework/Cloudkit issue and have filed a bug report. What the original question states is we are hoping to find a work around.

  2. The issue only occurs with CloudKit enabled which CANNOT be run on simulators.

  3. We doubt it is a database issue as this particular model has been working on many user devices and there are NO relationships, simply Entities.

  4. We have tried 7 builds at this point via TestFlight attempting to use alternate approaches or more delayed approaches to initialize CoreData/Cloudkit. All the devices continue to crash in the same way and nothing we have tried prevents it accept the user turns off using iCloud.

  5. We have tried to use Crashlytics to get log statements as to where it is crashing during start, but it seems to crash too quickly to even get those.

We are stuck

More information. We have managed to get Crashlytics logging to work and these are being sent with FireBase CrashReports. Thus far:

  1. Crashing devices are NOT in low power mode.
  2. Crashing devices are NOT getting any low memory notices.
  3. Crashing devices ARE actually completing the CoreData / Cloudkit setup successfully as far as we can tell and notify the UITableView using CoreData to initialize the FetchResultController. At that point or after the UITableView viewDidLoad we attempt to make a FetchRequest.

It is at this point that some devices (only a small percentage) crash deep in CoreData framework with _computSectionInfo error, like so:

1 CoreFoundation 0x9908 isEqualToString + 100
2 CoreData 0xc0760 -[NSFetchedResultsController _computeSectionInfo:error:] + 712
3 CoreData 0x49c08 __43-[NSFetchedResultsController performFetch:]_block_invoke + 520
4 CoreData 0x82df8 developerSubmittedBlockToNSManagedObjectContextPerform + 156
5 CoreData 0x82948 -[NSManagedObjectContext performBlockAndWait:] + 208
6 CoreData 0x5fb24 -[NSFetchedResultsController _recursivePerformBlockAndWait:withContext:] + 152
7 CoreData 0x5da10 -[NSFetchedResultsController performFetch:] + 252
8 iPhemeris 0x1cf1c -[SavedChartViewController viewDidLoad] + 120 (SavedChartViewController.m:120)

We now understand this issue much better. Working with Testers on devices using Japanese and Foreign languages and making some small changes to better handle Unicode we can reproduce the issue, but do not understand how to fix. We noticed the mismatch between the first character index on this screen shot attached and realized that our code to return the first character was not handling Unicode properly.

We therefore modified the code that returns the first Character of the Name Field and which produces the index of first letters running down the right side to be like so. This code is a method on our NSManagedObject that is the object used as the Entity in the DB for fetching. It has some debug Log statements.

This code crashes if we use the localizedUppercaseString and does not if we remove that?

&#x2F;&#x2F; Used by NSFetchedResultController Table of Charts by first letter
-(NSString *)nameFirstLetter
{
if(self.name != nil) {
&#x2F;&#x2F;return [[self.name substringToIndex:1] localizedUppercaseString];
NSString *str = [self.name substringWithRange:[self.name rangeOfComposedCharacterSequenceAtIndex:0]];
NSLog(@"**** Name:[%@] 1st[%@] Upper[%@]", self.name, str, [str localizedUppercaseString]);
return [str localizedUppercaseString]; &#x2F;&#x2F;[[self.name substringWithRange:[self.name rangeOfComposedCharacterSequenceAtIndex:0]] localizedUppercaseString];
}
else
return @"?";
}

It is crashing with a FetchRequest that is initialized using this code below. There is some issue created by doing the localizedUpperCase and the _sectionNameKeyPath that uses that returned value in the FetchRequest

    _fetchedResultsController = [[NSFetchedResultsController alloc] initWithFetchRequest:fetchRequest managedObjectContext:moc sectionNameKeyPath:_sectionNameKeyPath cacheName:nil];
-(void)initializeFetchedResultsController
{
&#x2F;&#x2F; Already inititialized
if(_fetchedResultsController != nil) return;
&#x2F;&#x2F; Create and configure a fetch request for Charts
NSManagedObjectContext *moc = ((iPhemerisAppDelegate *)[[UIApplication sharedApplication] delegate]).coreDataUtil.pc.viewContext;
if(!moc) {
NSLog(@"*** SavedChartView MOC NOT READY");
return;
}
NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init];
NSEntityDescription *entity = [NSEntityDescription entityForName:@"Charts" inManagedObjectContext:moc];
[fetchRequest setEntity:entity];
&#x2F;&#x2F; Create the sort descriptors array
NSSortDescriptor *nameDescriptor = [[NSSortDescriptor alloc] initWithKey:@"name" ascending:YES selector:@selector(localizedCaseInsensitiveCompare:)];
NSSortDescriptor *chartTypeDescriptor = [[NSSortDescriptor alloc] initWithKey:@"chartType" ascending:YES selector:@selector(localizedCaseInsensitiveCompare:)];
NSArray *sortDescriptors = [[NSArray alloc] initWithObjects:nameDescriptor, chartTypeDescriptor, nil];
[fetchRequest setSortDescriptors:sortDescriptors];
&#x2F;&#x2F; Create and initialize the fetch results controller.
_sectionNameKeyPath = @"nameFirstLetter";
_fetchedResultsController = [[NSFetchedResultsController alloc] initWithFetchRequest:fetchRequest managedObjectContext:moc sectionNameKeyPath:_sectionNameKeyPath cacheName:nil];
_fetchedResultsController.delegate = self;
}

Based on the additional information provided, it appears that the crashing issue is related to the localizedUppercaseString method used in the nameFirstLetter method of the NSManagedObject subclass. This subclass is used as the sectionNameKeyPath in the NSFetchedResultsController, which is causing some devices running iOS 16 to crash.

To work around this issue, you can try using a different method to convert the first character of the name string to uppercase. Instead of using localizedUppercaseString, you can use uppercaseStringWithLocale: method.

Here's an example of how you could modify the nameFirstLetter method to use uppercaseStringWithLocale::

-(NSString *)nameFirstLetter
{
if(self.name != nil) {
NSString *firstChar = [self.name substringToIndex:1];
NSString *upperCaseFirstChar = [firstChar uppercaseStringWithLocale:[NSLocale currentLocale]];
NSLog(@"**** Name:[%@] 1st[%@] Upper[%@]", self.name, firstChar, upperCaseFirstChar);
return upperCaseFirstChar;
}
else {
return @"?";
}
}

Here are a few more things you can try to further investigate and potentially fix the crashing issue:

Consider using a different sectionNameKeyPath in the NSFetchedResultsController. If the issue is related to the localizedUppercaseString method used in the nameFirstLetter method, you may be able to work around the issue by using a different key path that doesn't rely on this method. For example, you could use a boolean flag to indicate whether the name starts with a letter or a number, and use that flag as the sectionNameKeyPath.

If none of the above steps resolve the issue, you may need to modify your data model to remove the use of localizedUppercaseString in the NSManagedObject subclass. This may require significant changes to your codebase, so it should only be considered as a last resort.

In the meantime, you may want to consider reaching out to affected users and informing them of the issue and potential workarounds. You could also consider disabling iCloud storage in your app until a fix is found, if that's an option.

iCloud/CoreData Crashing [NSFetchResultsController _computeSectionInfo:error]
 
 
Q