Closed
Bug 581166
Opened 15 years ago
Closed 15 years ago
Silence some spammy NS_ENSURE_TRUE failures in editor code
Categories
(Core :: DOM: Editor, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: dholbert, Assigned: dholbert)
References
Details
Attachments
(3 files, 4 obsolete files)
2.98 KB,
text/plain
|
Details | |
1.13 KB,
patch
|
ehsan.akhgari
:
review+
benjamin
:
approval2.0+
|
Details | Diff | Splinter Review |
1.22 KB,
patch
|
benjamin
:
approval2.0+
|
Details | Diff | Splinter Review |
Filing this bug to fix a few NS_ENSURE_TRUE failures in editor code that have been bugging me. I'll describe each failure & post patches for them. All of these involve debug builds with fresh profiles.
First issue, STR:
1. Load http://ftp.mozilla.org/README and http://ftp.mozilla.org/index.html
(or pretty much any other two websites)
2. Switch back and forth between the tabs.
ACTUAL RESULTS: On each tab-switch, I get:
> WARNING: NS_ENSURE_TRUE(bCollapsed) failed: file ../../../../mozilla/editor/libeditor/text/nsTextEditRules.cpp, line 1009
Assignee | ||
Comment 1•15 years ago
|
||
Assignee: nobody → dholbert
Status: NEW → ASSIGNED
Assignee | ||
Comment 2•15 years ago
|
||
Second issue STR:
1. Start firefox, going to about:blank (no other pageloads required)
2. Quit firefox.
ACTUAL RESULTS: This goes by in my console-spew (one of the last things to appear) as Firefox shuts down:
>WARNING: NS_ENSURE_TRUE(aListener) failed: file ../../../../mozilla/editor/libeditor/base/nsEditor.cpp, line 1714
>WARNING: NS_ENSURE_TRUE(aListener) failed: file ../../../../mozilla/editor/libeditor/base/nsEditor.cpp, line 1714
Fix attached.
Assignee | ||
Updated•15 years ago
|
Attachment #459576 -
Attachment is patch: true
Attachment #459576 -
Attachment mime type: application/octet-stream → text/plain
Assignee | ||
Comment 3•15 years ago
|
||
(fixed typo)
Assignee | ||
Updated•15 years ago
|
Attachment #459573 -
Attachment is obsolete: true
Assignee | ||
Updated•15 years ago
|
Attachment #459576 -
Flags: review?(ehsan)
Assignee | ||
Updated•15 years ago
|
Attachment #459578 -
Flags: review?(ehsan)
Assignee | ||
Comment 4•15 years ago
|
||
(rrgh, attached the old patch-version again -- fixed typo for real this time. :))
Attachment #459578 -
Attachment is obsolete: true
Attachment #459581 -
Flags: review?(ehsan)
Attachment #459578 -
Flags: review?(ehsan)
Updated•15 years ago
|
Attachment #459581 -
Flags: review?(ehsan) → review+
Comment 5•15 years ago
|
||
Comment on attachment 459576 [details] [diff] [review]
Second issue fix
Hmm, what does the stack to this call look like? We shouldn't really be trying to remove a null edit action listener.
Assignee | ||
Comment 6•15 years ago
|
||
Here's the stack trace. This is happening in cycle-collection, after nsPlaintextEditor::cycleCollection::Unlink has run (which sets nsPlaintextEditor.mRules to nsnull).
Then, in nsPlaintextEditor's destructor, we call RemoveEditActionListener on (a QI'd version of) mRules, which is nsnull. And that spams the NS_ENSURE_TRUE.
Perhaps it'd be better to null-check mRules in the destructor before calling RemoveEditActionListener.
Assignee | ||
Comment 7•15 years ago
|
||
This adds a null-check in the destructor, around RemoveEditActionListener, as described in previous comment. It also re-wraps the comment right before that so it doesn't go over 80 characters.
Attachment #459576 -
Attachment is obsolete: true
Attachment #459904 -
Flags: review?(ehsan)
Attachment #459576 -
Flags: review?(ehsan)
Comment 8•15 years ago
|
||
Comment on attachment 459904 [details] [diff] [review]
Second issue fix, v2
Yes, this is much better. Thanks!
Attachment #459904 -
Flags: review?(ehsan) → review+
Assignee | ||
Comment 9•15 years ago
|
||
Oops -- my old fix for 'first issue' tested NS_FAILED on a non-nsresult value. (I was in the mindset of replacing NS_ENSURE_SUCCESS instead of replacing NS_ENSURE_TRUE)
Fixed here. Carrying forward r=ehsan.
Assignee | ||
Updated•15 years ago
|
Attachment #459581 -
Attachment is obsolete: true
Assignee | ||
Comment 10•15 years ago
|
||
Comment on attachment 459904 [details] [diff] [review]
Second issue fix, v2
Requesting approval on this bug's patches.
They don't make any real changes to our logic -- they just replace/navigate around two spammy NS_ENSURE_TRUE warnings in debug builds, thereby making it easier to read other (useful) debugging output & identify/debug real issues.
Attachment #459904 -
Flags: approval2.0?
Assignee | ||
Updated•15 years ago
|
Attachment #459915 -
Flags: approval2.0?
Comment 11•15 years ago
|
||
I'd be very much in favor of this landing soon, since it gets in the way of my personal tab-switching debugging output.
Updated•15 years ago
|
Attachment #459904 -
Flags: approval2.0? → approval2.0+
Updated•15 years ago
|
Attachment #459915 -
Flags: approval2.0? → approval2.0+
Assignee | ||
Comment 12•15 years ago
|
||
Landed.
part 1: http://hg.mozilla.org/mozilla-central/rev/7f8e309426e0
part 2: http://hg.mozilla.org/mozilla-central/rev/e2a021cf691e
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•