You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We should only shutdown the JS runtime (and the constellation really) only once, but the fact the constellation is hardwired to one compositor makes it difficult.
So we can either:
not shutdown the JS runtime between sessions, not sure if it's possible when the constellation and the whole world is dropped
fix the dependency on the compositor (which is an ongoing work, but will take some time) and only unload servo when the app exits
I would be fine with making the actual JS engine shutdown a build feature in rust-mozjs (enable the feature to skip this code). We could enable the feature for android builds to avoid the problem you're having.
Assertion failure: cx->runtime()->hasInitializedSelfHosting()
(Must call JS::InitSelfHostedCode() before creating a global), at mozjs_sys-0.61.2/mozjs/js/src/jsapi.cpp:1978
The point of Runtime::new is that there's one runtime per thread, so that shouldn't matter. It might be worth modifying rust-mozjs so that it only calls JS_Init once and never calls JS_ShutDown, but it still reinitializes the PARENT runtime.
Activity
paulrouget commentedon Oct 30, 2018
Failing unwrap:
servo/components/script/script_runtime.rs
Line 291 in 662fd0a
paulrouget commentedon Oct 30, 2018
Here is the
return Err(): https://github.com/servo/rust-mozjs/blob/26b270d0447557dc0ee585ee8e0db78bbe6ca399/src/rust.rs#L151paulrouget commentedon Oct 30, 2018
Well. Apparently we can't work around that: servo/rust-mozjs#442
We should only shutdown the JS runtime (and the constellation really) only once, but the fact the constellation is hardwired to one compositor makes it difficult.
So we can either:
jdm commentedon Oct 30, 2018
I would be fine with making the actual JS engine shutdown a build feature in rust-mozjs (enable the feature to skip this code). We could enable the feature for android builds to avoid the problem you're having.
paulrouget commentedon Oct 31, 2018
Getting this assertion:
paulrouget commentedon Oct 31, 2018
@jdm I skipped this block: https://github.com/servo/rust-mozjs/blob/26b270d0447557dc0ee585ee8e0db78bbe6ca399/src/rust.rs#L266-L270
paulrouget commentedon Oct 31, 2018
The change I made to rust-mozjs:
I confirm that we only go through https://github.com/servo/rust-mozjs/blob/26b270d0447557dc0ee585ee8e0db78bbe6ca399/src/rust.rs#L157-L168 once and that
InitSelfHostedCodeis called on the 2nd load.paulrouget commentedon Oct 31, 2018
Script thread logs:
paulrouget commentedon Nov 2, 2018
It might not work because
Runtime::newis called from 2 different threads?jdm commentedon Nov 6, 2018
The point of Runtime::new is that there's one runtime per thread, so that shouldn't matter. It might be worth modifying rust-mozjs so that it only calls JS_Init once and never calls JS_ShutDown, but it still reinitializes the PARENT runtime.
paulrouget commentedon Nov 13, 2018
@jdm this works: servo/rust-mozjs@master...paulrouget:initonce - but is it the way we want to go?
With this change we can load/unload Servo without any panic/asserts.
jdm commentedon Nov 13, 2018
@paulrouget That looks fine to me.
Auto merge of #22200 - paulrouget:mozjsup, r=jdm
Auto merge of servo#447 - paulrouget:initonce, r=jdm