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

panicked at 'called xilem: Option::unwrap() on a None value #134

Closed
mclelz opened this issue Aug 31, 2023 · 3 comments · Fixed by #138
Closed

panicked at 'called xilem: Option::unwrap() on a None value #134

mclelz opened this issue Aug 31, 2023 · 3 comments · Fixed by #138

Comments

@mclelz
Copy link

mclelz commented Aug 31, 2023

I got this error when I tried to run the hello example, I am on Windows 11. `thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', C:\Users\isaac\Documents\xilem\src\app.rs:202:47 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace error: process didn't exit successfully: `target\debug\examples\hello.exe` (exit code: 0xc0000409, STATUS_STACK_BUFFER_OVERRUN)`

@mclelz mclelz changed the title panicked at 'called Option::unwrap() on a None value panicked at 'called xilem: Option::unwrap() on a None value Aug 31, 2023
@mclelz mclelz closed this as completed Sep 3, 2023
@lawrnce
Copy link

lawrnce commented Oct 17, 2023

@isaacmclellan Did you end up finding a solution to this? I have the same problem on Windows 11.

thread 'main' panicked at C:\Users\Larry\Documents\GitHub\xilem\src\app.rs:202:47:
called `Option::unwrap()` on a `None` value
stack backtrace:
   0: std::panicking::begin_panic_handler
             at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library\std\src\panicking.rs:595
   1: core::panicking::panic_fmt
             at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library\core\src\panicking.rs:67
   2: core::panicking::panic
             at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library\core\src\panicking.rs:117
   3: enum2$<core::option::Option<ref_mut$<xilem::widget::core::Pod> > >::unwrap<ref_mut$<xilem::widget::core::Pod> >
             at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33\library\core\src\option.rs:935
   4: xilem::app::App<i32,xilem::view::linear_layout::LinearLayout<i32,tuple$<>,tuple$<xilem::view::button::Button<i32,tuple$<> >,xilem::view::linear_layout::LinearLayout<i32,tuple$<>,tuple$<xilem::view::button::Button<i32,tuple$<> >,xilem::view::button::Button
             at .\src\app.rs:202
   5: xilem::app_main::impl$1::accesskit_tree<i32,xilem::view::linear_layout::LinearLayout<i32,tuple$<>,tuple$<xilem::view::button::Button<i32,tuple$<> >,xilem::view::linear_layout::LinearLayout<i32,tuple$<>,tuple$<xilem::view::button::Button<i32,tuple$<> >,xil
             at .\src\app_main.rs:120
   6: glazier::backend::windows::window::impl$8::window_proc::closure$22::closure$0::closure$0
             at C:\Users\Larry\.cargo\git\checkouts\glazier-3a172f69e2427c5a\19a01ba\src\backend\windows\window.rs:1194
   7: once_cell::unsync::impl$8::get_or_init::closure$0<accesskit_windows::adapter::Adapter,glazier::backend::windows::window::impl$8::window_proc::closure$22::closure$0::closure_env$0>
             at C:\Users\Larry\.cargo\registry\src\index.crates.io-6f17d22bba15001f\once_cell-1.18.0\src\lib.rs:593
   8: once_cell::unsync::OnceCell<accesskit_windows::adapter::Adapter>::get_or_try_init<accesskit_windows::adapter::Adapter,once_cell::unsync::impl$8::get_or_init::closure_env$0<accesskit_windows::adapter::Adapter,glazier::backend::windows::window::impl$8::wind
             at C:\Users\Larry\.cargo\registry\src\index.crates.io-6f17d22bba15001f\once_cell-1.18.0\src\lib.rs:631
   9: once_cell::unsync::OnceCell<accesskit_windows::adapter::Adapter>::get_or_init<accesskit_windows::adapter::Adapter,glazier::backend::windows::window::impl$8::window_proc::closure$22::closure$0::closure_env$0>
             at C:\Users\Larry\.cargo\registry\src\index.crates.io-6f17d22bba15001f\once_cell-1.18.0\src\lib.rs:593
  10: glazier::backend::windows::window::impl$8::window_proc::closure$22::closure$0
             at C:\Users\Larry\.cargo\git\checkouts\glazier-3a172f69e2427c5a\19a01ba\src\backend\windows\window.rs:1191
  11: enum2$<core::option::Option<ref_mut$<glazier::backend::windows::window::WndState> > >::map<ref_mut$<glazier::backend::windows::window::WndState>,enum2$<core::option::Option<accesskit_windows::adapter::WmGetObjectResult> >,glazier::backend::windows::window
             at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33\library\core\src\option.rs:1075
  12: glazier::backend::windows::window::MyWndProc::with_wnd_state<glazier::backend::windows::window::impl$8::window_proc::closure$22::closure_env$0,enum2$<core::option::Option<accesskit_windows::adapter::WmGetObjectResult> > >
             at C:\Users\Larry\.cargo\git\checkouts\glazier-3a172f69e2427c5a\19a01ba\src\backend\windows\window.rs:453
  13: glazier::backend::windows::window::impl$8::window_proc::closure$22
             at C:\Users\Larry\.cargo\git\checkouts\glazier-3a172f69e2427c5a\19a01ba\src\backend\windows\window.rs:1186
  14: enum2$<core::option::Option<alloc::rc::Rc<glazier::backend::windows::window::WindowState,alloc::alloc::Global> > >::and_then<alloc::rc::Rc<glazier::backend::windows::window::WindowState,alloc::alloc::Global>,accesskit_windows::adapter::WmGetObjectResult,g
             at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33\library\core\src\option.rs:1414
  15: glazier::backend::windows::window::impl$8::window_proc
             at C:\Users\Larry\.cargo\git\checkouts\glazier-3a172f69e2427c5a\19a01ba\src\backend\windows\window.rs:1180
  16: glazier::backend::windows::window::win_proc_dispatch
             at C:\Users\Larry\.cargo\git\checkouts\glazier-3a172f69e2427c5a\19a01ba\src\backend\windows\window.rs:1526
  17: DispatchMessageW
  18: DispatchMessageW
  19: GetClassLongW
  20: KiUserCallbackDispatcher
  21: NtUserMessageCall
  22: SendMessageTimeoutW
  23: AccessibleObjectFromWindow
  24: PropMgrClient_LookupProp
  25: AccGetRunningUtilityState
  26: AccGetRunningUtilityState
  27: TF_CreateThreadMgr
  28: TF_UninitSystem
  29: TF_CreateThreadMgr
  30: CtfImeDispatchDefImeMessage
  31: RegisterWindowMessageA
  32: KiUserCallbackDispatcher
  33: NtUserShowWindow
  34: glazier::backend::windows::window::WindowHandle::show
             at C:\Users\Larry\.cargo\git\checkouts\glazier-3a172f69e2427c5a\19a01ba\src\backend\windows\window.rs:1611
  35: glazier::window::WindowHandle::show
             at C:\Users\Larry\.cargo\git\checkouts\glazier-3a172f69e2427c5a\19a01ba\src\window.rs:205
  36: xilem::app_main::AppLauncher<i32,xilem::view::linear_layout::LinearLayout<i32,tuple$<>,tuple$<xilem::view::button::Button<i32,tuple$<> >,xilem::view::linear_layout::LinearLayout<i32,tuple$<>,tuple$<xilem::view::button::Button<i32,tuple$<> >,xilem::view::b
             at .\src\app_main.rs:87
  37: hello::main
             at .\examples\hello.rs:44
  38: core::ops::function::FnOnce::call_once<void (*)(),tuple$<> >
             at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33\library\core\src\ops\function.rs:250
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
error: process didn't exit successfully: `target\debug\examples\hello.exe` (exit code: 0xc0000409, STATUS_STACK_BUFFER_OVERRUN)

@Philipp-M
Copy link
Contributor

Well, this is a bug, and I think it's a race condition (haven't investigated this in detail though).

Anyway, could you try this fix: #138

@lawrnce
Copy link

lawrnce commented Oct 19, 2023

#138 works on my machine. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants