Skip to content

panic: internal error: entered unreachable code (at components/script/dom/range.rs:1142) #40719

@fred-wang

Description

@fred-wang

Minimal testcase:

<!DOCTYPE html>
<script>
  let pi =
      document.createProcessingInstruction("xml-stylesheet",
					   'href="mycss.css" type="text/css"');
  let range = document.createRange();
  range.setEnd(pi, 0)
  range.createContextualFragment("<div>A</div>");
</script>

System: Linux
Version: Version: Servo 0.0.2-cc4c762a7
Command: ./servo/servo

internal error: entered unreachable code (thread Script(1,1), at components/script/dom/range.rs:1142)
   0: servoshell::backtrace::print
   1: servoshell::panic_hook::panic_hook
   2: std::panicking::panic_with_hook
   3: std::panicking::panic_handler::{{closure}}
   4: std::sys::backtrace::__rust_end_short_backtrace
   5: __rustc::rust_begin_unwind
   6: core::panicking::panic_fmt
   7: core::panicking::panic
   8: script_bindings::codegen::GenericBindings::RangeBinding::Range_Binding::createContextualFragment::{{closure}}
   9: mozjs::panic::wrap_panic
  10: script_bindings::codegen::GenericBindings::RangeBinding::Range_Binding::createContextualFragment
  11: CallJitMethodOp
  12: script_bindings::utils::generic_call
  13: script_bindings::utils::generic_method
  14: _ZN2js23InternalCallOrConstructEP9JSContextRKN2JS8CallArgsENS_14MaybeConstructENS_10CallReasonE
  15: _ZN2js9InterpretEP9JSContextRNS_8RunStateE
  16: _ZN2js9RunScriptEP9JSContextRNS_8RunStateE
  17: _ZN2js7ExecuteEP9JSContextN2JS6HandleIP8JSScriptEENS3_IP8JSObjectEENS2_13MutableHandleINS2_5ValueEEE
  18: _Z16JS_ExecuteScriptP9JSContextN2JS6HandleIP8JSScriptEENS1_13MutableHandleINS1_5ValueEEE
  19: script::dom::globalscope::GlobalScope::evaluate_script_on_global_with_result
  20: script::dom::globalscope::GlobalScope::run_a_classic_script
  21: script::dom::html::htmlscriptelement::HTMLScriptElement::execute
  22: script::dom::html::htmlscriptelement::HTMLScriptElement::prepare
  23: script::dom::servoparser::ServoParser::parse_sync
  24: script::dom::servoparser::ServoParser::parse_bytes_chunk
  25: script::dom::servoparser::ParserContext::load_document
  26: <script::dom::servoparser::ParserContext as script::network_listener::FetchResponseListener>::process_response_eof
  27: script::script_thread::ScriptThread::handle_msg_from_script
  28: script::script_thread::ScriptThread::handle_msgs::{{closure}}
  29: script::script_thread::ScriptThread::handle_msgs
  30: std::sys::backtrace::__rust_begin_short_backtrace
  31: core::ops::function::FnOnce::call_once{{vtable.shim}}
  32: std::sys::thread::unix::Thread::new::thread_start
  33: start_thread
             at ./nptl/pthread_create.c:447:8
  34: clone3
             at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:78:0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions