~15,000 instances of 'NS_ENSURE_SUCCESS(EnsureScriptEnvironment(), nullptr) failed with result 0x80040111' emitted from docshell/base/nsDocShell.cpp during linux64 debug testing

RESOLVED FIXED in Firefox 42

Status

()

RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: erahm, Assigned: erahm)

Tracking

(Blocks: 1 bug)

unspecified
mozilla42
Points:
---

Firefox Tracking Flags

(firefox42 fixed)

Details

Attachments

(1 attachment)

(Assignee)

Description

3 years ago
> 14754 [NNNNN] WARNING: NS_ENSURE_SUCCESS(EnsureScriptEnvironment(), nullptr) failed with result 0x80040111: file docshell/base/nsDocShell.cpp, line 4607

0x80040111 is NS_ERROR_NOT_AVAILABLE. This warning [1] is rather widespread across tests, it is most frequent during mochitest-browser-chrome-2, a few more verbose tests:
> 97 warnings from test browser/components/sessionstore/test/browser_354894_perwindowpb.js
> 76 warnings from test browser/components/sessionstore/test/browser_522545.js
> 48 warnings from test browser/components/downloads/test/browser/browser_iframe_gone_mid_download.js

It looks like this can happen if |mIsBeingDestroyed| is true [2] or if |do_GetInterface(mTreeOwner)| fails [3]. Given the frequency of this warning it seems like we should just remove it (or possibly move it to |EnsureScriptEnvironment| where we can get a better idea of what is actually failing).

[1] https://hg.mozilla.org/mozilla-central/annotate/02f640a72dcd/docshell/base/nsDocShell.cpp#l4607
[2] https://hg.mozilla.org/mozilla-central/annotate/0b2f5e8b7be5/docshell/base/nsDocShell.cpp#l12780
[3] https://hg.mozilla.org/mozilla-central/annotate/0b2f5e8b7be5/docshell/base/nsDocShell.cpp#l12795
(Assignee)

Comment 1

3 years ago
Created attachment 8626364 [details] [diff] [review]
Stop warning if EnsureScriptEnvironment returns NS_ERROR_NOT_AVAILABLE

Note: This is the most verbose warning during linux64 debug testing.
Attachment #8626364 - Flags: review?(bugs)
(Assignee)

Updated

3 years ago
Assignee: nobody → erahm
Status: NEW → ASSIGNED
Comment on attachment 8626364 [details] [diff] [review]
Stop warning if EnsureScriptEnvironment returns NS_ERROR_NOT_AVAILABLE

I don't think it is useful to warn ever.
So just 

return NS_SUCCEEDED(EnsureScriptEnvironment()) ? mScriptGlobal : nullptr;

Or even
EnsureScriptEnvironment();
return mScriptGlobal;

But I think I'd prefer the first one.
Attachment #8626364 - Flags: review?(bugs) → review+
(Assignee)

Comment 3

3 years ago
(In reply to Olli Pettay [:smaug] from comment #2)
> Comment on attachment 8626364 [details] [diff] [review]
> Stop warning if EnsureScriptEnvironment returns NS_ERROR_NOT_AVAILABLE
> 
> I don't think it is useful to warn ever.
> So just 
> 
> return NS_SUCCEEDED(EnsureScriptEnvironment()) ? mScriptGlobal : nullptr;
> 
> Or even
> EnsureScriptEnvironment();
> return mScriptGlobal;
> 
> But I think I'd prefer the first one.

Thanks for the quick review! I'll update to use the tristate.
(Assignee)

Updated

3 years ago
Blocks: 765224
https://hg.mozilla.org/mozilla-central/rev/63543a32a11d
Status: ASSIGNED → RESOLVED
Last Resolved: 3 years ago
status-firefox42: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla42
You need to log in before you can comment on or make changes to this bug.