Re: Mysterious Redo crash
Re: Mysterious Redo crash
- Subject: Re: Mysterious Redo crash
- From: Ken Thomases <email@hidden>
- Date: Fri, 20 Jun 2008 18:42:23 -0500
On Jun 20, 2008, at 6:27 PM, Graham Cox wrote:
I'm getting a crash sometimes when performing a Redo. Stack trace is
below - seems as if it's something internal to the Undo Manager
putting together the invocation. Any thoughts on how I can
investigate this further? The Undos and Redos up until this point
work fine as far as I can see.
#0 0x9358f6e8 in objc_msgSend
#1 0x92351306 in CFRetain
#2 0x922e15c4 in _CFArrayReplaceValues
#3 0x913299a3 in -[NSCFArray insertObject:atIndex:]
#4 0x91329914 in -[NSCFArray addObject:]
#5 0x923cd729 in __NSI3
#6 0x923ce2b5 in -[NSInvocation setArgument:atIndex:]
#7 0x923ce526 in -[NSInvocation invokeWithTarget:]
#8 0x91400e7c in -[_NSUndoInvocation invoke]
#9 0x91400be4 in -[_NSUndoStack popAndInvoke]
#10 0x914cbf07 in -[NSUndoManager redo]
#11 0x00230272 in -[DKUndoManager redo] at DKUndoManager.m:189
#12 0x90435c23 in -[NSApplication sendAction:to:from:]
#13 0x904e4660 in -[NSMenu performActionForItemAtIndex:]
Looks to me like a memory management bug. Inside of NSInvocation,
it's trying to deal with an object of yours that has since been
deallocated. It's memory has probably since been used for something
else, and when objc_msgSend tries to access its innards, it gets sent
off to la-la-land.
I suspect that NSZombieEnabled will actually mask this crash, but you
might discover the zombie later.
Another approach is to use MallocStackLoggingNoCompact. Then, when it
crashes, sniff the stack a bit to determine which address is being
treated like an object when it isn't, and use malloc_history to see
what object has been there in the past.
On x86, you can find the address using:
(gdb) frame 4
(gdb) p *(id*)($ebp+16)
Cheers,
Ken
_______________________________________________
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