Re: NSEntityDescription random crash
Re: NSEntityDescription random crash
- Subject: Re: NSEntityDescription random crash
- From: "Nicolas L." <email@hidden>
- Date: Tue, 22 Jul 2008 12:24:30 +0200
Thank you - I have tried enabling NSZombie and it seems the object
being freed is my managedObjectModel.
I really can't figure out why the MOM instance is being deallocated.
I don't have a lot of code to post since I'm using the standard Xcode-
generated code for non-duc based CoreData apps. (An app delegate,
instantiated in the MainMenu nib, and a bunch of accessors to get the
persistent store coordinator, MOM and MOC the first time someone asks
for them).
I enabled MallocStackLogging and looked up that xxx address with
malloc_history <pid> xxx, and here's what the trace looks like:
=================================
Call [2] [arg=36]: thread_a00e2fa0 |start | main | NSApplicationMain |
+[NSBundle(NSNibLoading) loadNibNamed:owner:] | +
[NSBundle(NSNibLoading) loadNibFile:externalNameTable:withZone:] | +
[NSBundle(NSNibLoading) _loadNibFile:nameTable:withZone:ownerBundle:]
| loadNib | -[NSIBObjectData nibInstantiateWithOwner:topLevelObjects:]
| -[NSNibBindingConnector establishConnection] | -
[NSObject(NSKeyValueBindingCreation)
bind:toObject:withKeyPath:options:] | -[NSBinder
_performConnectionEstablishedRefresh] | -[NSObjectParameterBinder
_observeValueForKeyPath:ofObject:context:] | -[NSObjectParameterBinder
_updateObject:observedController:observedKeyPath:context:] | -
[NSBinder valueForBinding:resolveMarkersToPlaceholders:] | -[NSBinder
_valueForKeyPath:ofObject:mode:raisesForNotApplicableKeys:] | -
[NSObject(NSKeyValueCoding) valueForKeyPath:] | -
[NSObject(NSKeyValueCoding) valueForKey:] | -[AppDelegate
managedObjectContext] | -[AppDelegate persistentStoreCoordinator] | -
[AppDelegate managedObjectModel] | +[NSManagedObjectModel
mergedModelFromBundles:] | -[NSManagedObjectModel
initWithContentsOfURL:] | +[NSKeyedUnarchiver
unarchiveObjectWithFile:] | _decodeObject | _decodeObjectBinary | +
[NSObject allocWithZone:] | _internal_class_createInstance |
_internal_class_createInstanceFromZone | calloc | malloc_zone_calloc
Call [4] [arg=0]: thread_b013e000 |thread_start | _pthread_start |
minion_duties2 | CFRelease | -[_PFTask dealloc] | malloc_zone_free
Call [2] [arg=48]: thread_b013e000 |thread_start | _pthread_start |
minion_duties2 | CFRelease | -[_PFTask dealloc] | NSDeallocateObject |
objc_duplicateClass | calloc | malloc_zone_calloc
=================================
Any thoughts as to what minion_duties2 or PFTask is? I am not the one
creating background threads in the app, so I take it thread_b013e000
is Cocoa/CoreData's doing.
If the problem comes from my nib and bindings, is there a way to debug
that?
Thanks!
Nicolas
On Jul 10, 2008, at 5:54 PM, Shawn Erickson wrote:
On Thu, Jul 10, 2008 at 6:56 AM, Nicolas Lapomarda <email@hidden
> wrote:
The error I'm getting is random as well, but always takes the form
"*** -[NSCFString _entityForName]: unrecognized selector sent
to
instance xxx".
You likely are not retaining an object that you expect to stay around.
This results in that object getting deallocated and some other random
object dropping in at that address in memory.
You can enable NSZombie to help track down this issue.
<http://developer.apple.com/technotes/tn2004/
tn2124.html#SECFOUNDATION>
-Shawn
_______________________________________________
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