Re: Can't send messages to a valid object
Re: Can't send messages to a valid object
- Subject: Re: Can't send messages to a valid object
- From: Greg Parker <email@hidden>
- Date: Sat, 4 Oct 2003 20:14:33 -0400
Charles Jolley wrote:
>
I am encountering a very obscure bug in my code that does not seem to
>
make any sense. The basic issue is that when I send any message to an
>
object (in code or via command line in GDB) then I get a EXC_BAD_ACCESS
>
signal inside of objc_msgSend. However, I can inspect the object's
>
memory and all of its ivars are intact and can be accessed directly.
>
>
The problem occurs sporadically, which made me think that this would be
>
some kind of memory corruption issue. However, I have posed NSObject
>
to disable all deallocs, so I know the memory is valid. Additionally,
>
I can inspect the memory and everything looks to be in order.
The bad access may not actually be in the receiver object's memory.
objc_msgSend also accesses other memory, including the receiver's
class and that class's method cache. If that data is trashed, you'll
get a crash or possibly an infinite loop inside objc_msgSend().
Another possibility is that the receiver's isa pointer is trashed.
What does the crash report say? The actual faulting instruction will
indicate which memory the runtime was trying to access (well, to
me, anyway). You might also check whether the receiver's isa looks
valid.
--
Greg Parker email@hidden Java & Objective-C
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.