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

Opening a dialog causes a panic #1685

Closed
VZout opened this issue Aug 28, 2020 · 2 comments
Closed

Opening a dialog causes a panic #1685

VZout opened this issue Aug 28, 2020 · 2 comments

Comments

@VZout
Copy link
Contributor

VZout commented Aug 28, 2020

With the latest winit version opening a dialog using nfd2 causes a panic.
Reverting #1496 fixes it.

I'll investigate this further, repro in a example and PR a fix.

@Jake-Shadle
Copy link

To be clear, it's a panic, not a crash, here is the relevant stack trace and panic message.

either event handler is re-entrant (likely), or no event handler is registered (very unlikely), file: C:\Users\viktor.zoutman\.cargo\registry\src\github.com-1ecc6299db9ec823\winit-0.22.2\src\platform_impl\windows\event_loop\runner.rs:235:37, thread: main

Thread 0
0   core                            0x7ff628925ff0      core::panicking::panic_fmt (panicking.rs:101)
1   core                            0x7ff628925d42      core::option::expect_failed (option.rs:1264)
2   core                            0x7ff628e9387b      core::option::Option<T>::expect<T> (option.rs:349)
3   winit                           0x7ff6295ec7e4      winit::platform_impl::platform::event_loop::runner::{{impl}}::call_event_handler::{{closure}}<T> (runner.rs:235)
4   std                             0x7ff628c4fba6      std::panic::{{impl}}::call_once<T> (panic.rs:318)
5   std                             0x7ff628c8ae10      std::panicking::try::do_call<T> (panicking.rs:297)
6   winit                           0x7ff628c8f387      winit::window::{{impl}}::clone
7   std                             0x7ff628c8aa8a      std::panicking::try<T> (panicking.rs:274)
8   std                             0x7ff628c50a46      std::panic::catch_unwind<T> (panic.rs:394)
9   winit                           0x7ff6295ebe09      winit::platform_impl::platform::event_loop::runner::EventLoopRunner<T>::catch_unwind<T> (runner.rs:150)
10  winit                           0x7ff6295ec741      winit::platform_impl::platform::event_loop::runner::EventLoopRunner<T>::call_event_handler<T> (runner.rs:233)
11  winit                           0x7ff6295ed5f5      winit::platform_impl::platform::event_loop::runner::EventLoopRunner<T>::call_new_events<T> (runner.rs:360)
12  winit                           0x7ff6295ecf75      winit::platform_impl::platform::event_loop::runner::EventLoopRunner<T>::move_state_to<T> (runner.rs:299)
13  winit                           0x7ff6295ec6c3      winit::platform_impl::platform::event_loop::runner::EventLoopRunner<T>::main_events_cleared<T> (runner.rs:225)
14  winit                           0x7ff628d0d898      winit::platform_impl::platform::event_loop::flush_paint_messages<T> (event_loop.rs:663)
15  winit                           0x7ff628d0dde1      winit::platform_impl::platform::event_loop::thread_event_target_callback::{{closure}}<T> (event_loop.rs:1938)
16  std                             0x7ff628c4fb53      std::panic::{{impl}}::call_once<T> (panic.rs:318)
17  std                             0x7ff628c8ae7e      std::panicking::try::do_call<T> (panicking.rs:297)
18  winit                           0x7ff628c8f387      winit::window::{{impl}}::clone
19  std                             0x7ff628c8acc3      std::panicking::try<T> (panicking.rs:274)
20  std                             0x7ff628c509fe      std::panic::catch_unwind<T> (panic.rs:394)
21  winit                           0x7ff6295eb9b3      winit::platform_impl::platform::event_loop::runner::EventLoopRunner<T>::catch_unwind<T> (runner.rs:150)
22  winit                           0x7ff628d0dc51      winit::platform_impl::platform::event_loop::thread_event_target_callback<T> (event_loop.rs:2120)
23  <unknown>                       0x7fff4d65d3b6      DefSubclassProc
24  <unknown>                       0x7fff4d65d26c      DefSubclassProc
25  <unknown>                       0x7fff6546e338      CallWindowProcW
26  <unknown>                       0x7fff6546debc      DispatchMessageW
27  <unknown>                       0x7fff654806a3      SendMessageTimeoutW
28  <unknown>                       0x7fff66fefbf4      KiUserCallbackDispatcher
29  <unknown>                       0x7fff64d61704      NtUserDispatchMessage
30  <unknown>                       0x7fff6546ddca      DispatchMessageW
31  <unknown>                       0x7fff6548d231      DialogBoxIndirectParamAorW
32  <unknown>                       0x7fff6548cea1      DialogBoxIndirectParamAorW
33  <unknown>                       0x7fff6548cd52      DialogBoxIndirectParamAorW
34  <unknown>                       0x7fff6548cce8      DialogBoxIndirectParamW
35  <unknown>                       0x7fff65b05c56      <unknown>
36  <unknown>                       0x7fff65ae2804      <unknown>
37  <unknown>                       0x7ff62c645b46      NFD_PickFolder (nfd_win.cpp:710)
38  nfd2                            0x7ff62a699e2d      nfd2::open_dialog (lib.rs:227)
39  nfd2                            0x7ff62a699975      nfd2::open_pick_folder (lib.rs:179)

@VZout VZout changed the title Opening a dialog crashes the application. Opening a dialog causes a panic Aug 28, 2020
@alvinhochun
Copy link
Contributor

Isn't this the same as #1602?

@VZout VZout closed this as completed Aug 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

4 participants