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     gpar...@apple.com     Runtime Wrangler


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to