Closed
Bug 345371
Opened 18 years ago
Closed 18 years ago
Check before using weak pointer in nsCaret (Crash [@ nsCaret::DrawCaret])
Categories
(Core :: Layout, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: sharparrow1, Assigned: sharparrow1)
References
Details
(Keywords: fixed1.8.1)
Attachments
(2 files, 2 obsolete files)
3.31 KB,
patch
|
roc
:
review+
roc
:
superreview+
darin.moz
:
approval1.8.1+
|
Details | Diff | Splinter Review |
2.64 KB,
patch
|
Details | Diff | Splinter Review |
Talkback ID TB21175066W. Not reproducable, but it's easy to guess what's causing the crash, and it really should get fixed in any case. Using a weak
pointer without checking it's valid is a bad idea.
http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/layout/base/nsCaret.cpp&rev=1.160&mark=985-986#984
It's apparently rare; Talkback says there have been 62 crashes in nsCaret::DrawCaret since late March.
Easy patch coming up to fix all the unchecked uses of mPresShell.
Setting dependency on bug 305798 since that patch added the relevant code.
Assignee | ||
Comment 1•18 years ago
|
||
Comment 2•18 years ago
|
||
In my defense, there was already one use of the unchecked weak pointer (in GetCaretCoordinates) prior to my fix for bug 305798. I probably just copied that to the other places.
Anyway, thanks for finding this and providing a patch.
Attachment #230004 -
Flags: superreview+
Attachment #230004 -
Flags: review?(roc)
Attachment #230004 -
Flags: review+
Assignee | ||
Comment 3•18 years ago
|
||
Checked in.
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 4•18 years ago
|
||
Comment on attachment 230004 [details] [diff] [review]
Patch
Probably a good idea to get this on the branch.
Attachment #230004 -
Flags: approval1.8.1?
Comment 5•18 years ago
|
||
Comment on attachment 230004 [details] [diff] [review]
Patch
a=darin on behalf of drivers
Attachment #230004 -
Flags: approval1.8.1? → approval1.8.1+
Assignee | ||
Updated•18 years ago
|
Whiteboard: [checkin needed (1.8 branch)]
Comment 6•18 years ago
|
||
Updated•18 years ago
|
Attachment #230357 -
Attachment is obsolete: true
Comment 7•18 years ago
|
||
The trunk patch doesn't apply cleanly to the 1.8.1 branch. Someone should check if this patch is correct for the 1.8.1 branch, I think it is.
Assignee | ||
Comment 8•18 years ago
|
||
Missed
http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/layout/base/nsCaret.cpp&rev=MOZILLA_1_8_BRANCH&cvsroot=/cvsroot&mark=552-555#550
Looks good otherwise; thanks.
Comment 9•18 years ago
|
||
Ok, thanks, then I guess this is good to go in.
Attachment #230358 -
Attachment is obsolete: true
Comment 10•18 years ago
|
||
Checking in nsCaret.cpp;
/cvsroot/mozilla/layout/base/nsCaret.cpp,v <-- nsCaret.cpp
new revision: 1.144.2.9; previous revision: 1.144.2.8
done
Checked into 1.8.1 branch.
Whiteboard: [checkin needed (1.8 branch)]
Updated•18 years ago
|
Keywords: fixed1.8.1
Updated•6 years ago
|
Product: Core → Core Graveyard
Updated•6 years ago
|
Component: Layout: Misc Code → Layout
Product: Core Graveyard → Core
You need to log in
before you can comment on or make changes to this bug.
Description
•