On Mar 2, 2009, at 9:22 PM, Dave DeLong wrote:

Hey everyone,

I've just come across something that I'm totally lost on.

I've got an app that I'm making that uses the Flying Meat database system (this may or may not be relevant; I have no idea), a couple static arrays[], and an "EditMyTeamsViewController".

When I call:

EditMyTeamsViewController * editMyTeams = [[EditMyTeamsViewController alloc] init];

I get an EXC_BAD_ACCESS on line 11 of the assembly in _class_changeInfo (presumably in the runtime): 0x941e6d4a <+0022> mov 0x10(%edx),%eax (in case you really wanted to know)

The stacktrace is:
_class_changeInfo
_class_setInitialized
_class_initialize
_class_lookupMethodAndLoadCache
_objc_msgSend
[MyCallingClass callingMethod]

I have verified that the result of the +alloc call is non-nil, but other than that I have no clue how to begin debugging this.

Most likely, you've sent a message to an invalid object, or to a valid object that was mangled by a memory error elsewhere. Usually that will crash inside objc_msgSend() itself, but if your bogus object happens to include dereferenceable pointers in the right places then the Objective-C runtime will happily traverse the "object" and "isa" and "method cache" and "class info" and finally fall over somewhere like the +initialize machinery as seen here.

Debug it as if it had crashed in objc_msgSend() itself. Make sure the memory management of the receiver is good, and if it is then look for other memory errors that might have clobbered it. NSZombie and Guard Malloc are probably your new best friends.


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