0
我有一個罕見的崩潰,發生在覈心數據私人/內部方法隨機。核心數據崩潰mergeChangesFromContextDidSaveNotification
我的設置:
- 2 NSPSC:mainPSC和importPSC附接到importPSC
- MOC在 後臺運行,並執行保存
- 另一個目的監聽 DidSaveNotification然後合併importerMOC與mainMOC (附加到mainPSC)
這是所有在iOS 9.3上。 這是在主線程上運行的代碼(從我的圖書館RTCoreDataStack的):
[self.mainManagedObjectContext performBlock:^{
[self.mainManagedObjectContext mergeChangesFromContextDidSaveNotification:notification];
}];
我得到EXC_BAD_ACCESS各種代碼的崩潰報告(在模擬器EXC_I386_GPFLT或設備SIGSEGV)。這裏有一個例子:
Thread 0 Crashed:
0 libobjc.A.dylib 0x0000000180eedb90 objc_msgSend + 16
1 CoreData 0x0000000183773010 -[NSManagedObjectContext _mergeRefreshObject:mergeChanges:withPersistentSnapshot:] + 132
2 CoreData 0x00000001837745fc -[NSManagedObjectContext _mergeChangesFromDidSaveDictionary:usingObjectIDs:] + 2276
3 CoreData 0x000000018377cd04 __90+[NSManagedObjectContext(_NSCoreDataSPI) _mergeChangesFromRemoteContextSave:intoContexts:]_block_invoke1353 + 68
4 CoreData 0x000000018377508c developerSubmittedBlockToNSManagedObjectContextPerform + 192
5 CoreData 0x0000000183774f54 -[NSManagedObjectContext performBlockAndWait:] + 216
6 CoreData 0x000000018377c698 +[NSManagedObjectContext(_NSCoreDataSPI) _mergeChangesFromRemoteContextSave:intoContexts:] + 3420
7 CoreData 0x0000000183774bb0 -[NSManagedObjectContext mergeChangesFromContextDidSaveNotification:] + 384
8 RTCoreDataStack 0x00000001005e8d34 __43-[RTCoreDataManager handleMOCNotification:]_block_invoke (RTCoreDataManager.m:294)
9 CoreData 0x000000018377508c developerSubmittedBlockToNSManagedObjectContextPerform + 192
10 libdispatch.dylib 0x00000001812c147c _dispatch_client_callout + 12
11 libdispatch.dylib 0x00000001812c6b84 _dispatch_main_queue_callback_4CF + 1840
12 CoreFoundation 0x000000018182cd50 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 8
13 CoreFoundation 0x000000018182abb8 __CFRunLoopRun + 1624
14 CoreFoundation 0x0000000181754c50 CFRunLoopRunSpecific + 380
15 GraphicsServices 0x000000018303c088 GSEventRunModal + 176
16 UIKit 0x0000000186a3e088 UIApplicationMain + 200
17 MyApp 0x0000000100131910 main (main.m:14)
18 ??? 0x00000001812f28b8 0x0 + 0