• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Core Data + Undo + Autosave = Instability?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Core Data + Undo + Autosave = Instability?


  • Subject: Re: Core Data + Undo + Autosave = Instability?
  • From: Jerry Krinock <email@hidden>
  • Date: Fri, 30 Sep 2011 12:10:57 -0700

On 2011 Sep 30, at 09:42, Jim Correia wrote:

> But you have a pretty reliable way to reproduce the bug, right?

Thank you, Jim.  Yes, it takes several minutes but is scripted.

> Have you broken at the point of objc_exception_throw for the NSObjectInaccessibleException and examined what, specifically, is firing the fault?


Yes.  I was wrong about attributes not being in the invocation – see below.

#0	0x962250c0 in objc_exception_throw
#1	0x94c6a891 in _PFFaultHandlerLookupRow
#2	0x94c9b5df in -[NSFaultHandler fulfillFault:withContext:]
#3	0x94c796b3 in -[NSManagedObject(_NSInternalMethods) _newPropertiesForRetainedTypes:andCopiedTypes:preserveFaults:]
#4	0x94c7965f in -[NSManagedObject(_NSInternalMethods) _newAllPropertiesWithRelationshipFaultsIntact__]
#5	0x94c7954e in -[NSManagedObjectContext(_NSInternalChangeProcessing) _establishEventSnapshotsForObject:]
#6	0x94c79465 in _PFFastMOCObjectWillChange
#7	0x94cd7019 in -[NSManagedObjectContext(_NSInternalChangeProcessing) _undoUpdates:]
#8	0x9021effd in __invoking___
#9	0x9021ef39 in -[NSInvocation invoke]
#10	0x9021f08a in -[NSInvocation invokeWithTarget:]
#11	0x001be1b9 in -[GCConcreteUndoTask perform] at GCUndoManager.m:1496

Thanks to Graham Cox, I have code for [GCConcreteUndoTask perform].  I also have a category on NSInvocation which gives me a -longDescription of its properties:

   target = The document's (and Undo Manager's) managed object context
   selector = _undoUpdates:
   The argument of _undoUpdates: is an array containing 4 objects
      object at index 0:
         the deleted object, with a retainCount of 9, whose
             data is <fault>
      object at index 1:
         an instance of NSKnownKeysDictionary1, whose keys and
         values are the keys and values of the deleted object
         before it was faulted.  Its retainCount is 9.
      object at index 2:
         an instance of NSNull
      object at index 3:
         an instance of NSNumber whose value is 1

> Start here and work backwards and you may be able to infer why someone has a reference to a stale object.

I've never seen a precise definition of the word "stale" in Core Data.  The object in question has a retainCount of 9, and it is faulted.  Does that mean it's "stale"?

> At the very least you’ll know who.

It seems that NSManagedObjectContext seems to have all the information it needs to un-fault the object, but won't do it for some reason.

_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:

This email sent to email@hidden

References: 
 >Core Data : Undo Delete : Cannot fulfill a fault (From: Jerry Krinock <email@hidden>)
 >Re: Core Data : Undo Delete : Cannot fulfill a fault (From: Richard Somers <email@hidden>)
 >Re: Core Data : Undo Delete : Cannot fulfill a fault (From: Jerry Krinock <email@hidden>)
 >Re: Core Data : Undo Delete : Cannot fulfill a fault (From: Dave Fernandes <email@hidden>)
 >Re: Core Data : Undo Delete : Cannot fulfill a fault (From: Jerry Krinock <email@hidden>)
 >Re: Core Data : Undo Delete : Cannot fulfill a fault (From: Dave Fernandes <email@hidden>)
 >Re: Core Data : Undo Delete : Cannot fulfill a fault (From: Jerry Krinock <email@hidden>)
 >Re: Core Data : Undo Delete : Cannot fulfill a fault (From: Quincey Morris <email@hidden>)
 >Re: Core Data : Undo Delete : Cannot fulfill a fault (From: Jim Correia <email@hidden>)
 >Re: Core Data : Undo Delete : Cannot fulfill a fault (From: Quincey Morris <email@hidden>)
 >Re: Core Data : Undo Delete : Cannot fulfill a fault (From: Jerry Krinock <email@hidden>)
 >Re: Core Data : Undo Delete : Cannot fulfill a fault (From: Jim Correia <email@hidden>)

  • Prev by Date: Re: Question about SMJobBless
  • Next by Date: Re: Core Data : Undo Delete : Cannot fulfill a fault
  • Previous by thread: Re: Core Data : Undo Delete : Cannot fulfill a fault
  • Next by thread: Re: Core Data : Undo Delete : Cannot fulfill a fault
  • Index(es):
    • Date
    • Thread