Closed Bug 1395333 Opened 2 years ago Closed 2 years ago

WARNING: NS_ENSURE_TRUE(addition) failed: file toolkit/components/places/nsNavHistoryResult.cpp

Categories

(Toolkit :: Places, defect, P3)

defect

Tracking

()

RESOLVED FIXED
mozilla57
Tracking Status
firefox55 --- wontfix
firefox56 --- wontfix
firefox57 --- fixed

People

(Reporter: MattN, Assigned: mak)

References

()

Details

Attachments

(1 file)

In the log from a debug build for bug 1388611 at https://docs.google.com/document/d/1FoBvv-9-ErmPLVpFoX1IDfv7v6WAaZipGWQLNE7XLa4/edit it was spammed with the following line around 2000 times:

> [Parent 9064] WARNING: NS_ENSURE_TRUE(addition) failed: file c:/builds/moz2_slave/m-rel-w64-d-000000000000000000/build/src/toolkit/components/places/nsNavHistoryResult.cpp, line 2500[1]

>      // The history service can tell us whether the new item should appear
>      // in the result.  We first have to construct a node for it to check.
>      RefPtr<nsNavHistoryResultNode> addition;
>      nsresult rv = history->VisitIdToResultNode(aVisitId, mOptions,
>                                                 getter_AddRefs(addition));
>      NS_ENSURE_SUCCESS(rv, rv);
>      NS_ENSURE_STATE(addition);

Is this related to the data loss of bug 1388611 or is it not really exceptional and should be less verbose?

[1] https://dxr.mozilla.org/mozilla-release/rev/710711a481286f27b81df2e4b082d48829510633/toolkit/components/places/nsNavHistoryResult.cpp#2500
Flags: needinfo?(mak77)
Not strictly related to losing data (this is view code, so in the worst case some Places view like the history sidebar is broken).

I think what happens here is
http://searchfox.org/mozilla-central/rev/51b3d67a5ec1758bd2fe7d7b6e75ad6b6b5da223/toolkit/components/places/nsNavHistory.cpp#4084

We return NS_OK but don't assign to addition, we should thus change the NS_ENSURE_STATE to simple if (!addition) return NS_OK;

Based on what I see, it should be a harmless warning.
I can fix it, even if it won't help us for the corruption.
Assignee: nobody → mak77
Flags: needinfo?(mak77)
Status: NEW → ASSIGNED
Priority: -- → P3
Comment on attachment 8903551 [details]
Bug 1395333 - Remove an unexpected warning from nsNavHistoryResult.cpp.

https://reviewboard.mozilla.org/r/175366/#review180904

Looks good.
Attachment #8903551 - Flags: review?(standard8) → review+
Pushed by mak77@bonardo.net:
https://hg.mozilla.org/integration/autoland/rev/d8a45e6819f5
Remove an unexpected warning from nsNavHistoryResult.cpp. r=standard8
https://hg.mozilla.org/mozilla-central/rev/d8a45e6819f5
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
No longer blocks: 1388611
You need to log in before you can comment on or make changes to this bug.