Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upcrash in ScriptThread loading vimeo player #26930
Closed
Comments
|
|
The incumbent_global argument we're getting for enqueue_promise_job is null, which is surprising. I'm going to make a debug mozjs build to try and figure out why that's happening. |
|
This diff avoids the problem but I'm not yet convinced that it's the correct thing to do: diff --git a/components/script/script_runtime.rs b/components/script/script_runtime.rs
index 4cf2055c64..a0a771941b 100644
--- a/components/script/script_runtime.rs
+++ b/components/script/script_runtime.rs
@@ -206,7 +206,12 @@ unsafe extern "C" fn enqueue_promise_job(
let mut result = false;
wrap_panic(&mut || {
let microtask_queue = &*(extra as *const MicrotaskQueue);
- let global = GlobalScope::from_object(incumbent_global.get());
+ let global = if !incumbent_global.is_null() {
+ GlobalScope::from_object(incumbent_global.get())
+ } else {
+ let realm = AlreadyInRealm::assert_for_cx(cx);
+ GlobalScope::from_context(*cx, InRealm::in_realm(&realm))
+ };
let pipeline = global.pipeline_id();
let interaction = if promise.get().is_null() {
PromiseUserInputEventHandlingState::DontCare |
|
We get into this situation from https://github.com/servo/mozjs/blob/aabcc9ba889b2755f1e4e83f28323a60415a790f/mozjs/js/src/builtin/Promise.cpp#L3025, so my patch looks reasonable to me. |
bors-servo
added a commit
that referenced
this issue
Jun 16, 2020
Fix panic on vimeo.com The only time we end up enqueuing a promise reaction job with a null incumbent global argument is when SpiderMonkey does some weird stuff behind the scenes for its JS Debugger support (based on https://searchfox.org/mozilla-central/rev/2c1092dc68c63f7bad6da6a03c5883a5ab5ff2ca/js/src/builtin/Promise.cpp#3168). This commit works around that case and adds a regression test so we don't forget about that in the future. --- - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #26930 - [x] There are tests for these changes
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Config:
Servo CI build macOS 0.0.1-d43f8ee792
macOS 10.15.5 (19F101)