Re: Help tracking down a dangling pointer?
Re: Help tracking down a dangling pointer?
- Subject: Re: Help tracking down a dangling pointer?
- From: Sixten Otto <email@hidden>
- Date: Thu, 10 Jun 2010 14:26:53 -0400
On Thu, Jun 10, 2010 at 1:41 PM, Greg Parker <email@hidden> wrote:
> If you suspect a use-after-free bug somewhere, and NSZombie doesn't find it, then try this:
> 1. Verify that NSZombie is operating. Add `[[[[NSMutableString alloc] init] release] release]` to your code. Make sure NSZombie catches it.
Well, the simple test works: adding a deliberate over-release to my
applicationDidFinishLaunching: logs exactly the console message I'd
expect. And with a breakpoint on objc_exception_throw(), stops right
there.
With the actual crash, I get the stack trace I posted before, and no
expected console log. (I also tried turning the scribble off, and
disabling the breakpoint, just to see.)
> 2. If NSZombie doesn't help, try Guard Malloc. It's slow, but catches errors that NSZombie does not catch.
Enabline Guard Malloc and running the app, it crashes in exactly the
same way, but the stack trace has slightly more information; the ?? is
replaced with an actual method (but still in framework code):
#0 0x91a27ed7 in objc_msgSend
#1 0x04ba6b20 in -[_PFManagedObjectReferenceQueue
_processReferenceQueue]
#2 0x01dc89ba in _performRunLoopAction
(Just for grins, I turned off zombies and malloc logging, and tried
again, and got the same result.)
Sixten
_______________________________________________
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