Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash when changing a viewport aspect, that requires window recreation #3959

Closed
AnotherNathan opened this issue Feb 3, 2024 · 3 comments · Fixed by #4862
Closed

Crash when changing a viewport aspect, that requires window recreation #3959

AnotherNathan opened this issue Feb 3, 2024 · 3 comments · Fixed by #4862
Labels
crash crash, panic, segfault, freeze, … egui_glow Relates to running egui_glow on native native-windows Running on native Windows OS viewports multiple viewports, viewports API

Comments

@AnotherNathan
Copy link
Contributor

Description
When changing something on a viewport, that requires the recreation of the viewport window in order to apply the change, the application crashes.

I have only observed it on the glow backend, since the wgpu crashes immediately for me.

Sometimes I am getting a stack trace with a handle error and other times the application simply closes without any additional output.

The provided example changes, whether the viewport should show the close button or not (which internally requires the recreation of the viewport window).

Stacktrace
thread 'main' panicked at C:\Users\Nathan\.cargo\git\checkouts\egui-5e4507fa4153be06\114f820\crates\eframe\src\native\glow_integration.rs:815:69: 
called `Result::unwrap()` on an `Err` value: Error { raw_code: Some(6), raw_os_message: Some("Das Handle ist ungültig. (os error 6)"), kind: Misc }
stack backtrace:
   0: std::panicking::begin_panic_handler
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library\std\src\panicking.rs:645
   1: core::panicking::panic_fmt
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library\core\src\panicking.rs:72
   2: core::result::unwrap_failed
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library\core\src\result.rs:1653
   3: enum2$<core::result::Result<enum2$<glutin::context::PossiblyCurrentContext>,glutin::error::Error> >::unwrap<enum2$<glutin::context::PossiblyCurrentContext>,glutin::error::Error>
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112\library\core\src\result.rs:1077
   4: eframe::native::glow_integration::change_gl_context
             at C:\Users\Nathan\.cargo\git\checkouts\egui-5e4507fa4153be06\114f820\crates\eframe\src\native\glow_integration.rs:815
   5: eframe::native::glow_integration::GlowWinitRunning::run_ui_and_paint
             at C:\Users\Nathan\.cargo\git\checkouts\egui-5e4507fa4153be06\114f820\crates\eframe\src\native\glow_integration.rs:621
   6: eframe::native::glow_integration::impl$1::run_ui_and_paint
             at C:\Users\Nathan\.cargo\git\checkouts\egui-5e4507fa4153be06\114f820\crates\eframe\src\native\glow_integration.rs:402
   7: eframe::native::run::run_and_return::closure$0<eframe::native::glow_integration::GlowWinitApp>
             at C:\Users\Nathan\.cargo\git\checkouts\egui-5e4507fa4153be06\114f820\crates\eframe\src\native\run.rs:99
   8: winit::platform_impl::platform::event_loop::impl$3::run_on_demand::closure$0<enum2$<eframe::native::winit_integration::UserEvent>,eframe::native::run::run_and_return::closure_env$0<eframe::native::glow_integration::GlowWinitApp> >
             at C:\Users\Nathan\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winit-0.29.10\src\platform_impl\windows\event_loop.rs:236
   9: alloc::boxed::impl$48::call_mut<tuple$<enum2$<winit::event::Event<enum2$<eframe::native::winit_integration::UserEvent> > > >,dyn$<core::ops::function::FnMut<tuple$<enum2$<winit::event::Event<enum2$<eframe::native::winit_integration::UserEvent> > > >,assoc
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112\library\alloc\src\boxed.rs:2014
  10: winit::platform_impl::platform::event_loop::runner::impl$3::call_event_handler::closure$0<enum2$<eframe::native::winit_integration::UserEvent> >
             at C:\Users\Nathan\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winit-0.29.10\src\platform_impl\windows\event_loop\runner.rs:250
  11: core::panic::unwind_safe::impl$23::call_once<tuple$<>,winit::platform_impl::platform::event_loop::runner::impl$3::call_event_handler::closure_env$0<enum2$<eframe::native::winit_integration::UserEvent> > >
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112\library\core\src\panic\unwind_safe.rs:272
  12: std::panicking::try::do_call<core::panic::unwind_safe::AssertUnwindSafe<winit::platform_impl::platform::event_loop::runner::impl$3::call_event_handler::closure_env$0<enum2$<eframe::native::winit_integration::UserEvent> > >,tuple$<> >
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112\library\std\src\panicking.rs:552
  13: glutin::api::wgl::surface::impl$2::resize<glutin::surface::WindowSurface>
  14: std::panicking::try<tuple$<>,core::panic::unwind_safe::AssertUnwindSafe<winit::platform_impl::platform::event_loop::runner::impl$3::call_event_handler::closure_env$0<enum2$<eframe::native::winit_integration::UserEvent> > > >
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112\library\std\src\panicking.rs:516
  15: std::panic::catch_unwind<core::panic::unwind_safe::AssertUnwindSafe<winit::platform_impl::platform::event_loop::runner::impl$3::call_event_handler::closure_env$0<enum2$<eframe::native::winit_integration::UserEvent> > >,tuple$<> >
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112\library\std\src\panic.rs:142
  16: winit::platform_impl::platform::event_loop::runner::EventLoopRunner<enum2$<eframe::native::winit_integration::UserEvent> >::catch_unwind<enum2$<eframe::native::winit_integration::UserEvent>,tuple$<>,winit::platform_impl::platform::event_loop::runner::impl
             at C:\Users\Nathan\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winit-0.29.10\src\platform_impl\windows\event_loop\runner.rs:183
  17: winit::platform_impl::platform::event_loop::runner::EventLoopRunner<enum2$<eframe::native::winit_integration::UserEvent> >::call_event_handler<enum2$<eframe::native::winit_integration::UserEvent> >
             at C:\Users\Nathan\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winit-0.29.10\src\platform_impl\windows\event_loop\runner.rs:246
  18: winit::platform_impl::platform::event_loop::runner::EventLoopRunner<enum2$<eframe::native::winit_integration::UserEvent> >::send_event<enum2$<eframe::native::winit_integration::UserEvent> >
             at C:\Users\Nathan\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winit-0.29.10\src\platform_impl\windows\event_loop\runner.rs:224
  19: winit::platform_impl::platform::event_loop::WindowData<enum2$<eframe::native::winit_integration::UserEvent> >::send_event<enum2$<eframe::native::winit_integration::UserEvent> >
             at C:\Users\Nathan\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winit-0.29.10\src\platform_impl\windows\event_loop.rs:112
  20: winit::platform_impl::platform::event_loop::public_window_callback_inner::closure$4<enum2$<eframe::native::winit_integration::UserEvent> >
             at C:\Users\Nathan\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winit-0.29.10\src\platform_impl\windows\event_loop.rs:1145
  21: core::ops::function::FnOnce::call_once<winit::platform_impl::platform::event_loop::public_window_callback_inner::closure_env$4<enum2$<eframe::native::winit_integration::UserEvent> >,tuple$<> >
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112\library\core\src\ops\function.rs:250
  22: core::panic::unwind_safe::impl$23::call_once<tuple$<>,winit::platform_impl::platform::event_loop::public_window_callback_inner::closure_env$4<enum2$<eframe::native::winit_integration::UserEvent> > >
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112\library\core\src\panic\unwind_safe.rs:272
  23: std::panicking::try::do_call<core::panic::unwind_safe::AssertUnwindSafe<winit::platform_impl::platform::event_loop::public_window_callback_inner::closure_env$4<enum2$<eframe::native::winit_integration::UserEvent> > >,tuple$<> >
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112\library\std\src\panicking.rs:552
  24: glutin::api::wgl::surface::impl$2::resize<glutin::surface::WindowSurface>
  25: std::panicking::try<tuple$<>,core::panic::unwind_safe::AssertUnwindSafe<winit::platform_impl::platform::event_loop::public_window_callback_inner::closure_env$4<enum2$<eframe::native::winit_integration::UserEvent> > > >
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112\library\std\src\panicking.rs:516
  26: std::panic::catch_unwind<core::panic::unwind_safe::AssertUnwindSafe<winit::platform_impl::platform::event_loop::public_window_callback_inner::closure_env$4<enum2$<eframe::native::winit_integration::UserEvent> > >,tuple$<> >
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112\library\std\src\panic.rs:142
  27: winit::platform_impl::platform::event_loop::runner::EventLoopRunner<enum2$<eframe::native::winit_integration::UserEvent> >::catch_unwind<enum2$<eframe::native::winit_integration::UserEvent>,tuple$<>,winit::platform_impl::platform::event_loop::public_windo
             at C:\Users\Nathan\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winit-0.29.10\src\platform_impl\windows\event_loop\runner.rs:183
  28: winit::platform_impl::platform::event_loop::public_window_callback_inner<enum2$<eframe::native::winit_integration::UserEvent> >
             at C:\Users\Nathan\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winit-0.29.10\src\platform_impl\windows\event_loop.rs:2286
  29: winit::platform_impl::platform::event_loop::public_window_callback<enum2$<eframe::native::winit_integration::UserEvent> >
             at C:\Users\Nathan\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winit-0.29.10\src\platform_impl\windows\event_loop.rs:984
  30: CallWindowProcW
  31: DispatchMessageW
  32: SendMessageTimeoutW
  33: KiUserCallbackDispatcher
  34: NtUserDispatchMessage
  35: DispatchMessageW
  36: winit::platform_impl::platform::event_loop::EventLoop<enum2$<eframe::native::winit_integration::UserEvent> >::dispatch_peeked_messages<enum2$<eframe::native::winit_integration::UserEvent> >
             at C:\Users\Nathan\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winit-0.29.10\src\platform_impl\windows\event_loop.rs:449
  37: winit::platform_impl::platform::event_loop::EventLoop<enum2$<eframe::native::winit_integration::UserEvent> >::run_on_demand<enum2$<eframe::native::winit_integration::UserEvent>,eframe::native::run::run_and_return::closure_env$0<eframe::native::glow_integr
             at C:\Users\Nathan\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winit-0.29.10\src\platform_impl\windows\event_loop.rs:247
  38: winit::platform::run_on_demand::impl$0::run_on_demand<enum2$<eframe::native::winit_integration::UserEvent>,eframe::native::run::run_and_return::closure_env$0<eframe::native::glow_integration::GlowWinitApp> >
             at C:\Users\Nathan\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winit-0.29.10\src\platform\run_on_demand.rs:80
  39: eframe::native::run::run_and_return<eframe::native::glow_integration::GlowWinitApp>
             at C:\Users\Nathan\.cargo\git\checkouts\egui-5e4507fa4153be06\114f820\crates\eframe\src\native\run.rs:76
  40: eframe::native::run::run_glow::closure$0
             at C:\Users\Nathan\.cargo\git\checkouts\egui-5e4507fa4153be06\114f820\crates\eframe\src\native\run.rs:394
  41: eframe::native::run::with_event_loop::closure$0<enum2$<core::result::Result<tuple$<>,enum2$<eframe::Error> > >,eframe::native::run::run_glow::closure_env$0>
             at C:\Users\Nathan\.cargo\git\checkouts\egui-5e4507fa4153be06\114f820\crates\eframe\src\native\run.rs:58
  42: std::thread::local::LocalKey<core::cell::RefCell<enum2$<core::option::Option<winit::event_loop::EventLoop<enum2$<eframe::native::winit_integration::UserEvent> > > > > >::try_with<core::cell::RefCell<enum2$<core::option::Option<winit::event_loop::EventLoop      
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112\library\std\src\thread\local.rs:270
  43: std::thread::local::LocalKey<core::cell::RefCell<enum2$<core::option::Option<winit::event_loop::EventLoop<enum2$<eframe::native::winit_integration::UserEvent> > > > > >::with<core::cell::RefCell<enum2$<core::option::Option<winit::event_loop::EventLoop<enu      
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112\library\std\src\thread\local.rs:246
  44: eframe::native::run::with_event_loop<enum2$<core::result::Result<tuple$<>,enum2$<eframe::Error> > >,eframe::native::run::run_glow::closure_env$0>
             at C:\Users\Nathan\.cargo\git\checkouts\egui-5e4507fa4153be06\114f820\crates\eframe\src\native\run.rs:48
  45: eframe::native::run::run_glow
             at C:\Users\Nathan\.cargo\git\checkouts\egui-5e4507fa4153be06\114f820\crates\eframe\src\native\run.rs:392
  46: eframe::run_native
             at C:\Users\Nathan\.cargo\git\checkouts\egui-5e4507fa4153be06\114f820\crates\eframe\src\lib.rs:262
  47: egui_window_recreate_bug::main
             at .\src\main.rs:11
  48: core::ops::function::FnOnce::call_once<void (*)(),tuple$<> >
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112\library\core\src\ops\function.rs:250
  49: core::hint::black_box
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112\library\core\src\hint.rs:286

Steps to reproduce the behaviour

  • run the provided example
  • click the checkbox on the main window
  • observe the crash

Platform

  • Windows 10
  • RX7600 driver version 23.12.1

Example
egui_window_recreate_bug.zip

@AnotherNathan AnotherNathan added the bug Something is broken label Feb 3, 2024
@emilk emilk added egui_glow Relates to running egui_glow on native native-windows Running on native Windows OS viewports multiple viewports, viewports API crash crash, panic, segfault, freeze, … and removed bug Something is broken labels Feb 5, 2024
@emilk
Copy link
Owner

emilk commented Feb 5, 2024

What happens if you use the wgpu backend of eframe instead?

@AnotherNathan
Copy link
Contributor Author

It crashes directly on startup on an unwrap within wgpu.

Stacktrace
thread 'main' panicked at C:\Users\Nathan\.cargo\registry\src\index.crates.io-6f17d22bba15001f\wgpu-core-0.19.0\src\instance.rs:521:39:
called `Option::unwrap()` on a `None` value
stack backtrace:
   0: std::panicking::begin_panic_handler
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library\std\src\panicking.rs:645
   1: core::panicking::panic_fmt
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library\core\src\panicking.rs:72
   2: core::panicking::panic
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library\core\src\panicking.rs:127
   3: enum2$<core::option::Option<enum2$<core::result::Result<wgpu_core::any_surface::AnySurface,wgpu_hal::InstanceError> > > >::unwrap<enum2$<core::result::Result<wgpu_core::any_surface::AnySurface,wgpu_hal::InstanceError> > >
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112\library\core\src\option.rs:931
   4: wgpu_core::global::Global<wgpu_core::identity::IdentityManagerFactory>::instance_create_surface<wgpu_core::identity::IdentityManagerFactory>
             at C:\Users\Nathan\.cargo\registry\src\index.crates.io-6f17d22bba15001f\wgpu-core-0.19.0\src\instance.rs:521
   5: wgpu::backend::wgpu_core::impl$7::instance_create_surface
             at C:\Users\Nathan\.cargo\registry\src\index.crates.io-6f17d22bba15001f\wgpu-0.19.1\src\backend\wgpu_core.rs:529
   6: wgpu::context::impl$5::instance_create_surface<wgpu::backend::wgpu_core::ContextWgpuCore>
             at C:\Users\Nathan\.cargo\registry\src\index.crates.io-6f17d22bba15001f\wgpu-0.19.1\src\context.rs:1995
   7: wgpu::Instance::create_surface_unsafe
             at C:\Users\Nathan\.cargo\registry\src\index.crates.io-6f17d22bba15001f\wgpu-0.19.1\src\lib.rs:2051
   8: wgpu::Instance::create_surface<alloc::sync::Arc<winit::window::Window,alloc::alloc::Global> >
             at C:\Users\Nathan\.cargo\registry\src\index.crates.io-6f17d22bba15001f\wgpu-0.19.1\src\lib.rs:1984
   9: egui_wgpu::winit::impl$2::set_window::async_fn$0
             at C:\Users\Nathan\.cargo\git\checkouts\egui-5e4507fa4153be06\114f820\crates\egui-wgpu\src\winit.rs:210
  10: pollster::block_on<enum2$<egui_wgpu::winit::impl$2::set_window::async_fn_env$0> >
             at C:\Users\Nathan\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pollster-0.3.0\src\lib.rs:128
  11: eframe::native::wgpu_integration::WgpuWinitApp::init_run_state
             at C:\Users\Nathan\.cargo\git\checkouts\egui-5e4507fa4153be06\114f820\crates\eframe\src\native\wgpu_integration.rs:203
  12: eframe::native::wgpu_integration::impl$1::on_event
             at C:\Users\Nathan\.cargo\git\checkouts\egui-5e4507fa4153be06\114f820\crates\eframe\src\native\wgpu_integration.rs:433
  13: eframe::native::run::run_and_return::closure$0<eframe::native::wgpu_integration::WgpuWinitApp>
             at C:\Users\Nathan\.cargo\git\checkouts\egui-5e4507fa4153be06\114f820\crates\eframe\src\native\run.rs:128
  14: winit::platform_impl::platform::event_loop::impl$3::run_on_demand::closure$0<enum2$<eframe::native::winit_integration::UserEvent>,eframe::native::run::run_and_return::closure_env$0<eframe::native::wgpu_integration::WgpuWinitApp> >
             at C:\Users\Nathan\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winit-0.29.10\src\platform_impl\windows\event_loop.rs:236
  15: alloc::boxed::impl$48::call_mut<tuple$<enum2$<winit::event::Event<enum2$<eframe::native::winit_integration::UserEvent> > > >,dyn$<core::ops::function::FnMut<tuple$<enum2$<winit::event::Event<enum2$<eframe::native::winit_integration::UserEvent> > > >,assoc
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112\library\alloc\src\boxed.rs:2014
  16: winit::platform_impl::platform::event_loop::runner::impl$3::call_event_handler::closure$0<enum2$<eframe::native::winit_integration::UserEvent> >
             at C:\Users\Nathan\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winit-0.29.10\src\platform_impl\windows\event_loop\runner.rs:250
  17: core::panic::unwind_safe::impl$23::call_once<tuple$<>,winit::platform_impl::platform::event_loop::runner::impl$3::call_event_handler::closure_env$0<enum2$<eframe::native::winit_integration::UserEvent> > >
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112\library\core\src\panic\unwind_safe.rs:272
  18: std::panicking::try::do_call<core::panic::unwind_safe::AssertUnwindSafe<winit::platform_impl::platform::event_loop::runner::impl$3::call_event_handler::closure_env$0<enum2$<eframe::native::winit_integration::UserEvent> > >,tuple$<> >
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112\library\std\src\panicking.rs:552
  19: winit::dpi::impl$33::from<f64>
  20: std::panicking::try<tuple$<>,core::panic::unwind_safe::AssertUnwindSafe<winit::platform_impl::platform::event_loop::runner::impl$3::call_event_handler::closure_env$0<enum2$<eframe::native::winit_integration::UserEvent> > > >
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112\library\std\src\panicking.rs:516
  21: std::panic::catch_unwind<core::panic::unwind_safe::AssertUnwindSafe<winit::platform_impl::platform::event_loop::runner::impl$3::call_event_handler::closure_env$0<enum2$<eframe::native::winit_integration::UserEvent> > >,tuple$<> >
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112\library\std\src\panic.rs:142
  22: winit::platform_impl::platform::event_loop::runner::EventLoopRunner<enum2$<eframe::native::winit_integration::UserEvent> >::catch_unwind<enum2$<eframe::native::winit_integration::UserEvent>,tuple$<>,winit::platform_impl::platform::event_loop::runner::impl
             at C:\Users\Nathan\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winit-0.29.10\src\platform_impl\windows\event_loop\runner.rs:183
  23: winit::platform_impl::platform::event_loop::runner::EventLoopRunner<enum2$<eframe::native::winit_integration::UserEvent> >::call_event_handler<enum2$<eframe::native::winit_integration::UserEvent> >
             at C:\Users\Nathan\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winit-0.29.10\src\platform_impl\windows\event_loop\runner.rs:246
  24: winit::platform_impl::platform::event_loop::runner::EventLoopRunner<enum2$<eframe::native::winit_integration::UserEvent> >::call_new_events<enum2$<eframe::native::winit_integration::UserEvent> >
             at C:\Users\Nathan\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winit-0.29.10\src\platform_impl\windows\event_loop\runner.rs:372
  25: winit::platform_impl::platform::event_loop::runner::EventLoopRunner<enum2$<eframe::native::winit_integration::UserEvent> >::move_state_to<enum2$<eframe::native::winit_integration::UserEvent> >
             at C:\Users\Nathan\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winit-0.29.10\src\platform_impl\windows\event_loop\runner.rs:311
  26: winit::platform_impl::platform::event_loop::runner::EventLoopRunner<enum2$<eframe::native::winit_integration::UserEvent> >::prepare_wait<enum2$<eframe::native::winit_integration::UserEvent> >
             at C:\Users\Nathan\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winit-0.29.10\src\platform_impl\windows\event_loop\runner.rs:211
  27: winit::platform_impl::platform::event_loop::EventLoop<enum2$<eframe::native::winit_integration::UserEvent> >::wait_and_dispatch_message<enum2$<eframe::native::winit_integration::UserEvent> >
             at C:\Users\Nathan\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winit-0.29.10\src\platform_impl\windows\event_loop.rs:369
  28: winit::platform_impl::platform::event_loop::EventLoop<enum2$<eframe::native::winit_integration::UserEvent> >::run_on_demand<enum2$<eframe::native::winit_integration::UserEvent>,eframe::native::run::run_and_return::closure_env$0<eframe::native::wgpu_integr
             at C:\Users\Nathan\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winit-0.29.10\src\platform_impl\windows\event_loop.rs:241
  29: winit::platform::run_on_demand::impl$0::run_on_demand<enum2$<eframe::native::winit_integration::UserEvent>,eframe::native::run::run_and_return::closure_env$0<eframe::native::wgpu_integration::WgpuWinitApp> >
             at C:\Users\Nathan\.cargo\registry\src\index.crates.io-6f17d22bba15001f\winit-0.29.10\src\platform\run_on_demand.rs:80
  30: eframe::native::run::run_and_return<eframe::native::wgpu_integration::WgpuWinitApp>
             at C:\Users\Nathan\.cargo\git\checkouts\egui-5e4507fa4153be06\114f820\crates\eframe\src\native\run.rs:76
  31: eframe::native::run::run_wgpu::closure$0
             at C:\Users\Nathan\.cargo\git\checkouts\egui-5e4507fa4153be06\114f820\crates\eframe\src\native\run.rs:417
  32: eframe::native::run::with_event_loop::closure$0<enum2$<core::result::Result<tuple$<>,enum2$<eframe::Error> > >,eframe::native::run::run_wgpu::closure_env$0>
             at C:\Users\Nathan\.cargo\git\checkouts\egui-5e4507fa4153be06\114f820\crates\eframe\src\native\run.rs:58
  33: std::thread::local::LocalKey<core::cell::RefCell<enum2$<core::option::Option<winit::event_loop::EventLoop<enum2$<eframe::native::winit_integration::UserEvent> > > > > >::try_with<core::cell::RefCell<enum2$<core::option::Option<winit::event_loop::EventLoop
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112\library\std\src\thread\local.rs:270
  34: std::thread::local::LocalKey<core::cell::RefCell<enum2$<core::option::Option<winit::event_loop::EventLoop<enum2$<eframe::native::winit_integration::UserEvent> > > > > >::with<core::cell::RefCell<enum2$<core::option::Option<winit::event_loop::EventLoop<enu
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112\library\std\src\thread\local.rs:246
  35: eframe::native::run::with_event_loop<enum2$<core::result::Result<tuple$<>,enum2$<eframe::Error> > >,eframe::native::run::run_wgpu::closure_env$0>
             at C:\Users\Nathan\.cargo\git\checkouts\egui-5e4507fa4153be06\114f820\crates\eframe\src\native\run.rs:48
  36: eframe::native::run::run_wgpu
             at C:\Users\Nathan\.cargo\git\checkouts\egui-5e4507fa4153be06\114f820\crates\eframe\src\native\run.rs:415
  37: eframe::run_native
             at C:\Users\Nathan\.cargo\git\checkouts\egui-5e4507fa4153be06\114f820\crates\eframe\src\lib.rs:268
  38: egui_window_recreate_bug::main
             at .\src\main.rs:11
  39: core::ops::function::FnOnce::call_once<void (*)(),tuple$<> >
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112\library\core\src\ops\function.rs:250
  40: core::hint::black_box
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112\library\core\src\hint.rs:286

@lukexor
Copy link

lukexor commented Feb 22, 2024

I'm getting this as well when moving a window from one monitor to another:

Seems related to winits app_state module - maybe some mismatch between set_callback/clear_callback:

    /// Associate the application's event callback with the (global static) Handler state
    ///
    /// # Safety
    /// This is ignoring the lifetime of the application callback (which may not be 'static)
    /// and can lead to undefined behaviour if the callback is not cleared before the end of
    /// its real lifetime.
    ///
    /// All public APIs that take an event callback (`run`, `run_on_demand`,
    /// `pump_events`) _must_ pair a call to `set_callback` with
    /// a call to `clear_callback` before returning to avoid undefined behaviour.

stacktrace
thread 'main' panicked at /Users/lukepetherbridge/.cargo/registry/src/index.crates.io-6f17d22bba15001f/egui-0.26.2/src/context.rs:2096:18:
tessellate called before first call to Context::run()
stack backtrace:
   0:        0x103d43c65 - std::backtrace_rs::backtrace::libunwind::trace::h63eec5ee993acff9
                               at /rustc/bccb9bbb418a30aeb332052e721beb6ebc6b1ce7/library/std/src/../../backtrace/src/backtrace/libunwind.rs:104:5
   1:        0x103d43c65 - std::backtrace_rs::backtrace::trace_unsynchronized::hbb8d3eaa8db90a9d
                               at /rustc/bccb9bbb418a30aeb332052e721beb6ebc6b1ce7/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:        0x103d43c65 - std::sys_common::backtrace::_print_fmt::h2ca3b53a63b22465
                               at /rustc/bccb9bbb418a30aeb332052e721beb6ebc6b1ce7/library/std/src/sys_common/backtrace.rs:68:5
   3:        0x103d43c65 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h302759c6e337f071
                               at /rustc/bccb9bbb418a30aeb332052e721beb6ebc6b1ce7/library/std/src/sys_common/backtrace.rs:44:22
   4:        0x103d651fb - core::fmt::rt::Argument::fmt::hd79ffb4af0e64920
                               at /rustc/bccb9bbb418a30aeb332052e721beb6ebc6b1ce7/library/core/src/fmt/rt.rs:142:9
   5:        0x103d651fb - core::fmt::write::hea41ce1c166f8f54
                               at /rustc/bccb9bbb418a30aeb332052e721beb6ebc6b1ce7/library/core/src/fmt/mod.rs:1120:17
   6:        0x103d40bee - std::io::Write::write_fmt::h2d2eaaa7fa3fa1e6
                               at /rustc/bccb9bbb418a30aeb332052e721beb6ebc6b1ce7/library/std/src/io/mod.rs:1854:15
   7:        0x103d43a21 - std::sys_common::backtrace::_print::h3fc6eb31646186e2
                               at /rustc/bccb9bbb418a30aeb332052e721beb6ebc6b1ce7/library/std/src/sys_common/backtrace.rs:47:5
   8:        0x103d43a21 - std::sys_common::backtrace::print::hd72ced2cfe8a601f
                               at /rustc/bccb9bbb418a30aeb332052e721beb6ebc6b1ce7/library/std/src/sys_common/backtrace.rs:34:9
   9:        0x103d44f49 - std::panicking::default_hook::{{closure}}::h5f97dcf952b9a061
  10:        0x103d44cb6 - std::panicking::default_hook::hc6b595065fb17dcd
                               at /rustc/bccb9bbb418a30aeb332052e721beb6ebc6b1ce7/library/std/src/panicking.rs:292:9
  11:        0x103d4597e - std::panicking::rust_panic_with_hook::h6dfd9ff22c87d595
                               at /rustc/bccb9bbb418a30aeb332052e721beb6ebc6b1ce7/library/std/src/panicking.rs:781:13
  12:        0x103d452e4 - std::panicking::begin_panic_handler::{{closure}}::hee5c88c930909683
                               at /rustc/bccb9bbb418a30aeb332052e721beb6ebc6b1ce7/library/std/src/panicking.rs:659:13
  13:        0x103d44159 - std::sys_common::backtrace::__rust_end_short_backtrace::h0b007358367a2da5
                               at /rustc/bccb9bbb418a30aeb332052e721beb6ebc6b1ce7/library/std/src/sys_common/backtrace.rs:171:18
  14:        0x103d45016 - rust_begin_unwind
                               at /rustc/bccb9bbb418a30aeb332052e721beb6ebc6b1ce7/library/std/src/panicking.rs:647:5
  15:        0x103dab205 - core::panicking::panic_fmt::h5a5b4ee1db180446
                               at /rustc/bccb9bbb418a30aeb332052e721beb6ebc6b1ce7/library/core/src/panicking.rs:72:14
  16:        0x103d628cb - core::panicking::panic_display::h40eeb1282841b64a
                               at /rustc/bccb9bbb418a30aeb332052e721beb6ebc6b1ce7/library/core/src/panicking.rs:196:5
  17:        0x103dab1cc - core::panicking::panic_str::h96f1aa6cdca931c5
                               at /rustc/bccb9bbb418a30aeb332052e721beb6ebc6b1ce7/library/core/src/panicking.rs:171:5
  18:        0x103dab1cc - core::option::expect_failed::h536330a5d3db1d07
                               at /rustc/bccb9bbb418a30aeb332052e721beb6ebc6b1ce7/library/core/src/option.rs:1993:5
  19:        0x103bd6de3 - core::option::Option<T>::expect::h065c024e7c22c058
                               at /rustc/bccb9bbb418a30aeb332052e721beb6ebc6b1ce7/library/core/src/option.rs:895:21
  20:        0x103bd6de3 - egui::context::Context::tessellate::{{closure}}::h556abfca9ce6d561
                               at /Users/lukepetherbridge/.cargo/registry/src/index.crates.io-6f17d22bba15001f/egui-0.26.2/src/context.rs:2093:33
  21:        0x103bd6de3 - egui::context::Context::write::hf55dff3cdffd54fe
                               at /Users/lukepetherbridge/.cargo/registry/src/index.crates.io-6f17d22bba15001f/egui-0.26.2/src/context.rs:723:9
  22:        0x103bd9ab3 - egui::context::Context::tessellate::hb07e47ece4b067fb
                               at /Users/lukepetherbridge/.cargo/registry/src/index.crates.io-6f17d22bba15001f/egui-0.26.2/src/context.rs:2091:9
  23:        0x103662f67 - tetanes::nes::gui::Gui::prepare::h84efa86a9ebe0334
                               at /Users/lukepetherbridge/dev/tetanes/src/nes/gui.rs:163:27
  24:        0x1036cefe5 - tetanes::nes::renderer::Renderer::request_redraw::h3996307ae1c0eaa9
                               at /Users/lukepetherbridge/dev/tetanes/src/nes/renderer.rs:122:9
  25:        0x10369aac6 - tetanes::nes::event::<impl tetanes::nes::Nes>::on_event::hdb800248b09f3eb4
                               at /Users/lukepetherbridge/dev/tetanes/src/nes/event.rs:220:39
  26:        0x103657195 - <winit::platform_impl::platform::app_state::EventLoopHandler<T> as winit::platform_impl::platform::app_state::EventHandler>::handle_nonuser_event::{{closure}}::hd99f6d349bcd35a1
                               at /Users/lukepetherbridge/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.10/src/platform_impl/macos/app_state.rs:87:13
  27:        0x103657195 - winit::platform_impl::platform::app_state::EventLoopHandler<T>::with_callback::h145893ee7a8620b5
                               at /Users/lukepetherbridge/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.10/src/platform_impl/macos/app_state.rs:70:13
  28:        0x103657195 - <winit::platform_impl::platform::app_state::EventLoopHandler<T> as winit::platform_impl::platform::app_state::EventHandler>::handle_nonuser_event::he4c6727750c7d3a0
                               at /Users/lukepetherbridge/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.10/src/platform_impl/macos/app_state.rs:86:9
  29:        0x103cf1b24 - winit::platform_impl::platform::app_state::Handler::handle_nonuser_event::he921a75dd621d2b9
                               at /Users/lukepetherbridge/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.10/src/platform_impl/macos/app_state.rs:318:13
  30:        0x103cf02a3 - winit::platform_impl::platform::app_state::AppState::cleared::h7f510486a730f141
                               at /Users/lukepetherbridge/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.10/src/platform_impl/macos/app_state.rs:647:13
  31:        0x103cf02a3 - winit::platform_impl::platform::observer::control_flow_end_handler::{{closure}}::ha527e3b0d36d382e
                               at /Users/lukepetherbridge/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.10/src/platform_impl/macos/observer.rs:79:21
  32:        0x103cf02a3 - winit::platform_impl::platform::observer::control_flow_handler::{{closure}}::hadac0ccd7990494f
                               at /Users/lukepetherbridge/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.10/src/platform_impl/macos/observer.rs:41:9
  33:        0x103cf02a3 - std::panicking::try::do_call::h21b49182d182b20b
                               at /rustc/bccb9bbb418a30aeb332052e721beb6ebc6b1ce7/library/std/src/panicking.rs:554:40
  34:        0x103cf02a3 - std::panicking::try::hcdd8d7aff7417494
                               at /rustc/bccb9bbb418a30aeb332052e721beb6ebc6b1ce7/library/std/src/panicking.rs:518:19
  35:        0x103cf3791 - std::panic::catch_unwind::h2f208ab1159b19a9
                               at /rustc/bccb9bbb418a30aeb332052e721beb6ebc6b1ce7/library/std/src/panic.rs:142:14
  36:        0x103cf3791 - winit::platform_impl::platform::event_loop::stop_app_on_panic::h389a257a2065bda4
                               at /Users/lukepetherbridge/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.10/src/platform_impl/macos/event_loop.rs:469:11
  37:        0x103cf3791 - winit::platform_impl::platform::observer::control_flow_handler::ha43d08677abd7bf8
                               at /Users/lukepetherbridge/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.10/src/platform_impl/macos/observer.rs:39:5
  38:        0x103cf3791 - winit::platform_impl::platform::observer::control_flow_end_handler::hd8ba57f78f8d5042
                               at /Users/lukepetherbridge/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.10/src/platform_impl/macos/observer.rs:74:9
  39:     0x7ff81141b520 - <unknown>
  40:     0x7ff81141b3b2 - <unknown>
  41:     0x7ff81141a967 - <unknown>
  42:     0x7ff811419e3c - <unknown>
  43:     0x7ff81a0c95e6 - <unknown>
  44:     0x7ff81a0c934a - <unknown>
  45:     0x7ff81a0c90e5 - <unknown>
  46:     0x7ff813e53fad - <unknown>
  47:     0x7ff813e5266a - <unknown>
  48:     0x7ff813e44d19 - <unknown>
  49:        0x103653b5b - winit::platform_impl::platform::event_loop::EventLoop<T>::run_on_demand::{{closure}}::{{closure}}::h8fb7823b31136a5d
                               at /Users/lukepetherbridge/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.10/src/platform_impl/macos/event_loop.rs:310:26
  50:        0x103653b5b - core::ops::function::FnOnce::call_once::h006e59acf604a1d1
                               at /rustc/bccb9bbb418a30aeb332052e721beb6ebc6b1ce7/library/core/src/ops/function.rs:250:5
  51:        0x103653b5b - <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once::h8e080587b4b13472
                               at /rustc/bccb9bbb418a30aeb332052e721beb6ebc6b1ce7/library/core/src/panic/unwind_safe.rs:272:9
  52:        0x103653b5b - std::panicking::try::do_call::ha0399e07fbdec588
                               at /rustc/bccb9bbb418a30aeb332052e721beb6ebc6b1ce7/library/std/src/panicking.rs:554:40
  53:        0x103653b5b - std::panicking::try::hf2f92b9ee65d6d36
                               at /rustc/bccb9bbb418a30aeb332052e721beb6ebc6b1ce7/library/std/src/panicking.rs:518:19
  54:        0x103652784 - std::panic::catch_unwind::ha7990a2b48ad6467
                               at /rustc/bccb9bbb418a30aeb332052e721beb6ebc6b1ce7/library/std/src/panic.rs:142:14
  55:        0x103652784 - winit::platform_impl::platform::event_loop::EventLoop<T>::run_on_demand::{{closure}}::hf15020339ffaaaaf
                               at /Users/lukepetherbridge/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.10/src/platform_impl/macos/event_loop.rs:299:32
  56:        0x103652784 - objc2::rc::autorelease::autoreleasepool::hcbc642364f00e0ca
                               at /Users/lukepetherbridge/.cargo/registry/src/index.crates.io-6f17d22bba15001f/objc2-0.4.1/src/rc/autorelease.rs:438:15
  57:        0x103652784 - winit::platform_impl::platform::event_loop::EventLoop<T>::run_on_demand::hdeb05d791c1678a2
                               at /Users/lukepetherbridge/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.10/src/platform_impl/macos/event_loop.rs:281:9
  58:        0x103652784 - winit::platform_impl::platform::event_loop::EventLoop<T>::run::he0888f3c4cf4575a
                               at /Users/lukepetherbridge/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.10/src/platform_impl/macos/event_loop.rs:248:9
  59:        0x103650bdb - winit::event_loop::EventLoop<T>::run::hb18ce95cffc56496
                               at /Users/lukepetherbridge/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.10/src/event_loop.rs:249:9
  60:        0x103650bdb - <winit::event_loop::EventLoop<T> as tetanes::nes::platform::EventLoopExt<T>>::run_platform::h3ccab06933f8dae1
                               at /Users/lukepetherbridge/dev/tetanes/src/nes/platform.rs:111:9
  61:        0x103650bdb - tetanes::nes::Nes::run::{{closure}}::h16a57c0cf09f7b9a
                               at /Users/lukepetherbridge/dev/tetanes/src/nes.rs:52:9
  62:        0x103650bdb - tetanes::platform::thread::spawn::{{closure}}::hfdb55087de0cafee
                               at /Users/lukepetherbridge/dev/tetanes/src/platform.rs:19:38
  63:        0x103650bdb - pollster::block_on::ha4b6b5361389ebdd
                               at /Users/lukepetherbridge/.cargo/registry/src/index.crates.io-6f17d22bba15001f/pollster-0.3.0/src/lib.rs:128:15
  64:        0x103647565 - tetanes::platform::thread::spawn::h56901c09d73fee8e
                               at /Users/lukepetherbridge/dev/tetanes/src/platform.rs:28:9
  65:        0x103647565 - tetanes::main::h5d1ba87387ef37e7
                               at /Users/lukepetherbridge/dev/tetanes/src/main.rs:35:5
  66:        0x10364ce96 - core::ops::function::FnOnce::call_once::h04ca7133b692eec5
                               at /rustc/bccb9bbb418a30aeb332052e721beb6ebc6b1ce7/library/core/src/ops/function.rs:250:5
  67:        0x10364ce96 - std::sys_common::backtrace::__rust_begin_short_backtrace::he1d89d10e132f7aa
                               at /rustc/bccb9bbb418a30aeb332052e721beb6ebc6b1ce7/library/std/src/sys_common/backtrace.rs:155:18
  68:        0x103641c81 - std::rt::lang_start::{{closure}}::h4d849c4faa2a7e3a
                               at /rustc/bccb9bbb418a30aeb332052e721beb6ebc6b1ce7/library/std/src/rt.rs:166:18
  69:        0x103d3a160 - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h02026e987e8f8e8a
                               at /rustc/bccb9bbb418a30aeb332052e721beb6ebc6b1ce7/library/core/src/ops/function.rs:284:13
  70:        0x103d3a160 - std::panicking::try::do_call::h23892082d79a3143
                               at /rustc/bccb9bbb418a30aeb332052e721beb6ebc6b1ce7/library/std/src/panicking.rs:554:40
  71:        0x103d3a160 - std::panicking::try::h65f8f54b99700e58
                               at /rustc/bccb9bbb418a30aeb332052e721beb6ebc6b1ce7/library/std/src/panicking.rs:518:19
  72:        0x103d3a160 - std::panic::catch_unwind::h7dcc725690550090
                               at /rustc/bccb9bbb418a30aeb332052e721beb6ebc6b1ce7/library/std/src/panic.rs:142:14
  73:        0x103d3a160 - std::rt::lang_start_internal::{{closure}}::h08ebce4b40fb58ee
                               at /rustc/bccb9bbb418a30aeb332052e721beb6ebc6b1ce7/library/std/src/rt.rs:148:48
  74:        0x103d3a160 - std::panicking::try::do_call::hcfb81d46797ff5fe
                               at /rustc/bccb9bbb418a30aeb332052e721beb6ebc6b1ce7/library/std/src/panicking.rs:554:40
  75:        0x103d3a160 - std::panicking::try::h6e4b13542c207704
                               at /rustc/bccb9bbb418a30aeb332052e721beb6ebc6b1ce7/library/std/src/panicking.rs:518:19
  76:        0x103d3a160 - std::panic::catch_unwind::h99df6afccc5cef7a
                               at /rustc/bccb9bbb418a30aeb332052e721beb6ebc6b1ce7/library/std/src/panic.rs:142:14
  77:        0x103d3a160 - std::rt::lang_start_internal::hc1d0e975d0800a3e
                               at /rustc/bccb9bbb418a30aeb332052e721beb6ebc6b1ce7/library/std/src/rt.rs:148:20
  78:        0x10364ce7c - _main
thread 'main' panicked at /Users/lukepetherbridge/.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:        0x103d43c65 - std::backtrace_rs::backtrace::libunwind::trace::h63eec5ee993acff9
                               at /rustc/bccb9bbb418a30aeb332052e721beb6ebc6b1ce7/library/std/src/../../backtrace/src/backtrace/libunwind.rs:104:5
   1:        0x103d43c65 - std::backtrace_rs::backtrace::trace_unsynchronized::hbb8d3eaa8db90a9d
                               at /rustc/bccb9bbb418a30aeb332052e721beb6ebc6b1ce7/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:        0x103d43c65 - std::sys_common::backtrace::_print_fmt::h2ca3b53a63b22465
                               at /rustc/bccb9bbb418a30aeb332052e721beb6ebc6b1ce7/library/std/src/sys_common/backtrace.rs:68:5
   3:        0x103d43c65 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h302759c6e337f071
                               at /rustc/bccb9bbb418a30aeb332052e721beb6ebc6b1ce7/library/std/src/sys_common/backtrace.rs:44:22
   4:        0x103d651fb - core::fmt::rt::Argument::fmt::hd79ffb4af0e64920
                               at /rustc/bccb9bbb418a30aeb332052e721beb6ebc6b1ce7/library/core/src/fmt/rt.rs:142:9
   5:        0x103d651fb - core::fmt::write::hea41ce1c166f8f54
                               at /rustc/bccb9bbb418a30aeb332052e721beb6ebc6b1ce7/library/core/src/fmt/mod.rs:1120:17
   6:        0x103d40bee - std::io::Write::write_fmt::h2d2eaaa7fa3fa1e6
                               at /rustc/bccb9bbb418a30aeb332052e721beb6ebc6b1ce7/library/std/src/io/mod.rs:1854:15
   7:        0x103d43a21 - std::sys_common::backtrace::_print::h3fc6eb31646186e2
                               at /rustc/bccb9bbb418a30aeb332052e721beb6ebc6b1ce7/library/std/src/sys_common/backtrace.rs:47:5
   8:        0x103d43a21 - std::sys_common::backtrace::print::hd72ced2cfe8a601f
                               at /rustc/bccb9bbb418a30aeb332052e721beb6ebc6b1ce7/library/std/src/sys_common/backtrace.rs:34:9
   9:        0x103d44f49 - std::panicking::default_hook::{{closure}}::h5f97dcf952b9a061
  10:        0x103d44cb6 - std::panicking::default_hook::hc6b595065fb17dcd
                               at /rustc/bccb9bbb418a30aeb332052e721beb6ebc6b1ce7/library/std/src/panicking.rs:292:9
  11:        0x103d4597e - std::panicking::rust_panic_with_hook::h6dfd9ff22c87d595
                               at /rustc/bccb9bbb418a30aeb332052e721beb6ebc6b1ce7/library/std/src/panicking.rs:781:13
  12:        0x103d452e4 - std::panicking::begin_panic_handler::{{closure}}::hee5c88c930909683
                               at /rustc/bccb9bbb418a30aeb332052e721beb6ebc6b1ce7/library/std/src/panicking.rs:659:13
  13:        0x103d44159 - std::sys_common::backtrace::__rust_end_short_backtrace::h0b007358367a2da5
                               at /rustc/bccb9bbb418a30aeb332052e721beb6ebc6b1ce7/library/std/src/sys_common/backtrace.rs:171:18
  14:        0x103d45016 - rust_begin_unwind
                               at /rustc/bccb9bbb418a30aeb332052e721beb6ebc6b1ce7/library/std/src/panicking.rs:647:5
  15:        0x103dab205 - core::panicking::panic_fmt::h5a5b4ee1db180446
                               at /rustc/bccb9bbb418a30aeb332052e721beb6ebc6b1ce7/library/core/src/panicking.rs:72:14
  16:        0x103dab7e5 - core::result::unwrap_failed::h553ddfa7780d9684
                               at /rustc/bccb9bbb418a30aeb332052e721beb6ebc6b1ce7/library/core/src/result.rs:1653:5
  17:        0x103cf1dc9 - core::result::Result<T,E>::unwrap::he0d0afaa0bebdde8
                               at /rustc/bccb9bbb418a30aeb332052e721beb6ebc6b1ce7/library/core/src/result.rs:1077:23
  18:        0x103cf1dc9 - winit::platform_impl::platform::app_state::AppState::clear_callback::hc94f929f9c6c3895
                               at /Users/lukepetherbridge/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.10/src/platform_impl/macos/app_state.rs:387:9
  19:        0x1036527c5 - winit::platform_impl::platform::event_loop::EventLoop<T>::run_on_demand::{{closure}}::hf15020339ffaaaaf
                               at /Users/lukepetherbridge/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.10/src/platform_impl/macos/event_loop.rs:329:13
  20:        0x1036527c5 - objc2::rc::autorelease::autoreleasepool::hcbc642364f00e0ca
                               at /Users/lukepetherbridge/.cargo/registry/src/index.crates.io-6f17d22bba15001f/objc2-0.4.1/src/rc/autorelease.rs:438:15
  21:        0x1036527c5 - winit::platform_impl::platform::event_loop::EventLoop<T>::run_on_demand::hdeb05d791c1678a2
                               at /Users/lukepetherbridge/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.10/src/platform_impl/macos/event_loop.rs:281:9
  22:        0x1036527c5 - winit::platform_impl::platform::event_loop::EventLoop<T>::run::he0888f3c4cf4575a
                               at /Users/lukepetherbridge/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.10/src/platform_impl/macos/event_loop.rs:248:9
  23:        0x103650bdb - winit::event_loop::EventLoop<T>::run::hb18ce95cffc56496
                               at /Users/lukepetherbridge/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.10/src/event_loop.rs:249:9
  24:        0x103650bdb - <winit::event_loop::EventLoop<T> as tetanes::nes::platform::EventLoopExt<T>>::run_platform::h3ccab06933f8dae1
                               at /Users/lukepetherbridge/dev/tetanes/src/nes/platform.rs:111:9
  25:        0x103650bdb - tetanes::nes::Nes::run::{{closure}}::h16a57c0cf09f7b9a
                               at /Users/lukepetherbridge/dev/tetanes/src/nes.rs:52:9
  26:        0x103650bdb - tetanes::platform::thread::spawn::{{closure}}::hfdb55087de0cafee
                               at /Users/lukepetherbridge/dev/tetanes/src/platform.rs:19:38
  27:        0x103650bdb - pollster::block_on::ha4b6b5361389ebdd
                               at /Users/lukepetherbridge/.cargo/registry/src/index.crates.io-6f17d22bba15001f/pollster-0.3.0/src/lib.rs:128:15
  28:        0x103647565 - tetanes::platform::thread::spawn::h56901c09d73fee8e
                               at /Users/lukepetherbridge/dev/tetanes/src/platform.rs:28:9
  29:        0x103647565 - tetanes::main::h5d1ba87387ef37e7
                               at /Users/lukepetherbridge/dev/tetanes/src/main.rs:35:5
  30:        0x10364ce96 - core::ops::function::FnOnce::call_once::h04ca7133b692eec5
                               at /rustc/bccb9bbb418a30aeb332052e721beb6ebc6b1ce7/library/core/src/ops/function.rs:250:5
  31:        0x10364ce96 - std::sys_common::backtrace::__rust_begin_short_backtrace::he1d89d10e132f7aa
                               at /rustc/bccb9bbb418a30aeb332052e721beb6ebc6b1ce7/library/std/src/sys_common/backtrace.rs:155:18
  32:        0x103641c81 - std::rt::lang_start::{{closure}}::h4d849c4faa2a7e3a
                               at /rustc/bccb9bbb418a30aeb332052e721beb6ebc6b1ce7/library/std/src/rt.rs:166:18
  33:        0x103d3a160 - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h02026e987e8f8e8a
                               at /rustc/bccb9bbb418a30aeb332052e721beb6ebc6b1ce7/library/core/src/ops/function.rs:284:13
  34:        0x103d3a160 - std::panicking::try::do_call::h23892082d79a3143
                               at /rustc/bccb9bbb418a30aeb332052e721beb6ebc6b1ce7/library/std/src/panicking.rs:554:40
  35:        0x103d3a160 - std::panicking::try::h65f8f54b99700e58
                               at /rustc/bccb9bbb418a30aeb332052e721beb6ebc6b1ce7/library/std/src/panicking.rs:518:19
  36:        0x103d3a160 - std::panic::catch_unwind::h7dcc725690550090
                               at /rustc/bccb9bbb418a30aeb332052e721beb6ebc6b1ce7/library/std/src/panic.rs:142:14
  37:        0x103d3a160 - std::rt::lang_start_internal::{{closure}}::h08ebce4b40fb58ee
                               at /rustc/bccb9bbb418a30aeb332052e721beb6ebc6b1ce7/library/std/src/rt.rs:148:48
  38:        0x103d3a160 - std::panicking::try::do_call::hcfb81d46797ff5fe
                               at /rustc/bccb9bbb418a30aeb332052e721beb6ebc6b1ce7/library/std/src/panicking.rs:554:40
  39:        0x103d3a160 - std::panicking::try::h6e4b13542c207704
                               at /rustc/bccb9bbb418a30aeb332052e721beb6ebc6b1ce7/library/std/src/panicking.rs:518:19
  40:        0x103d3a160 - std::panic::catch_unwind::h99df6afccc5cef7a
                               at /rustc/bccb9bbb418a30aeb332052e721beb6ebc6b1ce7/library/std/src/panic.rs:142:14
  41:        0x103d3a160 - std::rt::lang_start_internal::hc1d0e975d0800a3e
                               at /rustc/bccb9bbb418a30aeb332052e721beb6ebc6b1ce7/library/std/src/rt.rs:148:20
  42:        0x10364ce7c - _main

@emilk emilk closed this as completed in 0c528fb Aug 26, 2024
emilk added a commit that referenced this issue Sep 17, 2024
…per_point (#4868)

Fix: panic when dragging window between monitors of different
pixels_per_point

This will continue to help us as we develop `egui`.
I hope you agree with my defense of `panic`.

* Relate #3959
* Relate #4088

* Closes #4178
* Closes #4179


There is also a way to add log if necessary.
```
                log::debug!("Anti-panic behavior occurs");
```

---------

Co-authored-by: Emil Ernerfeldt <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crash crash, panic, segfault, freeze, … egui_glow Relates to running egui_glow on native native-windows Running on native Windows OS viewports multiple viewports, viewports API
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants