• 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: Stumped by EXEC_BAD_ACCESS
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Stumped by EXEC_BAD_ACCESS


  • Subject: Re: Stumped by EXEC_BAD_ACCESS
  • From: Greg Parker <email@hidden>
  • Date: Fri, 31 Jul 2009 11:09:09 -0700

On Jul 30, 2009, at 1:37 PM, David Blanton wrote:
When I quit my application it ends as expected.

When I close the last window I get the EXEC_BAD_ACCESS message.

Following Greg Parker's 2006 post at CocoaBuilder I get the following which according to that post respondsToSelector:" is being called on a nil object. As you can see the object_GetClassName() which should tell the call the method is being called on also breaks.

Current language:  auto; currently objective-c++
Program received signal:  “EXC_BAD_ACCESS”.
(gdb) x/s $ecx
0x93c83164 <__FUNCTION__.12370+617988>:	 "respondsToSelector:"
(gdb) x/8x $esp
0xbfffe758:	0x006ec390	0x90a8283b	0x09d818f0	0x93c83164
0xbfffe768:	0x93c24788	0x94063734	0x09d86750	0xa0078b40
(gdb) p (char *)object_getClassName(0x93c83164)

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x7073657a
0x93be3058 in _class_getName ()

Your diagnosis of 'respondsToSelector:' looks correct. But then you call object_getClassName() on the selector's address, which doesn't make any sense. That invalid address is the ASCII text 'resp'+8.


Your bad object is 0x09d818f0. Most likely it has already been deallocated which then causes this crash. (If it has been deallocated, then its isa pointer will no longer be valid, so object_getClassName() will still fail.) Use NSZombie and MallocStackLogging to track down the bad object and its memory management history.

So you crashed in objc_msgSend:
http://sealiesoftware.com/blog/archive/2008/09/22/objc_explain_So_you_crashed_in_objc_msgSend.html


-- 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


References: 
 >Stumped by EXEC_BAD_ACCESS (From: David Blanton <email@hidden>)

  • Prev by Date: Re: local statics, GC, and strong references
  • Next by Date: Re: Application Preferences - a general question
  • Previous by thread: Re: Stumped by EXEC_BAD_ACCESS
  • Next by thread: NSURL fileURLWithPath doesn't produce a valid URL
  • Index(es):
    • Date
    • Thread