Skip to content

Panic during shutdown with WebGL page (MacOS) #40399

@mukilan

Description

@mukilan

To reproduce:

  1. Launch servo
  2. Navigate to demo.servo.org and then click the "TWGL Tunnel" demo.
  3. Close servo

Bactrace:

❯ ./mach run -r                 
UNSUPPORTED (log once): POSSIBLE ISSUE: unit 1 GLD_TEXTURE_INDEX_2D is unloadable and bound to sampler type (Float) - using zero texture because texture unloadable
Should have destroyed the surface first with `destroy_surface()`! (thread main, at /Users/mukilan/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/surfman-0.10.0/src/platform/macos/system/surface.rs:76)
   0: <servoshell::backtrace::Print as core::fmt::Debug>::fmt
   1: core::fmt::write
   2: std::io::Write::write_fmt
   3: servoshell::backtrace::print
   4: servoshell::panic_hook::panic_hook
   5: std::panicking::panic_with_hook
   6: std::panicking::panic_handler::{{closure}}
   7: std::sys::backtrace::__rust_end_short_backtrace
   8: __rustc::rust_begin_unwind
   9: core::panicking::panic_fmt
  10: <surfman::platform::macos::system::surface::Surface as core::ops::drop::Drop>::drop
  11: core::ptr::drop_in_place<surfman::platform::macos::cgl::surface::Surface>
  12: <webgl::webgl_mode::inprocess::WebGLExternalImages as compositing_traits::WebRenderExternalImageApi>::unlock
  13: <compositing_traits::WebRenderExternalImageHandlers as webrender_api::image::ExternalImageHandler>::unlock
  14: webrender::renderer::Renderer::render_impl
  15: webrender::renderer::Renderer::render
  16: profile_traits::time::profile
  17: compositing::painter::Painter::render
  18: compositing::compositor::IOCompositor::render
  19: servo::webview::WebView::paint
  20: servoshell::desktop::app_state::RunningAppState::repaint_servo_if_necessary
  21: egui_glow::winit::EguiGlow::run
  22: servoshell::desktop::minibrowser::Minibrowser::update
  23: <servoshell::desktop::app::App as winit::application::ApplicationHandler<servoshell::desktop::events_loop::AppEvent>>::window_event
  24: winit::platform_impl::macos::event_loop::map_user_event::{{closure}}
  25: winit::platform_impl::macos::event_handler::EventHandler::handle_event
  26: winit::platform_impl::macos::app_state::ApplicationDelegate::handle_event
  27: winit::platform_impl::macos::app_state::ApplicationDelegate::cleared
  28: winit::platform_impl::macos::observer::control_flow_end_handler
  29: <unknown>
  30: <unknown>
  31: <unknown>
  32: <unknown>
  33: <unknown>
  34: <unknown>
  35: <unknown>
  36: <unknown>
  37: <unknown>
  38: <unknown>
  39: winit::platform_impl::macos::event_handler::EventHandler::set
  40: winit::platform_impl::macos::app_state::ApplicationDelegate::set_event_handler
  41: winit::platform_impl::macos::event_loop::EventLoop<T>::run
  42: servoshell::desktop::events_loop::EventsLoop::run_app
  43: servoshell::desktop::cli::main
  44: std::sys::backtrace::__rust_begin_short_backtrace
  45: std::rt::lang_start::{{closure}}
  46: std::rt::lang_start_internal
  47: _main
[2025-11-04T11:36:00Z ERROR servoshell::panic_hook] Should have destroyed the surface first with `destroy_surface()`!
Servo exited with non-zero status 101

I couldn't reproduce the issue when directly loading the demo (./mach run -r "https://demo.servo.org/experiments/twgl-tunnel/")

Platform:
macOS 15.6

Metadata

Metadata

Assignees

No one assigned

    Labels

    I-panicServo encounters a panic.P-macAny version of MacOS

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions