#48075·servo

Panic when closing second window

Author: Melchizedek6809Created Sep 14, 2026Updated Sep 15, 2026
LabelsA-gfx/renderingC-has-manual-testcaseI-panicC-has-patchA-servoshell

Describe the bug: When I open a second window and close it (either directly or by closing the last tab), servo panics.

To Reproduce:

  • Start servoshell
  • Press the "New Window" button
  • Close the newly opened tab/window
  • panic!

Platform: Arch Linux (Linux 7.2.4-arch1-2 x86_64), X11/i3, nvidia drivers (615.71.09-1).

Backtrace:

Could not make RenderingContext current: MakeCurrentFailed(NotInitialized) (thread main, at ports/servoshell/desktop/gui.rs:407)
   0: servoshell::backtrace::print
             at /home/benny/src/servo/ports/servoshell/backtrace.rs:18:5
   1: servoshell::panic_hook::panic_hook
             at /home/benny/src/servo/ports/servoshell/panic_hook.rs:40:17
   2: <servoshell::panic_hook::panic_hook as core::ops::function::Fn<(&std::panic::PanicHookInfo,)>>::call
             at /home/benny/.rustup/toolchains/1.97.1-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:79:5
   3: <alloc::boxed::Box<dyn for<'a, 'b> core::ops::function::Fn<(&'a std::panic::PanicHookInfo<'b>,), Output = ()> + core::marker::Send + core::marker::Sync> as core::ops::function::Fn<(&std::panic::PanicHookInfo,)>>::call
             at /rustc/8bab26f4f68e0e26f0bb7960be334d5b520ea452/library/alloc/src/boxed.rs:2289:9
      std::panicking::panic_with_hook
             at /rustc/8bab26f4f68e0e26f0bb7960be334d5b520ea452/library/std/src/panicking.rs:833:13
   4: std::panicking::panic_handler::{closure#0}
             at /rustc/8bab26f4f68e0e26f0bb7960be334d5b520ea452/library/std/src/panicking.rs:698:13
   5: std::sys::backtrace::__rust_end_short_backtrace::<std::panicking::panic_handler::{closure#0}, !>
             at /rustc/8bab26f4f68e0e26f0bb7960be334d5b520ea452/library/std/src/sys/backtrace.rs:182:18
   6: __rustc::rust_begin_unwind
             at /rustc/8bab26f4f68e0e26f0bb7960be334d5b520ea452/library/std/src/panicking.rs:689:5
   7: core::panicking::panic_fmt
             at /rustc/8bab26f4f68e0e26f0bb7960be334d5b520ea452/library/core/src/panicking.rs:80:14
   8: core::result::unwrap_failed
             at /rustc/8bab26f4f68e0e26f0bb7960be334d5b520ea452/library/core/src/result.rs:1867:5
   9: <core::result::Result<(), surfman::error::Error>>::expect
             at /home/benny/.rustup/toolchains/1.97.1-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:1185:23
  10: <servoshell::desktop::gui::Gui>::update
             at /home/benny/src/servo/ports/servoshell/desktop/gui.rs:407:14
  11: <servoshell::desktop::headed_window::HeadedWindow>::handle_winit_window_event
             at /home/benny/src/servo/ports/servoshell/desktop/headed_window.rs:541:17
  12: <servoshell::desktop::app::App as winit::application::ApplicationHandler<servoshell::desktop::event_loop::AppEvent>>::window_event
             at /home/benny/src/servo/ports/servoshell/desktop/app.rs:209:27
  13: winit::event_loop::dispatch_event_for_app::<servoshell::desktop::event_loop::AppEvent, servoshell::desktop::app::App>
             at /home/benny/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/winit-0.30.13/src/event_loop.rs:642:56
      <winit::event_loop::EventLoop<servoshell::desktop::event_loop::AppEvent>>::run_app::<servoshell::desktop::app::App>::{closure#0}
             at /home/benny/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/winit-0.30.13/src/event_loop.rs:265:49
  14: <&mut <winit::event_loop::EventLoop<servoshell::desktop::event_loop::AppEvent>>::run_app<servoshell::desktop::app::App>::{closure#0} as core::ops::function::FnMut<(winit::event::Event<servoshell::desktop::event_loop::AppEvent>, &winit::event_loop::ActiveEventLoop)>>::call_mut
             at /home/benny/.rustup/toolchains/1.97.1-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:298:21
  15: <&mut &mut <winit::event_loop::EventLoop<servoshell::desktop::event_loop::AppEvent>>::run_app<servoshell::desktop::app::App>::{closure#0} as core::ops::function::FnMut<(winit::event::Event<servoshell::desktop::event_loop::AppEvent>, &winit::event_loop::ActiveEventLoop)>>::call_mut
             at /home/benny/.rustup/toolchains/1.97.1-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:298:21
  16: <winit::platform_impl::linux::x11::EventLoop<servoshell::desktop::event_loop::AppEvent>>::single_iteration::<&mut &mut <winit::event_loop::EventLoop<servoshell::desktop::event_loop::AppEvent>>::run_app<servoshell::desktop::app::App>::{closure#0}>
             at /home/benny/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/winit-0.30.13/src/platform_impl/linux/x11/mod.rs:564:17
  17: <winit::platform_impl::linux::x11::EventLoop<servoshell::desktop::event_loop::AppEvent>>::poll_events_with_timeout::<&mut &mut <winit::event_loop::EventLoop<servoshell::desktop::event_loop::AppEvent>>::run_app<servoshell::desktop::app::App>::{closure#0}>
             at /home/benny/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/winit-0.30.13/src/platform_impl/linux/x11/mod.rs:505:14
  18: <winit::platform_impl::linux::x11::EventLoop<servoshell::desktop::event_loop::AppEvent>>::pump_events::<&mut <winit::event_loop::EventLoop<servoshell::desktop::event_loop::AppEvent>>::run_app<servoshell::desktop::app::App>::{closure#0}>
             at /home/benny/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/winit-0.30.13/src/platform_impl/linux/x11/mod.rs:424:18
  19: <winit::platform_impl::linux::x11::EventLoop<servoshell::desktop::event_loop::AppEvent>>::run_on_demand::<<winit::event_loop::EventLoop<servoshell::desktop::event_loop::AppEvent>>::run_app<servoshell::desktop::app::App>::{closure#0}>
             at /home/benny/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/winit-0.30.13/src/platform_impl/linux/x11/mod.rs:385:24
  20: <winit::platform_impl::linux::EventLoop<servoshell::desktop::event_loop::AppEvent>>::run_on_demand::<<winit::event_loop::EventLoop<servoshell::desktop::event_loop::AppEvent>>::run_app<servoshell::desktop::app::App>::{closure#0}>
             at /home/benny/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/winit-0.30.13/src/platform_impl/linux/mod.rs:820:61
  21: <winit::platform_impl::linux::EventLoop<servoshell::desktop::event_loop::AppEvent>>::run::<<winit::event_loop::EventLoop<servoshell::desktop::event_loop::AppEvent>>::run_app<servoshell::desktop::app::App>::{closure#0}>
             at /home/benny/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/winit-0.30.13/src/platform_impl/linux/mod.rs:813:14
  22: <winit::event_loop::EventLoop<servoshell::desktop::event_loop::AppEvent>>::run_app::<servoshell::desktop::app::App>
             at /home/benny/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/winit-0.30.13/src/event_loop.rs:265:25
  23: <servoshell::desktop::event_loop::ServoShellEventLoop>::run_app
             at /home/benny/src/servo/ports/servoshell/desktop/event_loop.rs:82:22
  24: servoshell::desktop::cli::main
             at /home/benny/src/servo/ports/servoshell/desktop/cli.rs:53:20
  25: servoshell::main
             at /home/benny/src/servo/ports/servoshell/lib.rs:41:5
  26: servoshell::main
             at /home/benny/src/servo/ports/servoshell/main.rs:36:13
  27: <fn() as core::ops::function::FnOnce<()>>::call_once
             at /home/benny/.rustup/toolchains/1.97.1-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:250:5
  28: std::sys::backtrace::__rust_begin_short_backtrace::<fn(), ()>
             at /home/benny/.rustup/toolchains/1.97.1-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/backtrace.rs:166:18
  29: std::rt::lang_start::<()>::{closure#0}
             at /home/benny/.rustup/toolchains/1.97.1-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/rt.rs:206:18
  30: <&dyn core::ops::function::Fn<(), Output = i32> + core::panic::unwind_safe::RefUnwindSafe + core::marker::Sync as core::ops::function::FnOnce<()>>::call_once
             at /rustc/8bab26f4f68e0e26f0bb7960be334d5b520ea452/library/core/src/ops/function.rs:287:21
      std::panicking::catch_unwind::do_call::<&dyn core::ops::function::Fn<(), Output = i32> + core::panic::unwind_safe::RefUnwindSafe + core::marker::Sync, i32>
             at /rustc/8bab26f4f68e0e26f0bb7960be334d5b520ea452/library/std/src/panicking.rs:581:40
      std::panicking::catch_unwind::<i32, &dyn core::ops::function::Fn<(), Output = i32> + core::panic::unwind_safe::RefUnwindSafe + core::marker::Sync>
             at /rustc/8bab26f4f68e0e26f0bb7960be334d5b520ea452/library/std/src/panicking.rs:544:19
      std::panic::catch_unwind::<&dyn core::ops::function::Fn<(), Output = i32> + core::panic::unwind_safe::RefUnwindSafe + core::marker::Sync, i32>
             at /rustc/8bab26f4f68e0e26f0bb7960be334d5b520ea452/library/std/src/panic.rs:359:14
      std::rt::lang_start_internal::{closure#0}
             at /rustc/8bab26f4f68e0e26f0bb7960be334d5b520ea452/library/std/src/rt.rs:175:24
      std::panicking::catch_unwind::do_call::<std::rt::lang_start_internal::{closure#0}, isize>
             at /rustc/8bab26f4f68e0e26f0bb7960be334d5b520ea452/library/std/src/panicking.rs:581:40
      std::panicking::catch_unwind::<isize, std::rt::lang_start_internal::{closure#0}>
             at /rustc/8bab26f4f68e0e26f0bb7960be334d5b520ea452/library/std/src/panicking.rs:544:19
      std::panic::catch_unwind::<std::rt::lang_start_internal::{closure#0}, isize>
             at /rustc/8bab26f4f68e0e26f0bb7960be334d5b520ea452/library/std/src/panic.rs:359:14
      std::rt::lang_start_internal
             at /rustc/8bab26f4f68e0e26f0bb7960be334d5b520ea452/library/std/src/rt.rs:171:5
  31: std::rt::lang_start::<()>
             at /home/benny/.rustup/toolchains/1.97.1-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/rt.rs:205:5
  32: main
  33: <unknown>
  34: __libc_start_main
  35: _start
[2026-09-14T15:16:45Z ERROR servoshell::panic_hook] Could not make RenderingContext current: MakeCurrentFailed(NotInitialized)
mozilla::detail::MutexImpl::~MutexImpl: pthread_mutex_destroy failed: Device or resource busy
Caught signal 11 in thread "main"
   0: servoshell::backtrace::print
             at /home/benny/src/servo/ports/servoshell/backtrace.rs:18:5
   1: servoshell::crash_handler::install::handler
             at /home/benny/src/servo/ports/servoshell/crash_handler.rs:38:21
   2: <servoshell::crash_handler::install::handler as core::ops::function::Fn<(&libc::unix::linux_like::linux::gnu::b64::x86_64::siginfo_t,)>>::call
             at /home/benny/.rustup/toolchains/1.97.1-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:79:5
   3: signal_hook_registry::handler
             at /home/benny/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/signal-hook-registry-1.4.8/src/lib.rs:416:13
   4: <unknown>
   5: _ZN7mozilla6detail9MutexImplD1Ev
   6: <unknown>
   7: exit
   8: <unknown>
   9: __libc_start_main
  10: _start