• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How EXC_BAD_ACCESS in objc_msgSend if receiver, parms OK?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: How EXC_BAD_ACCESS in objc_msgSend if receiver, parms OK?
      • From: Sean McBride <email@hidden>
References: 
 >How EXC_BAD_ACCESS in objc_msgSend if receiver, parms OK? (From: Jerry Krinock <email@hidden>)
 >Re: How EXC_BAD_ACCESS in objc_msgSend if receiver, parms OK? (From: Kyle Sluder <email@hidden>)
 >Re: How EXC_BAD_ACCESS in objc_msgSend if receiver, parms OK? (From: Jerry Krinock <email@hidden>)

  • Prev by Date: Re: copy & isEqual nightmares
  • Next by Date: My runloop-based async code breaks with GCD
  • Previous by thread: Re: How EXC_BAD_ACCESS in objc_msgSend if receiver, parms OK?
  • Next by thread: Re: How EXC_BAD_ACCESS in objc_msgSend if receiver, parms OK?
  • Index(es):
    • Date
    • Thread