我得到了这种不一致的信息,很难在RestKit中重现崩溃。崩溃发生在NSManagedObjectContext::save()
内RKManagedObjectRequestOperation::saveContextToPersistentStore:failedContext:error
(here's the exact line of code)。
这次崩溃发生在我们生产环境中的十几个不同用户身上,但我个人无法重现它。我不知道可能导致这次崩溃的原因。我唯一的线索是_forceRegisterLostFault
,这可能表明涉及故障/删除的对象。
背景:每次在网络请求后完成RestKit映射时,都会调用RKManagedObjectRequestOperation::saveContextToPersistentStore:failedContext:error
。
之前有没有人在CoreData中遇到过这个特定的EXC_BREAKPOINT? 关于如何解决这个问题的任何建议?
堆栈追踪:
Crashed: NSManagedObjectContext 0x1741cf5a0
0 CoreData 0x18add7c7c -[NSManagedObjectContext(_NSInternalAdditions) _forceRegisterLostFault:] + 160
1 CoreData 0x18ad5c8b0 -[NSManagedObjectContext(_NSInternalAdditions) _validateObjects:forOperation:error:exhaustive:forSave:] + 2884
2 CoreData 0x18ad5bcf8 -[NSManagedObjectContext(_NSInternalAdditions) _validateChangesForSave:] + 364
3 CoreData 0x18ad5b94c -[NSManagedObjectContext(_NSInternalChangeProcessing) _prepareForPushChanges:] + 196
4 CoreData 0x18ad51ec4 -[NSManagedObjectContext save:] + 544
5 RestKit 0x1013214b8 __84-[RKManagedObjectRequestOperation saveContextToPersistentStore:failedContext:error:]_block_invoke (RKManagedObjectRequestOperation.m:800)
6 CoreData 0x18add5b70 developerSubmittedBlockToNSManagedObjectContextPerform + 152
7 libdispatch.dylib 0x1878e91c0 _dispatch_client_callout + 16
8 libdispatch.dylib 0x1878f6860 _dispatch_barrier_sync_f_invoke + 84
9 CoreData 0x18add5a80 -[NSManagedObjectContext performBlockAndWait:] + 308
10 RestKit 0x1013212b8 -[RKManagedObjectRequestOperation saveContextToPersistentStore:failedContext:error:] (RKManagedObjectRequestOperation.m:808)
11 RestKit 0x1013216d0 -[RKManagedObjectRequestOperation saveContext:error:] (RKManagedObjectRequestOperation.m:831)
12 RestKit 0x101321f54 -[RKManagedObjectRequestOperation saveContext:] (RKManagedObjectRequestOperation.m:874)
13 RestKit 0x10131f654 __79-[RKManagedObjectRequestOperation performMappingOnResponseWithCompletionBlock:]_block_invoke.350 (RKManagedObjectRequestOperation.m:660)
14 RestKit 0x1013534a0 -[RKResponseMapperOperation willFinish] (RKResponseMapperOperation.m:323)
15 RestKit 0x101353ac4 -[RKResponseMapperOperation main] (RKResponseMapperOperation.m:411)
16 Foundation 0x1894578c4 -[__NSOperationInternal _start:] + 620
17 Foundation 0x189524b00 __NSOQSchedule_f + 228
18 libdispatch.dylib 0x1878e91c0 _dispatch_client_callout + 16
19 libdispatch.dylib 0x1878f7444 _dispatch_queue_serial_drain + 928
20 libdispatch.dylib 0x1878ec9a8 _dispatch_queue_invoke + 652
21 libdispatch.dylib 0x1878f938c _dispatch_root_queue_drain + 572
22 libdispatch.dylib 0x1878f90ec _dispatch_worker_thread3 + 124
23 libsystem_pthread.dylib 0x187af22b8 _pthread_wqthread + 1288
24 libsystem_pthread.dylib 0x187af1da4 start_wqthread + 4
答案 0 :(得分:0)
我发现此错误有几个不同的原因。
-com.apple.CoreData.ConcurrencyDebug 1
参数。