Re: What does crash in setSelectedRanges:affinity:stillSelecting mean?
Re: What does crash in setSelectedRanges:affinity:stillSelecting mean?
- Subject: Re: What does crash in setSelectedRanges:affinity:stillSelecting mean?
- From: Daniel Jalkut <email@hidden>
- Date: Fri, 16 Dec 2005 11:17:30 -0500
Hi Jesse - when a crash occurs in Cocoa it's practically (haha, not
even close) like having source code.
I just opened gdb on a likely client of this method, TextEdit. I did
this to easily "browse" the function:
Breakpoint 1, 0x93749d8c in -[NSTextView(NSSharing)
setSelectedRanges:affinity:stillSelecting:] ()
(gdb) x/20i $pc+652
0x9374a018 <-[NSTextView(NSSharing)
setSelectedRanges:affinity:stillSelecting:]+680>: bla
0xfffeff00 <objc_msgSend_rtp>
0x9374a01c <-[NSTextView(NSSharing)
setSelectedRanges:affinity:stillSelecting:]+684>: cmpwi cr7,r3,0
0x9374a020 <-[NSTextView(NSSharing)
setSelectedRanges:affinity:stillSelecting:]+688>: lwz r3,64(r30)
Since your stack crawl shows the return address as +684, the
objc_msgSend_rtp at +680 must be the suspect. We can set a
breakpoint on that and continue:
Breakpoint 2, 0x9374a018 in -[NSTextView(NSSharing)
setSelectedRanges:affinity:stillSelecting:] ()
(gdb) omv
<Document: 0x326dd0>
0x90a2a8d0 <_errNewVars+372732>: "respondsToSelector:"
For fun we can also find out exactly what selector it's looking for
in the target object:
(gdb) x/s $r5
0x90a3887c <_errNewVars+429992>:
"textView:willChangeSelectionFromCharacterRanges:toCharacterRanges:"
OK so this is probably some kind of delegate callback. Without
delving too much farther into this I would say that you can do this
same breakpoint in your own project and see what scenarios lead to
this breakpoint being hit, and what is the delegate in all those
scenarios?
Is it possible that at some point the delegate has been released but
not unset from the text view?
Hope this helps open some windows of thought...
Daniel
On Dec 16, 2005, at 10:32 AM, Jesse Grosjean wrote:
I've had a number of crash reports with this same basic stack trace:
0 <<00000000>> 0xfffeff18 objc_msgSend_rtp 24
1 com.apple.AppKit 0x9374a01c -[NSTextView
(NSSharing) setSelectedRanges:affinity:stillSelecting:] 684
2 com.apple.AppKit 0x936ff3dc -[NSLayoutManager
(NSPrivate)
_fixSelectionAfterChangeInCharacterRange:changeInLength:] 820
3 com.apple.AppKit 0x936fb524 -[NSLayoutManager
textStorage:edited:range:changeInLength:invalidatedRange:] 904
4 com.apple.AppKit 0x936fb17c -[NSTextStorage
_notifyEdited:range:changeInLength:invalidatedRange:] 140
5 com.apple.AppKit 0x9375c62c -[NSTextStorage
processEditing] 188
6 ...baysoftware.mori.MIDocument 0x0027eaa8 -[MITextStorage
processEditing] 828
7 com.apple.AppKit 0x9375d214 -[NSTextStorage
endEditing] 80
Unfortunately it's not something that I've been able to duplicate
myself. I wonder if anyone here has any idea of what might cause
this sort of crash, and what I should try to fix it.
Thanks,
Jesse
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
sweater.com
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden