Re: Just implementing -isEqual:, never invoked, causes crash
Re: Just implementing -isEqual:, never invoked, causes crash
- Subject: Re: Just implementing -isEqual:, never invoked, causes crash
- From: Jerry Krinock <email@hidden>
- Date: Fri, 19 Jun 2009 11:20:14 -0700
Thanks to all who pointed out that you can't set those zombie
environment variables in main(). No wonder why they never worked for
me!
With zombies properly enabled, I now consistently get this before the
crash:
*** -[ entitiesByName]: message sent to deallocated instance
0x24c92a0
Is it odd that there is no class name in there?
But it still crashes.
Since -entitiesByName is an NSManagedObjectModel method, I noted that
I had overridden -[NSPersistentDocument managedObjectModel] (to make
it look in a different bundle). But I don't release it in there, and
actually I never even invoke the method -- it is implemented for use
by Core Data.
Logging this MOM's pointer value, I see that the instance I create is
indeed the same instance which is getting the post-dealloc message.
So I added ten unbalanced -retain messages, retest, but it still gets
a post-dealloc message, and app still crashes. Then I eliminated my
implementation altogether (since actually it is in a framework and is
not needed in this app -- long story). Result: Still gets a post-
dealloc message, and app still crashes.
On 2009 Jun 19, at 09:42, Kyle Sluder wrote:
Not necessarily. Could be a threading issue. Are you multithreaded?
Yes, I use NSOperation and NSOperationQueue to regulate tasks, but
always performSelectorOnMainThread to run methods that access Core
Data -- at least, that is the plan.
If you break in objc_msgSend, you can get self using `po *(id **)
($ebp+8)`.
That's another trick which has never worked for me. I set a
breakpoint in objc_exception_throw. When it stopped there I clicked
"Step Into" about 25 times, until stepped into objc_msgSend. Then I
typed that into the debugger console like you said...
[Switching to process 48118 thread 0x5b03]
(gdb) po *(id **)($ebp+8)
And hit return, but ^nothing^ happens. Tried it with a semicolon too,
and even with backticks. Nothing. I typed "Please talk to me!" Not
a peep. What's the trick?
Try doing a "Clean All."
Cleaned All. Rebuilt. No warnings. Still crashes, all the same.
Thanks all for the ideas, but I'm still open for more. I'm going to
think some more about that -isEqual: implementation (that never gets
invoked). Just remove this implementation and it never crashes. Why?
Jerry
_______________________________________________
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