Closed Bug 1055722 Opened 10 years ago Closed 10 years ago

"WARNING: NS_ENSURE_TRUE(content) failed: file layout/generic/nsSelection.cpp, line 4030" is way too spammy; makes up ~9% of some mochitest logs

Categories

(Core :: DOM: Selection, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla36

People

(Reporter: dholbert, Assigned: ayg)

References

()

Details

Attachments

(1 file)

Linux debug mochitest-2 logs are approximately 10% composed of instances of this one warning:
{
WARNING: NS_ENSURE_TRUE(content) failed: file /builds/slave/m-in-l64-d-0000000000000000000/build/layout/generic/nsSelection.cpp, line 4030
}


Sample log:
https://tbpl.mozilla.org/php/getParsedLog.php?id=46282743&tree=Mozilla-Inbound
Ubuntu VM 12.04 x64 mozilla-inbound debug test mochitest-2 on 2014-08-19 10:49:04 PDT for push 39830d7054c6

Line count: 67533
Lines that are this warning: 5971
This NS_ENSURE_TRUE probably just wants to be a null-check-and-early-return, given that it fails this frequently.

It actually used to be a null-check, but we changed that here, for bug 767169:
http://hg.mozilla.org/mozilla-central/diff/61070cc08413/layout/generic/nsSelection.cpp#l1.82
Depends on: 767169
Summary: "WARNING: NS_ENSURE_TRUE(content) failed: file layout/generic/nsSelection.cpp, line 4030" is way too spammy → "WARNING: NS_ENSURE_TRUE(content) failed: file layout/generic/nsSelection.cpp, line 4030" is way too spammy; makes up ~10% of some mochitest logs
Aryeh, do you remember why this changed to NS_ENSURE_STATE?  And do you have any objection to restoring it to just be a null-check-and-return?
Flags: needinfo?(ayg)
Summary: "WARNING: NS_ENSURE_TRUE(content) failed: file layout/generic/nsSelection.cpp, line 4030" is way too spammy; makes up ~10% of some mochitest logs → "WARNING: NS_ENSURE_TRUE(content) failed: file layout/generic/nsSelection.cpp, line 4030" is way too spammy; makes up ~9% of some mochitest logs
I don't know what this code is doing, so I can't say.  If it's not reasonable to call this function with an aRange whose start is not in a content node, then probably the caller(s) that are triggering this line should be fixed.  If it's reasonable to call the function and returning early is expected behavior, then it would make sense for it not to warn.
Flags: needinfo?(ayg)
Hi,

I'm interested on working on this.
It looks like code calling Selection::selectFrames() never checks its return value even if this method uses different return values.
I need to know what you choose to replace it.
smaug, do you know if this function should be warning if called with a non-content node, or is an early return without warning fine?
Flags: needinfo?(bugs)
no need to warn, but curious, does aRange->GetStartParent() return document here then?
Flags: needinfo?(bugs)
Attached patch PatchSplinter Review
Assignee: nobody → ayg
Status: NEW → ASSIGNED
Attachment #8507860 - Flags: review?(bugs)
Attachment #8507860 - Flags: review?(bugs) → review+
https://hg.mozilla.org/mozilla-central/rev/a00c8ebbd0e7
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla36
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: