CoreData Crash While fetching Error: NSProcessingInternalChange - ios

In my application I am saving data to coredata in the main thread\queue and immediately after save, I fetch all the records to make sure I have not exceeded the size of my local store.
All happens on synchronously on the main thread.
I get random crashes:
[NSManagedObjectContext(_NSInternalChangeProcessing) _processRecentChanges:] + 2284
The core data has attributes indexed and I am wondering if the index generation happens after save returns and fetch catches the database during indexing and fails?
Also I see another thread NSPersistentStoreCoordinator.
What does this mean? I specifically send the coredata operations to be executed in main thread. Does coredata internally send it to another thread?
What could be causing the crash here? Would appreciate any help!
The stack trace looks like this:
Thread : Crashed: com.apple.main-thread
0 CoreFoundation 0x000000018214602c __CFBasicHashDrain + 196
1 CoreFoundation 0x0000000182145f9c __CFBasicHashDrain + 52
2 CoreData 0x0000000181de28c8 -[NSManagedObjectContext(_NSInternalChangeProcessing) _processRecentChanges:] + 2284
3 CoreData 0x0000000181ddadc4 _performRunLoopAction + 384
4 CoreFoundation 0x00000001820cc2a4 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32
5 CoreFoundation 0x00000001820c9230 __CFRunLoopDoObservers + 360
6 CoreFoundation 0x00000001820c9610 __CFRunLoopRun + 836
7 CoreFoundation 0x0000000181ff52d4 CFRunLoopRunSpecific + 396
8 GraphicsServices 0x000000018b80b6fc GSEventRunModal + 168
9 UIKit 0x0000000186bbafac UIApplicationMain + 1488
10 MyApp 0x000000010002ba88 main (main.m:16)
11 libdyld.dylib 0x0000000193fb6a08 start + 4
Thread : NSPersistentStoreCoordinator 0x170666900
0 libsystem_platform.dylib 0x00000001941616a4 OSAtomicCompareAndSwap64Barrier + 12
1 libsystem_pthread.dylib 0x0000000194169428 _pthread_mutex_lock + 312
2 libsqlite3.dylib 0x0000000193c89d0c (null) + 20676
3 libsqlite3.dylib 0x0000000193cb30ec (null) + 20388
4 libsqlite3.dylib 0x0000000193cb27ac (null) + 18020
5 libsqlite3.dylib 0x0000000193cb255c (null) + 17428
6 libsqlite3.dylib 0x0000000193c85688 (null) + 2624
7 libsqlite3.dylib 0x0000000193caccf0 (null) + 56216
8 libsqlite3.dylib 0x0000000193c9f368 sqlite3_step + 528
9 CoreData 0x0000000181db47e8 _execute + 124
10 CoreData 0x0000000181dc5574 -[NSSQLiteConnection fetchResultSet:usingFetchPlan:] + 1664
11 CoreData 0x0000000181ec48f4 newFetchedRowsForFetchPlan_MT + 1544
12 CoreData 0x0000000181dcf4bc -[NSSQLCore fetchRowForObjectID:] + 1080
13 CoreData 0x0000000181dcedc0 -[NSSQLCore newValuesForObjectWithID:withContext:error:] + 280
14 CoreData 0x0000000181e89524 __95-[NSPersistentStoreCoordinator(_NSInternalMethods) newValuesForObjectWithID:withContext:error:]_block_invoke + 76
15 CoreData 0x0000000181e90028 gutsOfBlockToNSPersistentStoreCoordinatorPerform + 184
16 libdispatch.dylib 0x0000000193f89954 _dispatch_client_callout + 16
17 libdispatch.dylib 0x0000000193f931e4 _dispatch_barrier_sync_f_invoke + 76
18 CoreData 0x0000000181e81e98 _perform + 180
19 CoreData 0x0000000181dcebf0 -[NSPersistentStoreCoordinator(_NSInternalMethods) newValuesForObjectWithID:withContext:error:] + 160
20 CoreData 0x0000000181dce210 _PFFaultHandlerLookupRow + 352
21 CoreData 0x0000000181dcdc84 _PF_FulfillDeferredFault + 252
22 CoreData 0x0000000181dcda70 _sharedIMPL_pvfk_core + 116
23 CoreData 0x0000000181dde638 _PF_Handler_Public_GetProperty + 176
24 Foundation 0x0000000182f2c7c4 _sortedObjectsUsingDescriptors + 384
25 Foundation 0x0000000182f6a94c -[NSArray(NSKeyValueSorting) sortedArrayUsingDescriptors:] + 608
26 CoreData 0x0000000181dba32c -[NSManagedObjectContext executeFetchRequest:error:] + 3796
27 MyApp 0x00000001001b2b2c static MyApp.CacheHelper.fetchCacheEntriesInAscendingOrderByAccess (MyApp.CacheHelper.Type)(Swift.String) -> Swift.Optional<Swift.Array<Swift.AnyObject>> (CacheHelper.swift:155)
28 MyApp 0x0000000100145ee8 function signature specialization <Arg[0] = Owned To Guaranteed> of MyApp.Base.controlCapacity (MyApp.Base)() -> () (Base.swift:45)
29 MyApp 0x00000001001450a0 MyApp.Base.controlCapacity (MyApp.Base)() -> () (Base.swift)
30 MyApp 0x0000000100145c74 MyApp.Base.setCacheEntryInternal (MyApp.Base)(MyApp.CacheEntry) -> () (Base.swift:120)
31 libdispatch.dylib 0x0000000193f89994 _dispatch_call_block_and_release + 24
32 libdispatch.dylib 0x0000000193f89954 _dispatch_client_callout + 16
33 libdispatch.dylib 0x0000000193f940a4 _dispatch_queue_drain + 1448
34 libdispatch.dylib 0x0000000193f8ca5c _dispatch_queue_invoke + 132
35 libdispatch.dylib 0x0000000193f96318 _dispatch_root_queue_drain + 720
36 libdispatch.dylib 0x0000000193f97c4c _dispatch_worker_thread3 + 108
37 libsystem_pthread.dylib 0x000000019416922c _pthread_wqthread + 816`

Related

CoreData _NSIsNSSet EXC_BAD_ACCESS KERN_INVALID_ADDRESS - crash on app launch

We are getting this crash on multiple devices but cannot figure out where it originates from. The main thread is crashing.
Stack trace:
Crashed: com.apple.main-thread
0 libobjc.A.dylib 0x193dfd58c object_getMethodImplementation + 20
1 CoreFoundation 0x1940f6928 _NSIsNSSet + 40
2 CoreFoundation 0x193fc2c04 -[NSMutableSet unionSet:] + 112
3 CoreData 0x198abe014 -[_NSFaultingMutableSet willReadWithContents:] + 668
4 CoreData 0x198ae4280 -[_NSFaultingMutableSet count] + 32
5 CoreData 0x198be1bb4 __107-[NSManagedObjectContext(_NestedContextSupport) newValueForRelationship:forObjectWithID:withContext:error:]_block_invoke + 360
6 CoreData 0x198be2e70 internalBlockToNSManagedObjectContextPerform + 104
7 libdispatch.dylib 0x193d8b5ac _dispatch_client_callout + 20
8 libdispatch.dylib 0x193d9843c _dispatch_async_and_wait_invoke + 96
9 libdispatch.dylib 0x193d8b5ac _dispatch_client_callout + 20
10 libdispatch.dylib 0x193d977d4 _dispatch_main_queue_callback_4CF + 832
11 CoreFoundation 0x1940648d4 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16
12 CoreFoundation 0x19405f58c __CFRunLoopRun + 1692
13 CoreFoundation 0x19405ebc8 CFRunLoopRunSpecific + 480
14 GraphicsServices 0x19e4475cc GSEventRunModal + 164
15 UIKitCore 0x198211744 UIApplicationMain + 1936
16 My App 0x100b37324 main + 16 (main.m:16)
17 libdyld.dylib 0x193edb384 start + 4
At the same time, a background thread operating in a PrivateQueue ManagedObjectContext is busy accessing a ManagedObject via awakeFromFetch, stack trace of this thread:
NSManagedObjectContext 0x28066c700
0 libsystem_kernel.dylib 0x1b09617e4 __ulock_wait + 8
1 libdispatch.dylib 0x1b081bf48 _dlock_wait + 56
2 libdispatch.dylib 0x1b081bcf4 _dispatch_thread_event_wait_slow + 56
3 libdispatch.dylib 0x1b0828618 __DISPATCH_WAIT_FOR_QUEUE__ + 336
4 libdispatch.dylib 0x1b0828204 _dispatch_sync_f_slow + 144
5 CoreData 0x1b56686cc _perform + 200
6 CoreData 0x1b558e2c4 -[NSManagedObjectContext(_NestedContextSupport) newValueForRelationship:forObjectWithID:withContext:error:] + 156
7 CoreData 0x1b555033c -[NSFaultHandler retainedFulfillAggregateFaultForObject:andRelationship:withContext:] + 428
8 CoreData 0x1b554df10 -[_NSFaultingMutableSet willReadWithContents:] + 408
9 CoreData 0x1b55ea5bc -[_NSFaultingMutableSet allObjects] + 32
10 My App 0x1044fdc3c PSUser.isAdmin.getter + 286 (PSUser.swift:286)
11 My App 0x1044fdb04 #objc PSUser.isAdmin.getter + 4309900036 (<compiler-generated>:4309900036)
12 My App 0x1044fc694 PSUser.initCurrentTeam() + 212 (PSUser.swift:212)
13 My App 0x1044fcbc0 #objc PSUser.initCurrentTeam() + 4309896128 (<compiler-generated>:4309896128)
14 My App 0x1044fc658 #objc PSUser.awakeFromFetch() + 4309894744 (<compiler-generated>:4309894744)
15 CoreData 0x1b56520e4 _PFFaultHandlerFulfillFault + 3168
16 CoreData 0x1b5650ab0 _PFFaultHandlerLookupRow + 908
17 CoreData 0x1b56527fc _PF_FulfillDeferredFault + 260
18 CoreData 0x1b5666a2c _pvfk_header + 120
19 CoreData 0x1b5663218 _sharedIMPL_pvfk_core + 32
20 My App 0x10438918c +[PSAppSettings isAutoPilotAllowed:] + 97 (PSAppSettings.m:97)
21 My App 0x1043fbb9c LocationTracker.updateTrackingState(user:) + 1120 (LocationTracker.swift:1120)
22 My App 0x104413b4c partial apply for closure #1 in LocationTracker.store(filteredLocations:) + 1275 (LocationTracker.swift:1275)
23 My App 0x1043bae3c thunk for #escaping #callee_guaranteed () -> () + 4308577852 (<compiler-generated>:4308577852)
24 CoreData 0x1b566b650 developerSubmittedBlockToNSManagedObjectContextPerform + 164
25 libdispatch.dylib 0x1b081b5ac _dispatch_client_callout + 20
26 libdispatch.dylib 0x1b0821a64 _dispatch_lane_serial_drain + 568
27 libdispatch.dylib 0x1b0822498 _dispatch_lane_invoke + 400
28 libdispatch.dylib 0x1b082ba5c _dispatch_workloop_worker_thread + 584
29 libsystem_pthread.dylib 0x1b0881718 _pthread_wqthread + 276
30 libsystem_pthread.dylib 0x1b08879c8 start_wqthread + 8
I am not certain if the two stacks are related, or if the background thread is dispatching anything to the main thread (why should it?), but the call newValueForRelationship:forObjectWithID:withContext:error does appear in both stack traces.
The method for awakeFromFetch is initializing a calculated object property currentTeam via the initCurrentTeam() method. This method accesses the teams relationship on that object. Here is the relevant code:
#objc extension PSUser {
override open func awakeFromFetch() {
super.awakeFromFetch()
initCurrentTeam()
}
/**
This method sets the currentTeam by picking
the appropriate team from the `teams` set.
*/
func initCurrentTeam() {
if (isAdmin || isManager), !isEmployee,
var teams = teams?.allObjects as? [PSTeam],
currentTeam == nil {
...
currentTeam = teams.first
}
}
...
}
Enabled com.apple.CoreData.ConcurrencyDebug in Xcode Scheme but Xcode console does not complain. I have not been able to reproduce this issue while debugging in Xcode. The issue is only reported via Crashlytics in production environment.
Any ideas what might be causing this?

iOS: This NSPersistentStoreCoordinator has no persistent stores => How to check if the sqlite database in the app correspond to the model?

I would like to check if an old sqlite is present in the app and doesn't match to the new model. For example if I added some tables in the coredata model, I would like to avoid a crash if the app sqlite database doesn't match.
The goal is to delete the data base, and let coredata create another database with the good model.
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'This NSPersistentStoreCoordinator has no persistent stores (schema mismatch or migration failure). It cannot perform a save operation.'
*** First throw call stack:
(
0 CoreFoundation 0x000000010daed1e6 __exceptionPreprocess + 294
1 libobjc.A.dylib 0x000000010c6c1031 objc_exception_throw + 48
2 CoreData 0x000000010d5cc6c3 -[NSPersistentStoreCoordinator _coordinator_you_never_successfully_opened_the_database_schema_mismatch:] + 51
3 CoreData 0x000000010d5ccd55 -[NSPersistentStoreCoordinator _introspectLastErrorAndThrow] + 165
4 CoreData 0x000000010d5cd101 __65-[NSPersistentStoreCoordinator executeRequest:withContext:error:]_block_invoke + 593
5 CoreData 0x000000010d5c57a8 -[NSPersistentStoreCoordinator _routeHeavyweightBlock:] + 360
6 CoreData 0x000000010d4cbc02 -[NSPersistentStoreCoordinator executeRequest:withContext:error:] + 642
7 CoreData 0x000000010d4cbc2b -[NSPersistentStoreCoordinator executeRequest:withContext:error:] + 683
8 CoreData 0x000000010d4f469b -[NSManagedObjectContext save:] + 1579
9 Formbox_Webbox 0x000000010b853aaf -[DB_ListOfValue_manage removeLinesInTable:] + 1055
10 Formbox_Webbox 0x000000010b850add -[DB_ListOfValue_manage removeAllDB] + 2125
11 Formbox_Webbox 0x000000010b79d99d -[ViewController sync:] + 141
12 Formbox_Webbox 0x000000010b7a0080 __35-[ViewController checkFirstSynchro]_block_invoke + 128
13 Formbox_Webbox 0x000000010b83da0a __63+[Reachability checkInternetConnectivityWithSuccessCompletion:]_block_invoke + 346
14 CFNetwork 0x0000000113178f4f __67+[NSURLConnection sendAsynchronousRequest:queue:completionHandler:]_block_invoke_2 + 161
15 Foundation 0x000000010c0d7363 __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ + 7
16 Foundation 0x000000010c0d71ca -[NSBlockOperation main] + 68
17 Foundation 0x000000010c0d56b2 -[__NSOperationInternal _start:] + 766
18 libdispatch.dylib 0x00000001128dc7ec _dispatch_client_callout + 8
19 libdispatch.dylib 0x00000001128e1db8 _dispatch_block_invoke_direct + 592
20 libdispatch.dylib 0x00000001128dc7ec _dispatch_client_callout + 8
21 libdispatch.dylib 0x00000001128e1db8 _dispatch_block_invoke_direct + 592
22 libdispatch.dylib 0x00000001128e1b48 dispatch_block_perform + 109
23 Foundation 0x000000010c0d175b __NSOQSchedule_f + 337
24 libdispatch.dylib 0x00000001128dc7ec _dispatch_client_callout + 8
25 libdispatch.dylib 0x00000001128e2ad9 _dispatch_continuation_pop + 967
26 libdispatch.dylib 0x00000001128e0f54 _dispatch_async_redirect_invoke + 780
27 libdispatch.dylib 0x00000001128e836c _dispatch_root_queue_drain + 664
28 libdispatch.dylib 0x00000001128e8076 _dispatch_worker_thread3 + 132
29 libsystem_pthread.dylib 0x0000000112dc4169 _pthread_wqthread + 1387
30 libsystem_pthread.dylib 0x0000000112dc3be9 start_wqthread + 13
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Thanks in advance.

NSInvalidArgumentException: -[MKMapItem encodeWithCoder:]: unrecognized selector sent to instance 0x17034bfd0

I got a crash report, which is about unrecognized selector sent to instance when saving MKMapItem into Data Store. According to MKMapItem documents(MKMapItem Document), it conforms to NSSecureCoding, which means that it should have no problem to save it into an NSManagedObject instance. it looks fine on ios 11 version, as i didn't receive crash report from the device with this version. Also, I walkthrough the feature that possibly saving MKMapItem on my phone. the context does save the NKMapItem into data store and the feature is working. Since my phone is running IOS 11, so I am thinking it could be about the version system??
Please correct me if misunderstand something.
Here is the crash report.
OS Version: iPhone OS 10.3.3 (14G60)
Report Version: 104
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Triggered by Thread: 0
Last Exception Backtrace:
0 CoreFoundation 0x181646fe0 __exceptionPreprocess + 124 (NSException.m:165)
1 libobjc.A.dylib 0x1800a8538 objc_exception_throw + 56 (objc-exception.mm:521)
2 CoreFoundation 0x18164def4 -[NSObject(NSObject) doesNotRecognizeSelector:] + 140 (NSObject.m:328)
3 CoreFoundation 0x18164af54 ___forwarding___ + 916 (NSForwarding.m:3126)
4 CoreFoundation 0x181546d4c _CF_forwarding_prep_0 + 92
5 Foundation 0x18209afd4 _encodeObject + 1176 (NSKeyedArchiver.m:873)
6 Foundation 0x1820a1e9c +[NSKeyedArchiver archivedDataWithRootObject:] + 168 (NSKeyedArchiver.m:421)
7 CoreData 0x18391ae28 -[NSSQLiteConnection execute] + 1952 (NSSQLiteConnection.m:4165)
8 CoreData 0x1839520e4 -[NSSQLiteConnection insertRow:] + 456 (NSSQLiteConnection.m:2966)
9 CoreData 0x183ae3df8 _writeChangesForSaveRequest + 824 (NSSQLCore_Functions.m:1561)
10 CoreData 0x183ae5584 _executeSaveChangesRequest + 388 (NSSQLCore_Functions.m:1622)
11 CoreData 0x183adb5f0 -[NSSQLSaveChangesRequestContext executeRequestUsingConnection:] + 44 (NSSQLSaveChangesRequestContext.m:103)
12 CoreData 0x1839f30c4 __52-[NSSQLDefaultConnectionManager handleStoreRequest:]_block_invoke + 256 (NSSQLConnectionManager.m:305)
13 libdispatch.dylib 0x1804fe9a0 _dispatch_client_callout + 16 (object.m:473)
14 libdispatch.dylib 0x18050bee0 _dispatch_barrier_sync_f_invoke + 84 (queue.c:3446)
15 CoreData 0x1839f2f64 -[NSSQLDefaultConnectionManager handleStoreRequest:] + 208 (NSSQLConnectionManager.m:290)
16 CoreData 0x183ab5824 -[NSSQLCoreDispatchManager routeStoreRequest:] + 272 (NSSQLCoreDispatchManager.m:56)
17 CoreData 0x183a2075c -[NSSQLCore dispatchRequest:withRetries:] + 236 (NSSQLCore.m:2726)
18 CoreData 0x183a1c578 -[NSSQLCore processSaveChanges:forContext:] + 200 (NSSQLCore.m:1569)
19 CoreData 0x183920f10 -[NSSQLCore executeRequest:withContext:error:] + 724 (NSSQLCore.m:1923)
20 CoreData 0x1839ff84c __65-[NSPersistentStoreCoordinator executeRequest:withContext:error:]_block_invoke + 3492 (NSPersistentStoreCoordinator.m:2820)
21 CoreData 0x1839f80f0 -[NSPersistentStoreCoordinator _routeHeavyweightBlock:] + 276 (NSPersistentStoreCoordinator.m:586)
22 CoreData 0x183920adc -[NSPersistentStoreCoordinator executeRequest:withContext:error:] + 408 (NSPersistentStoreCoordinator.m:2706)
23 CoreData 0x18394197c -[NSManagedObjectContext save:] + 2548 (NSManagedObjectContext.m:1419)
24 myappName 0x10009421c coreDataManager.saveContext() + 92 (coreDataManager.swift:514)
25 myappName 0x1000b5970 closure #1 in eventUpdateManager.observeValue(forKeyPath:of:change:context:) + 64 (eventUpdateManager.swift:138)
26 myappName 0x100124924 thunk for #escaping #callee_guaranteed () -> () + 36 (customAnimationController.swift:0)
27 libdispatch.dylib 0x1804fe9e0 _dispatch_call_block_and_release + 24 (init.c:963)
28 libdispatch.dylib 0x1804fe9a0 _dispatch_client_callout + 16 (object.m:473)
29 libdispatch.dylib 0x1805035e8 _dispatch_main_queue_callback_4CF + 996 (inline_internal.h:2431)
30 CoreFoundation 0x1815f50c8 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12 (CFRunLoop.c:1793)
31 CoreFoundation 0x1815f2ce4 __CFRunLoopRun + 1572 (CFRunLoop.c:3004)
32 CoreFoundation 0x181522da4 CFRunLoopRunSpecific + 424 (CFRunLoop.c:3113)
33 GraphicsServices 0x182f8d074 GSEventRunModal + 100 (GSEvent.c:2245)
34 UIKit 0x1877ddc9c UIApplicationMain + 208 (UIApplication.m:4089)
35 myappName 0x10005da1c main + 56 (receiptCollectionViewCell.swift:18)
36 libdyld.dylib 0x18053159c start + 4
Thread 0 name:
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x0000000180641014 __pthread_kill + 8
1 libsystem_pthread.dylib 0x000000018070b264 pthread_kill + 112 (pthread.c:1366)
2 libsystem_c.dylib 0x00000001805b59c4 abort + 140 (abort.c:91)
3 myappName 0x0000000100170ac8 uncaught_exception_handler + 72
4 CoreFoundation 0x0000000181647354 __handleUncaughtException + 628 (NSException.m:218)
5 libobjc.A.dylib 0x00000001800a8814 _objc_terminate() + 112 (objc-exception.mm:656)
6 myappName 0x0000000100155408 MSCrashesUncaughtCXXTerminateHandler() + 732 (MSCrashesCXXExceptionHandler.mm:171)
7 libc++abi.dylib 0x00000001800975d4 std::__terminate(void (*)()) + 16 (cxa_handlers.cpp:68)
8 libc++abi.dylib 0x00000001800971a8 __cxa_rethrow + 144 (cxa_exception.cpp:584)
9 libobjc.A.dylib 0x00000001800a86f8 objc_exception_rethrow + 44 (objc-exception.mm:559)
10 CoreData 0x0000000183941cb0 -[NSManagedObjectContext save:] + 3368 (NSManagedObjectContext.m:1548)
11 myappName 0x000000010009421c coreDataManager.saveContext() + 92 (coreDataManager.swift:514)
12 myappName 0x00000001000b5970 closure #1 in eventUpdateManager.observeValue(forKeyPath:of:change:context:) + 64 (eventUpdateManager.swift:138)
13 myappName 0x0000000100124924 thunk for #escaping #callee_guaranteed () -> () + 36 (customAnimationController.swift:0)
14 libdispatch.dylib 0x00000001804fe9e0 _dispatch_call_block_and_release + 24 (init.c:963)
15 libdispatch.dylib 0x00000001804fe9a0 _dispatch_client_callout + 16 (object.m:473)
16 libdispatch.dylib 0x00000001805035e8 _dispatch_main_queue_callback_4CF + 996 (inline_internal.h:2431)
17 CoreFoundation 0x00000001815f50c8 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12 (CFRunLoop.c:1793)
18 CoreFoundation 0x00000001815f2ce4 __CFRunLoopRun + 1572 (CFRunLoop.c:3004)
19 CoreFoundation 0x0000000181522da4 CFRunLoopRunSpecific + 424 (CFRunLoop.c:3113)
20 GraphicsServices 0x0000000182f8d074 GSEventRunModal + 100 (GSEvent.c:2245)
21 UIKit 0x00000001877ddc9c UIApplicationMain + 208 (UIApplication.m:4089)
22 myappName 0x000000010005da1c main + 56 (receiptCollectionViewCell.swift:18)
23 libdyld.dylib 0x000000018053159c start + 4

Core Data table view exception crash

this is a stack trace from Flurry crash analytics. Any Idea what is going wrong in my Core Data table view implementation?
Full Stack Trace:
0 CoreFoundation 0x182d5c2d8 <redacted> + 132
1 libobjc.A.dylib 0x194a280e4 _objc_exception_throw + 60
2 CoreFoundation 0x182d5c218 -[NSException initWithCoder:] + 0
3 CoreData 0x182a1fbc8 -[_PFBatchFaultingArray objectAtIndex:] + 204
4 Appname 0x1000615e0 -[MasterViewController configureCell:atIndexPath:] + 124
5 Appname 0x1000613b8 -[MasterViewController controller:didChangeObject:atIndexPath:forChangeType:newIndexPath:] + 580
6 CoreData 0x182b22d60 <redacted> + 4124
7 CoreData 0x182aa1218 <redacted> + 200
8 CoreData 0x182aa10e4 -[NSManagedObjectContext performBlockAndWait:] + 256
9 CoreData 0x182a2c650 -[NSFetchedResultsController _managedObjectContextDidChange:] + 124
10 CoreFoundation 0x182d022c4 <redacted> + 20
11 CoreFoundation 0x182c3f450 __CFXNotificationPost + 2060
12 Foundation 0x183b6ea80 -[NSNotificationCenter postNotificationName:object:userInfo:] + 72
13 CoreData 0x182a2c5ac -[NSManagedObjectContext _postObjectsDidChangeNotificationWithUserInfo:] + 88
14 CoreData 0x182a2c52c -[NSManagedObjectContext _createAndPostChangeNotification:withDeletions:withUpdates:withRefreshes:] + 364
15 CoreData 0x182a2a9d4 -[NSManagedObjectContext _processRecentChanges:] + 2552
16 CoreData 0x182a22dc4 <redacted> + 384
17 CoreFoundation 0x182d142a4 <redacted> + 32
18 CoreFoundation 0x182d11230 <redacted> + 360
19 CoreFoundation 0x182d11610 <redacted> + 836
20 CoreFoundation 0x182c3d2d4 _CFRunLoopRunSpecific + 396
21 GraphicsServices 0x18c6936fc _GSEventRunModal + 168
22 UIKit 0x18783af40 _UIApplicationMain + 1488
23 Appname 0x1000d8d0c -[MainRowType .cxx_destruct] + 180
24 libdyld.dylib 0x1950d2a08 <redacted> + 4
Thanks for help !
you are getting some exception and you are using that exception to init with coder.
The object which contains info is nil and calling init with coder. so it will be good to check nil before proceeding object.
We can't say more without code ;)

Random SIGSEGV NSFetchedResultsController crash

Receiving random crash reports related to NSFetchedResultsController updates to a UITableView, but I'm having a difficult time deciphering the crash log since it's all internal iOS methods.
This occurs at random times after data is fetched from a server in a background queue and the app populates new NSManagedObjects in the background into a Core Data Persistent Store.
Does anyone have an understanding of what may be going on here?
SIGSEGV
0 libobjc.A.dylib 0x3930b752 lookUpImpOrForward + 46
1 libobjc.A.dylib 0x39303feb _class_lookupMethodAndLoadCache3 + 35
2 libobjc.A.dylib 0x39303db9 _objc_msgSend_uncached + 25
3 UIKit 0x317b2bbf __66-[UISectionRowData refreshWithSection:tableView:tableViewRowData:]_block_invoke + 451
4 UIKit 0x31778179 -[UISectionRowData refreshWithSection:tableView:tableViewRowData:] + 3717
5 UIKit 0x3189c95b -[UITableViewRowData ensureAllSectionsAreValid] + 167
6 UIKit 0x31873f29 -[UITableView _endCellAnimationsWithContext:] + 217
7 CoreData 0x2ecae7dd -[NSFetchedResultsController(PrivateMethods) _managedObjectContextDidChange:] + 4013
8 CoreFoundation 0x2eef4121 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 13
9 CoreFoundation 0x2ee68317 _CFXNotificationPost + 1719
10 Foundation 0x2f84cdcd -[NSNotificationCenter postNotificationName:object:userInfo:] + 77
11 CoreData 0x2ecad813 -[NSManagedObjectContext(_NSInternalNotificationHandling) _postObjectsDidChangeNotificationWithUserInfo:] + 79
12 CoreData 0x2ecad7ab -[NSManagedObjectContext(_NSInternalChangeProcessing) _createAndPostChangeNotification:withDeletions:withUpdates:withRefreshes:] + 299
13 CoreData 0x2ecabe13 -[NSManagedObjectContext(_NSInternalChangeProcessing) _processRecentChanges:] + 2367
14 CoreData 0x2ed159e3 -[NSManagedObjectContext(_NestedContextSupport) _parentProcessSaveRequest:inContext:error:] + 1315
15 CoreData 0x2ed1632f __82-[NSManagedObjectContext(_NestedContextSupport) executeRequest:withContext:error:]_block_invoke + 563
16 libdispatch.dylib 0x397f31a7 _dispatch_barrier_sync_f_slow_invoke + 67
17 libdispatch.dylib 0x397ebd67 _dispatch_client_callout + 23
18 libdispatch.dylib 0x397f27c1 _dispatch_main_queue_callback_4CF$VARIANT$mp + 269
19 CoreFoundation 0x2eefc821 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
20 CoreFoundation 0x2eefb0f5 __CFRunLoopRun + 1301
21 CoreFoundation 0x2ee65ce7 CFRunLoopRunSpecific + 523
22 CoreFoundation 0x2ee65acb CFRunLoopRunInMode + 107
23 GraphicsServices 0x33b86283 GSEventRunModal + 139
24 UIKit 0x31707a41 UIApplicationMain + 1137
25 0x000ba53f main (main.m:16)

Resources