bevyengine/bevy

Winit panics in AppState::clear_callback

Closed this issue · 1 comments

msvbg commented

Bevy version

0.13.0

Relevant system information

rustc version: rustc 1.78.0-nightly (bccb9bbb4 2024-02-16)
OS: macOS 14.3

AdapterInfo { name: "Apple M3 Max", vendor: 0, device: 0, device_type: IntegratedGpu, driver: "", driver_info: "", backend: Metal }

What you did

I don't know what I did. This error is not reproducible and I've only seen it once.

What went wrong

The Bevy app randomly crashed after having run without problems for a minute or so.

Additional information

thread 'main' panicked at /Users/martin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.10/src/platform_impl/macos/app_state.rs:387:33:
called `Result::unwrap()` on an `Err` value: PoisonError { .. }
stack backtrace:
   0: _rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::result::unwrap_failed
   3: winit::platform_impl::platform::app_state::AppState::clear_callback
   4: winit::platform_impl::platform::event_loop::EventLoop<T>::run_on_demand
   5: bevy_winit::winit_runner
   6: core::ops::function::FnOnce::call_once{{vtable.shim}}
   7: bevy_app::app::App::run
   8: game::run
   9: glade::main
  10: core::ops::function::FnOnce::call_once

The relevant line in winit is this: https://github.com/rust-windowing/winit/blob/dbeeaeffd982b18e2ecddb572e000bdaaf5b7e99/src/platform_impl/macos/app_state.rs#L386-L388

msvbg commented

Ah, I now see that there was another panic before this one which probably caused this. Though that would imply some sort of panic recovery along the way, or can two threads panic at the same time? Closing this for now.