I have a situation in which -[NSManagedObjectContext save:] is crashing. I think what's happening is this:
Main MOC creates a "Foo". Child MOC A gets a copy of that Foo and hangs on to a reference to it, doing some asynchronous work (uploading it). Child MOC B gets a copy and deletes it, saving itself, and then save is issued on the parent MOC. Child MOC A finishes its work, updates its Foo, and saves. CRASH. The crash manifests as Child MOC A's thread being blocked on -save:, and the main thread throwing an objc exception: #0 0x03a7988a in objc_exception_throw () #1 0x0180933b in _PFFaultHandlerLookupRow () #2 0x0183b628 in -[NSFaultHandler fulfillFault:withContext:] () #3 0x018af929 in -[NSManagedObject(_NSInternalMethods) _updateFromRefreshSnapshot:includingTransients:] () #4 0x018440a2 in -[NSManagedObjectContext(_NestedContextSupport) _copyChildObject:toParentObject:fromChildContext:] () #5 0x01843988 in -[NSManagedObjectContext(_NestedContextSupport) _parentProcessSaveRequest:inContext:error:] () #6 0x018bc1f4 in __82-[NSManagedObjectContext(_NestedContextSupport) executeRequest:withContext:error:]_block_invoke () #7 0x0183e321 in internalBlockToNSManagedObjectContextPerform () #8 0x05551440 in _dispatch_barrier_sync_f_slow_invoke () At the very least, I would've hoped the save would fail with an error. What should I expect in this situation? Thanks! -- Rick
signature.asc
Description: Message signed with OpenPGP using GPGMail
_______________________________________________ Cocoa-dev mailing list ([email protected]) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [email protected]
