Re: Help DTrace gurus: suggestions for capturing a mis-allocated NSData object on a customer's system
Re: Help DTrace gurus: suggestions for capturing a mis-allocated NSData object on a customer's system
- Subject: Re: Help DTrace gurus: suggestions for capturing a mis-allocated NSData object on a customer's system
- From: Scott Ribe <email@hidden>
- Date: Tue, 16 Nov 2010 10:32:47 -0700
On Nov 16, 2010, at 9:25 AM, James Bucanek wrote:
> The memory block it tries to release is invalid (was never allocated).
FYI, I've had the tools give me a message about freeing a block that was never allocated when I double-freed an allocated block. So it doesn't actually mean that no block was ever allocated with that address, just that there's not currently a block allocated with that address.
> The address the NSConcreteData is trying to release was never allocated (but appears that it might be inside another object allocation).
My guess would be allocated, freed, another block allocated that included it, then a second attempt to free it.
Yeah well, that's not much help I know, but I think you shouldn't focus exclusively on the notion that you're looking for a block that was never allocated, assume that it might have been allocated. (Of course, it might not have been. You could be writing through an invalid pointer and modifying the NSData's internals...)
Are you in control of the allocation of all these NSData objects? My understanding is that swizzling is more or less gone, but could you create a simple subclass that overrides retain & release with your own logging versions and use that in place of NSData? Of course if you disturb memory layout much, you may just mask the problem, but it would be worth a try.
An extremely crude debugging technique when all else fails, provided you won't run of memory, is to selectively eliminate release/free where you suspect you might have a over-release or double-free, and see whether or not it still crashes.
--
Scott Ribe
email@hidden
http://www.elevated-dev.com/
(303) 722-0567 voice
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden