Crash in xpc::NativeGlobal
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
People
(Reporter: ting, Assigned: jonco)
References
(Regression, )
Details
(Keywords: crash, regression)
Crash Data
Attachments
(1 file)
47 bytes,
text/x-phabricator-request
|
RyanVM
:
approval-mozilla-beta+
RyanVM
:
approval-mozilla-esr68+
|
Details | Review |
Comment 1•8 years ago
|
||
Comment 2•8 years ago
|
||
Comment 3•8 years ago
|
||
Comment 4•8 years ago
|
||
Comment 5•8 years ago
|
||
Comment 6•8 years ago
|
||
Comment 7•8 years ago
|
||
Comment 8•8 years ago
|
||
Comment hidden (typo) |
Comment 10•8 years ago
|
||
Comment 11•7 years ago
|
||
Updated•7 years ago
|
Comment 12•6 years ago
|
||
Comment 13•6 years ago
|
||
Comment 14•5 years ago
|
||
Bughunter can reproduce on Windows with http://auravault.com/
Firefox 72.0.1 : bp-d3426af3-4b37-466b-bf98-e8ec40200109
Nightly opt crashes but it fails to submit the crash report.
Comment 15•5 years ago
|
||
Bob, thank you! That site reproduces for me in a debug m-c build as well, and I have an rr trace. Debugging now.
Comment 16•5 years ago
|
||
So the basic issue (and for my future reference this is the "firefox-860" rr trace locally) is that we are doing this in ScriptLoader::FinishDynamicImport
:
989 MOZ_ALWAYS_TRUE(jsapi.Init(aRequest->mDynamicPromise));
but aRequest->mDynamicPromise
is null. In a debug build this crashes when it tries to assert !js::IsCrossCompartmentWrapper
at the top of AutoJSAPI::Init
, while in an opt build it would then pass null to xpc::NativeGlobal
and crash somewhere in there. Crashing on the obj = JS::GetNonCCWObjectGlobal(obj);
line totally makes sense in that case. Note that this is not the same crash location as earlier in the bug, but maybe crashreporter was messing things up back then.
Anyway, looking at the reports in crashreporter, all the recent ones are coming via ScriptLoader::FinishDynamicImport
. That code dates back to bug 1342012, which is much newer than this bug report. Chances are, a new bug should have been filed instead of reopening this one, but here we are...
Anyway, In ScriptLoader::FinishDynamicImport
we have aResult == NS_BINDING_ABORTED
, so the dynamic import got canceled (e.g. by the user hitting stop, or navigating away from the page or whatever).
And the reason the promise is null is that we cleared it out by calling FinishDynamicImport
from ScriptLoader::ParsingComplete
, because aTerminated
was true. So we're ending up calling FinishDynamicImport
twice for the same ModuleLoadRequest
and that blows up.
Presumably we should either stop canceling things in ScriptLoader::ParsingComplete
or handle the case when they were canceled there in later callsites to FinishDynamicImport
or in FinishDynamicImport
itself.
Comment 17•5 years ago
|
||
e.g. by the user hitting stop, or navigating away from the page or whatever
And since I know I did none of those things, more likely by the iframe involved being removed from the DOM or the page calling window.stop()
on it. Which happened before parsing completed, given the rest of the debugging info.
Comment 18•5 years ago
|
||
https://pernos.co/debug/R5l4wBNaRDUpvwG4zaWn4w/index.html#f{m[BjdG,AQsm_,t[iw,Q6E_,f{e[BjdG,AQsZ_,s{abG1yFwAA,bAYk,oD/ixFA,uD+1UwA___ is this crash in pernosco: the two notebook entries correspond to the two calls to ScriptLoader::FinishDynamicImport
Updated•5 years ago
|
Assignee | ||
Comment 19•5 years ago
|
||
(In reply to Boris Zbarsky [:bzbarsky, bz on IRC] from comment #18)
Thanks for debugging this.
I think we need to clear the list of dynamic import requests in ScriptLoader::ParsingComplete when aTerminated is true, like we do for all the other kinds of requests.
I wasn't able to write a crashtest for this. Using window.stop() works, but makes the test harness hang waiting for the load event to fire. I couldn't get a version to work using iframes.
Assignee | ||
Comment 20•5 years ago
|
||
Comment 21•5 years ago
|
||
I think we need to clear the list of dynamic import requests in ScriptLoader::ParsingComplete when aTerminated is true, like we do for all the other kinds of requests.
It's not entirely clear to me that we really need to clear anything there, but OK.
Using window.stop() works, but makes the test harness hang waiting for the load event to fire
Did you call stop()
on a toplevel window, or on a subframe that contained the dynamic module load?
I couldn't get a version to work using iframes.
The crashing site is crashing because it navigates a subframe with a pending dynamic module load, right? Did that not reproduce the crash in our test harness?
Assignee | ||
Comment 22•5 years ago
|
||
(In reply to Boris Zbarsky [:bzbarsky, bz on IRC] from comment #21)
It turns out I didn't understand how to do iframes properly. window.stop() in an iframe does work. I'll update the patch.
Comment 23•5 years ago
|
||
Comment 24•5 years ago
|
||
bugherder |
Updated•5 years ago
|
Comment 25•5 years ago
|
||
Initial Nightly data is looking good so far. What do you think about nominating this for Beta and ESR approval, Jon?
Assignee | ||
Comment 26•5 years ago
|
||
Comment on attachment 9120445 [details]
Bug 1291535 - Clear the list of dynamic import requests after cancelling them in ScriptLoader::ParsingComplete as we do for other requests r?bzbarsky
Beta/Release Uplift Approval Request
- User impact if declined: Possible crash when using import() in some situations.
- Is this code covered by automated tests?: Yes
- Has the fix been verified in Nightly?: Yes
- Needs manual test from QE?: No
- If yes, steps to reproduce:
- List of other uplifts needed: None
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): This is a small and simple change and is covered by tests.
- String changes made/needed:
ESR Uplift Approval Request
- If this is not a sec:{high,crit} bug, please state case for ESR consideration: This fixes a crash.
- User impact if declined: Possible crash when using import() in some situations.
- Fix Landed on Version: 74
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): This is a small and simple change and is covered by tests.
- String or UUID changes made by this patch:
Comment 27•5 years ago
|
||
Comment on attachment 9120445 [details]
Bug 1291535 - Clear the list of dynamic import requests after cancelling them in ScriptLoader::ParsingComplete as we do for other requests r?bzbarsky
Fixes a lingering crash with dynamic module imports. Approved for 73.0b8 and 68.5esr.
Comment 28•5 years ago
|
||
bugherder uplift |
Comment 29•5 years ago
|
||
bugherder uplift |
Updated•3 years ago
|
Description
•