project-imas / encrypted-core-data

v2.0 - iOS Core Data encrypted SQLite store using SQLCipher
Other
785 stars 236 forks source link

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Cannot retrieve referenceObject from an objectID that was not created by this store' #309

Open PradeshKumar-emisweb opened 5 years ago

PradeshKumar-emisweb commented 5 years ago

Hi, can any one please help me? how to get out of this issue? I have attached the crash log below,

Date/Time: 2018-09-05T15:56:53Z Launch Time: 2018-09-05T08:47:59Z OS Version: iPhone OS 11.4 (15F79) Report Version: 104

Exception Type: SIGABRT Exception Codes: #0 at 0x181b9d2ec Crashed Thread: 0

Application Specific Information: *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Cannot retrieve referenceObject from an objectID that was not created by this store'

Last Exception Backtrace: 0 CoreFoundation 0x0000000182116d8c exceptionPreprocess + 228 1 libobjc.A.dylib 0x00000001812d05ec objc_exception_throw + 52 2 CoreData 0x0000000184b9869c -[NSIncrementalStore referenceObjectForObjectID:] + 112 3 EncryptedCoreData 0x0000000100cad114 46-[EncryptedStore bindWhereClause:toStatement:]_block_invoke (EncryptedStore.m:3739) 4 CoreFoundation 0x0000000181ff0a20 -[NSArrayM enumerateObjectsWithOptions:usingBlock:] + 212 5 EncryptedCoreData 0x0000000100cacfb8 -[EncryptedStore bindWhereClause:toStatement:] (EncryptedStore.m:3711) 6 EncryptedCoreData 0x0000000100c9abd4 -[EncryptedStore executeRequest:withContext:error:] (EncryptedStore.m:503) 7 CoreData 0x0000000184af8c78 65-[NSPersistentStoreCoordinator executeRequest:withContext:error:]_block_invoke + 1324 8 CoreData 0x0000000184af19b8 55-[NSPersistentStoreCoordinator _routeHeavyweightBlock:]_block_invoke + 108 9 CoreData 0x0000000184b02fb0 gutsOfBlockToNSPersistentStoreCoordinatorPerform + 208 10 libdispatch.dylib 0x0000000181a08a60 _dispatch_client_callout + 12 11 libdispatch.dylib 0x0000000181a115bc _dispatch_queue_barrier_sync_invoke_and_complete + 52 12 CoreData 0x0000000184af13dc _perform + 196 13 CoreData 0x0000000184af1708 -[NSPersistentStoreCoordinator _routeHeavyweightBlock:] + 184 14 CoreData 0x00000001849fb130 -[NSPersistentStoreCoordinator executeRequest:withContext:error:] + 412 15 CoreData 0x00000001849f9c30 -[NSManagedObjectContext executeFetchRequest:error:] + 572 16 CoreData 0x0000000184ac43e0 -[NSManagedObjectContext(_NestedContextSupport) _parentObjectsForFetchRequest:inContext:error:] + 460 17 CoreData 0x0000000184ac4bbc __82-[NSManagedObjectContext(_NestedContextSupport) executeRequest:withContext:error:]_block_invoke + 576 18 CoreData 0x0000000184ac6e10 internalBlockToNSManagedObjectContextPerform + 88 19 libdispatch.dylib 0x0000000181a08a60 _dispatch_client_callout + 12 20 libdispatch.dylib 0x0000000181a16da4 _dispatch_sync_thread_bound_invoke + 64 21 libdispatch.dylib 0x0000000181a08a60 _dispatch_client_callout + 12 22 libdispatch.dylib 0x0000000181a1565c _dispatch_main_queue_callback_4CF$VARIANT$mp + 1008 23 CoreFoundation 0x00000001820bf070 CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE + 8 24 CoreFoundation 0x00000001820bcbc8 CFRunLoopRun + 2268 25 CoreFoundation 0x0000000181fdcda8 CFRunLoopRunSpecific + 548 26 GraphicsServices 0x0000000183fc1020 GSEventRunModal + 96 27 UIKit 0x000000018bff9758 UIApplicationMain + 232 28 mobilecore 0x00000001001f61a4 main (AppDelegate.swift:13) 29 libdyld.dylib 0x0000000181a6dfc0 start + 0

Thread 0 Crashed: 0 libsystem_kernel.dylib 0x0000000181b9d2ec pthread_kill + 8 1 libsystem_pthread.dylib 0x0000000181d3e288 pthread_kill$VARIANT$mp + 372 2 libsystem_c.dylib 0x0000000181b0bd0c abort + 136 3 mobilecore 0x00000001008580cc uncaught_exception_handler + 68 4 CoreFoundation 0x00000001821171c8 handleUncaughtException + 824 5 libobjc.A.dylib 0x00000001812d08c8 _objc_terminate() + 108 6 mobilecore 0x000000010084d8cc BITCrashUncaughtCXXTerminateHandler() (BITCrashCXXExceptionHandler.mm:185) 7 libc++abi.dylib 0x00000001812c037c std::terminate(void (*)()) + 12 8 libc++abi.dylib 0x00000001812c0400 std::terminate() + 80 9 libdispatch.dylib 0x0000000181a08a74 _dispatch_client_callout + 32 10 libdispatch.dylib 0x0000000181a16da4 _dispatch_sync_thread_bound_invoke + 64 11 libdispatch.dylib 0x0000000181a08a60 _dispatch_client_callout + 12 12 libdispatch.dylib 0x0000000181a1565c _dispatch_main_queue_callback_4CF$VARIANT$mp + 1008 13 CoreFoundation 0x00000001820bf070 CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE + 8 14 CoreFoundation 0x00000001820bcbc8 CFRunLoopRun + 2268 15 CoreFoundation 0x0000000181fdcda8 CFRunLoopRunSpecific + 548 16 GraphicsServices 0x0000000183fc1020 GSEventRunModal + 96 17 UIKit 0x000000018bff9758 UIApplicationMain + 232 18 mobilecore 0x00000001001f61a4 main (AppDelegate.swift:13) 19 libdyld.dylib 0x0000000181a6dfc0 start + 0

Thread 1: 0 libsystem_kernel.dylib 0x0000000181b7be08 mach_msg_trap + 8 1 CoreFoundation 0x00000001820bee40 CFRunLoopServiceMachPort + 192 2 CoreFoundation 0x00000001820bc908 CFRunLoopRun + 1564 3 CoreFoundation 0x0000000181fdcda8 CFRunLoopRunSpecific + 548 4 Foundation 0x0000000182a51674 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 300 5 Foundation 0x0000000182a5151c -[NSRunLoop(NSRunLoop) runUntilDate:] + 144 6 UIKit 0x000000018bcde768 -[UIEventFetcher threadMain] + 132 7 Foundation 0x0000000182b61efc NSThreadstart__ + 1036 8 libsystem_pthread.dylib 0x0000000181d3d220 _pthread_body + 268 9 libsystem_pthread.dylib 0x0000000181d3d110 _pthread_start + 288 10 libsystem_pthread.dylib 0x0000000181d3bb10 thread_start + 0

Thread 2: 0 libsystem_kernel.dylib 0x0000000181b7be08 mach_msg_trap + 8 1 CoreFoundation 0x00000001820bee40 CFRunLoopServiceMachPort + 192 2 CoreFoundation 0x00000001820bc908 CFRunLoopRun + 1564 3 CoreFoundation 0x0000000181fdcda8 CFRunLoopRunSpecific + 548 4 Foundation 0x0000000182a51674 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 300 5 Foundation 0x0000000182ac61a8 -[NSRunLoop(NSRunLoop) run] + 84 6 mobilecore 0x00000001007f4f98 +[GAI threadMain:] + 60 7 Foundation 0x0000000182b61efc NSThreadstart__ + 1036 8 libsystem_pthread.dylib 0x0000000181d3d220 _pthread_body + 268 9 libsystem_pthread.dylib 0x0000000181d3d110 _pthread_start + 288 10 libsystem_pthread.dylib 0x0000000181d3bb10 thread_start + 0

Thread 3: 0 libsystem_kernel.dylib 0x0000000181b9d0f4 psynch_cvwait + 8 1 libc++.1.dylib 0x000000018125325c std::__1::condition_variable::wait(std::1::unique_lock&) + 20 2 JavaScriptCore 0x0000000189763460 void std::1::condition_variable_any::wait<std::1::unique_lock >(std::1::unique_lock&) + 100 3 JavaScriptCore 0x0000000189763074 bmalloc::Scavenger::threadRunLoop() + 160 4 JavaScriptCore 0x0000000189762e1c bmalloc::Scavenger::threadEntryPoint(bmalloc::Scavenger) + 8 5 JavaScriptCore 0x0000000189763238 void std::1::thread_proxy<std::1::tuple<std::1::unique_ptr<std::1::thread_struct, std::1::default_delete >, void ()(bmalloc::Scavenger), bmalloc::Scavenger> >(void) + 40 6 libsystem_pthread.dylib 0x0000000181d3d220 _pthread_body + 268 7 libsystem_pthread.dylib 0x0000000181d3d110 _pthread_start + 288 8 libsystem_pthread.dylib 0x0000000181d3bb10 thread_start + 0

Thread 4: 0 libsystem_kernel.dylib 0x0000000181b7be08 mach_msg_trap + 8 1 CoreFoundation 0x00000001820bee40 CFRunLoopServiceMachPort + 192 2 CoreFoundation 0x00000001820bc908 CFRunLoopRun + 1564 3 CoreFoundation 0x0000000181fdcda8 CFRunLoopRunSpecific + 548 4 WebCore 0x000000018a29e2d0 RunWebThread(void*) + 588 5 libsystem_pthread.dylib 0x0000000181d3d220 _pthread_body + 268 6 libsystem_pthread.dylib 0x0000000181d3d110 _pthread_start + 288 7 libsystem_pthread.dylib 0x0000000181d3bb10 thread_start + 0

Thread 5: 0 libsystem_kernel.dylib 0x0000000181b7be08 mach_msg_trap + 8 1 CoreFoundation 0x00000001820bee40 CFRunLoopServiceMachPort + 192 2 CoreFoundation 0x00000001820bc908 CFRunLoopRun + 1564 3 CoreFoundation 0x0000000181fdcda8 CFRunLoopRunSpecific + 548 4 CFNetwork 0x00000001828ea6e0 -[CoreSchedulingSetRunnable runForever] + 216 5 Foundation 0x0000000182b61efc NSThreadstart + 1036 6 libsystem_pthread.dylib 0x0000000181d3d220 _pthread_body + 268 7 libsystem_pthread.dylib 0x0000000181d3d110 _pthread_start + 288 8 libsystem_pthread.dylib 0x0000000181d3bb10 thread_start + 0

Thread 6: 0 libsystem_kernel.dylib 0x0000000181b9d0f4 __psynch_cvwait + 8 1 JavaScriptCore 0x0000000188c9cb8c WTF::ThreadCondition::timedWait(WTF::Mutex&, double) + 76 2 JavaScriptCore 0x00000001897489ec WTF::ParkingLot::parkConditionallyImpl(void const, WTF::ScopedLambda<bool ()> const&, WTF::ScopedLambda<void ()> const&, WTF::TimeWithDynamicClockType const&) + 2248 3 JavaScriptCore 0x000000018920053c bool WTF::Condition::waitUntil(WTF::Lock&, WTF::TimeWithDynamicClockType const&) + 180 4 JavaScriptCore 0x0000000189732ce8 WTF::CrossThreadQueue::waitForMessage() + 112 5 JavaScriptCore 0x0000000189732c40 WTF::CrossThreadTaskHandler::taskRunLoop() + 212 6 JavaScriptCore 0x000000018975a2e0 WTF::Thread::entryPoint(WTF::Thread::NewThreadContext) + 220 7 JavaScriptCore 0x0000000188c98294 WTF::wtfThreadEntryPoint(void*) + 8 8 libsystem_pthread.dylib 0x0000000181d3d220 _pthread_body + 268 9 libsystem_pthread.dylib 0x0000000181d3d110 _pthread_start + 288 10 libsystem_pthread.dylib 0x0000000181d3bb10 thread_start + 0

Thread 7: 0 libsystem_kernel.dylib 0x0000000181b7be08 mach_msg_trap + 8 1 CoreFoundation 0x00000001820bee40 CFRunLoopServiceMachPort + 192 2 CoreFoundation 0x00000001820bc908 CFRunLoopRun + 1564 3 CoreFoundation 0x0000000181fdcda8 CFRunLoopRunSpecific + 548 4 AVFAudio 0x0000000187ad6398 GenericRunLoopThread::Entry(void) + 160 5 AVFAudio 0x0000000187b007a8 CAPThread::Entry(CAPThread) + 84 6 libsystem_pthread.dylib 0x0000000181d3d220 _pthread_body + 268 7 libsystem_pthread.dylib 0x0000000181d3d110 _pthread_start + 288 8 libsystem_pthread.dylib 0x0000000181d3bb10 thread_start + 0

Thread 8: 0 libsystem_kernel.dylib 0x0000000181b9dd84 __workq_kernreturn + 8 1 libsystem_pthread.dylib 0x0000000181d3bb08 start_wqthread + 0

Thread 9: 0 libsystem_kernel.dylib 0x0000000181b9dd84 __workq_kernreturn + 8 1 libsystem_pthread.dylib 0x0000000181d3bb08 start_wqthread + 0

Moskacz commented 5 years ago

I have the same issue when merging two contexts

ThePragmaticArt commented 4 years ago

@PradeshKumar-emisweb Did you find a solution to this issue? I'm hitting the same thing now when inserting and deleting a model from the same thread prior to saving.

glaurent commented 4 years ago

Same here 😕