-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Closed
Labels
A-content/domInteracting with the DOM from web contentInteracting with the DOM from web contentC-has-manual-testcaseC-reproducedI-panicServo encounters a panic.Servo encounters a panic.
Description
Describe the bug:
I've been trying to access my website (kilonova.ro) using Servo ever since I heard of the project. However, every time I get greeted with the following failed assertion (Console output with RUST_BACKTRAGE=1):
assertion failed: window.Document().can_invoke_script() (thread Script(1,1), at components/script/dom/eventtarget.rs:400)
0: servoshell::backtrace::print
1: servoshell::main::{{closure}}
2: std::panicking::rust_panic_with_hook
3: std::panicking::begin_panic_handler::{{closure}}
4: std::sys_common::backtrace::__rust_end_short_backtrace
5: rust_begin_unwind
6: core::panicking::panic_fmt
7: core::panicking::panic
8: script::dom::eventtarget::EventTarget::dispatch_event
9: script::dom::bindings::codegen::Bindings::EventTargetBinding::EventTarget_Binding::dispatchEvent::{{closure}}
10: mozjs::panic::wrap_panic
11: script::dom::bindings::codegen::Bindings::EventTargetBinding::EventTarget_Binding::dispatchEvent
12: CallJitMethodOp
13: script::dom::bindings::utils::generic_call
14: _ZN2js23InternalCallOrConstructEP9JSContextRKN2JS8CallArgsENS_14MaybeConstructENS_10CallReasonE
15: _ZN2js9InterpretEP9JSContextRNS_8RunStateE
16: _ZN2js9RunScriptEP9JSContextRNS_8RunStateE
17: _ZN2js23InternalCallOrConstructEP9JSContextRKN2JS8CallArgsENS_14MaybeConstructENS_10CallReasonE
18: _ZN2js4CallEP9JSContextN2JS6HandleINS2_5ValueEEES5_RKNS_13AnyInvokeArgsENS2_13MutableHandleIS4_EENS_10CallReasonE
19: _Z20JS_CallFunctionValueP9JSContextN2JS6HandleIP8JSObjectEENS2_INS1_5ValueEEERKNS1_16HandleValueArrayENS1_13MutableHandleIS6_EE
20: script::dom::bindings::codegen::Bindings::FunctionBinding::Function::Call
21: script::dom::customelementregistry::CustomElementReaction::invoke
22: script::dom::element::Element::invoke_reactions
23: script::dom::customelementregistry::ElementQueue::invoke_reactions
24: script::dom::customelementregistry::CustomElementReactionStack::pop_current_element_queue
25: html5ever::tree_builder::TreeBuilder<Handle,Sink>::insert_element
26: html5ever::tree_builder::TreeBuilder<Handle,Sink>::step
27: <html5ever::tree_builder::TreeBuilder<Handle,Sink> as html5ever::tokenizer::interface::TokenSink>::process_token
28: html5ever::tokenizer::Tokenizer<Sink>::process_token
29: html5ever::tokenizer::Tokenizer<Sink>::emit_current_tag
30: html5ever::tokenizer::Tokenizer<Sink>::step
31: html5ever::tokenizer::Tokenizer<Sink>::run
32: script::dom::servoparser::Tokenizer::feed
33: script::dom::servoparser::ServoParser::do_parse_sync
34: profile_traits::time::profile
35: script::dom::servoparser::ServoParser::parse_sync
36: script::dom::document::Document::process_pending_parsing_blocking_script
37: script::dom::document::Document::finish_load
38: <script::stylesheet_loader::StylesheetContext as net_traits::FetchResponseListener>::process_response_eof
39: <net_traits::FetchResponseMsg as net_traits::Action<T>>::process
40: <script::network_listener::ListenerTask<A,Listener> as script::task::TaskOnce>::run_once
41: <T as script::task::TaskBox>::run_box
42: script::script_thread::ScriptThread::handle_msg_from_script
43: script::script_thread::ScriptThread::handle_msgs
44: profile_traits::mem::ProfilerChan::run_with_memory_reporting
45: std::sys_common::backtrace::__rust_begin_short_backtrace
46: core::ops::function::FnOnce::call_once{{vtable.shim}}
47: std::sys::pal::unix::thread::Thread::new::thread_start
48: start_thread
49: __GI___clone3
[2024-06-07T09:36:37Z ERROR servoshell] assertion failed: window.Document().can_invoke_script()To Reproduce:
- Start Servo nightly
- Go to https://kilonova.ro/
- See the error
My theory is that it must be something regarding Web Components created by preact. Here's a more isolated HTML document that shows the problem clearer:
<!DOCTYPE html>
<html>
<head>
<script>
// Boilerplate the platform's bundle expects to exist, not important
window.platform_info = { language: "en" }
</script>
<!-- The platform's javascript bundle. A map file is generated alongside it. It's generated using esbuild using files from https://github.com/KiloProjects/Kilonova/tree/master/web/assets -->
<script src="https://kilonova.ro/static/bundle.js"></script>
</head>
<body>
<h1>Reproduction example</h1>
<!-- Commenting the following line makes Servo execute normally. If uncommented, Servo crashes. -->
<kn-glossary name="stdin" content="Hello"></kn-glossary>
<!-- Boilerplate the platform's bundle expects to exist, not important -->
<div id="modals"></div>
</body>
</html>I have tried to isolate the bug even more and make a more reproducible example but failed to do so.
Platform:
OS: Fedora Linux 40 (but Fedora 39 also didn't work)
Hardware: x86_64 Ryzen 5 5600x, but I don't think it's really relevant here since it seems like a logic/JS issue
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-content/domInteracting with the DOM from web contentInteracting with the DOM from web contentC-has-manual-testcaseC-reproducedI-panicServo encounters a panic.Servo encounters a panic.