Re: How EXC_BAD_ACCESS in objc_msgSend if receiver, parms OK?
Re: How EXC_BAD_ACCESS in objc_msgSend if receiver, parms OK?
- Subject: Re: How EXC_BAD_ACCESS in objc_msgSend if receiver, parms OK?
- From: Greg Parker <email@hidden>
- Date: Fri, 17 Feb 2012 16:06:01 -0800
On Feb 17, 2012, at 2:02 PM, Jerry Krinock wrote:
> On 2012 Feb 17, at 09:54, Kyle Sluder wrote:
>> All that means is that the storage for the object hasn't been overwritten yet.
>
> Thank you, Kyle, and I see what you mean. But also my tests show that the object is still able to respond to messages, which means that it shouldn't have crashed objc_msgSend. No?
No. objc_msgSend() also reads from the class's method cache and method list. It's possible for the receiver object to be valid, but still crash because of a memory smasher that hit the method cache or method list. If those data structures are damaged in the right way then some messages will succeed and other messages will crash, which is consistent with your ability to send other messages to the object.
Those of us who wrote objc_msgSend() can sometimes track down the problem by finding which data structure was damaged and examining the bad data. Everyone else should try Zombies, Guard Malloc, and Malloc Scribble.
--
Greg Parker email@hidden Runtime Wrangler
_______________________________________________
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