Skip to content

panic: already borrowed: BorrowMutError #1476

@TannerRogalsky

Description

@TannerRogalsky

I'm getting a panic from Winit 0.21.0 on the web platform using websys. It looks like the handle_event is calling itself (I think, likely, at the (runner.event_handler)(event, control) callsite).

I haven't tried to debug this too much but I wanted to throw up an issue in case any has a quick fix. I also haven't tried any of the examples but I imagine it's happening there too as I'm not doing anything unusual with the event loop. A stacktrace is included.

  | console_error_panic_hook::error::hee4e4f2e8988f5b8 | @ | wasm-0127f87e-2893:1
  | console_error_panic_hook::hook_impl::h5da1d2c5628514aa | @ | wasm-0127f87e-1195:1
  | console_error_panic_hook::hook::hab9eb8cb5f2e0186 | @ | wasm-0127f87e-7473:1
  | core::ops::function::Fn::call::h6d4657c557fb2957 | @ | wasm-0127f87e-6779:1
  | std::panicking::rust_panic_with_hook::hdf14da40c6b51ea2 | @ | wasm-0127f87e-1962:1
  | std::panicking::continue_panic_fmt::hf8630aaa243736ee | @ | wasm-0127f87e-4216:1
  | rust_begin_unwind | @ | wasm-0127f87e-8933:1
  | core::panicking::panic_fmt::hdeb7979ab6591473 | @ | wasm-0127f87e-8128:1
  | core::result::unwrap_failed::h054dd680e6fcd38b | @ | wasm-0127f87e-3734:1
  | core::result::Result<T,E>::expect::hae6e1e18d78c275f | @ | wasm-0127f87e-1968:1
  | core::cell::RefCell<T>::borrow_mut::hc27c55254cca8051 | @ | wasm-0127f87e-3252:1
  | winit::platform_impl::platform::event_loop::runner::Shared<T>::handle_event::h922bb08edf69e01d | @ | wasm-0127f87e-307:1
  | winit::platform_impl::platform::event_loop::runner::Shared<T>::handle_event::h922bb08edf69e01d | @ | wasm-0127f87e-307:1
  | winit::platform_impl::platform::event_loop::runner::Shared<T>::run_until_cleared::h7b360a78f7905b35 | @ | wasm-0127f87e-313:1
  | winit::platform_impl::platform::event_loop::runner::Shared<T>::poll::h046578ef90ab390d | @ | wasm-0127f87e-1604:1
  | winit::platform_impl::platform::event_loop::runner::Shared<T>::apply_control_flow::{{closure}}::h3a8c7b2211dc493e | @ | wasm-0127f87e-7377:1
  | <dyn core::ops::function::FnMut<()>+Output = R as wasm_bindgen::closure::WasmClosure>::describe::invoke::h2b0440cdb03d680a | @ | wasm-0127f87e-2352:1
  | __wbg_adapter_30 | @ | states.js:199
  | real | @ | states.js:1255
  | setTimeout (async) |   |  
  | imports.wbg.__widl_f_set_timeout_with_callback_and_timeout_and_arguments_0_Window | @ | states.js:1048
  | web_sys::Window::set_timeout_with_callback_and_timeout_and_arguments_0::h6a9c3d9d3ddb9787 | @ | wasm-0127f87e-1086:1
  | winit::platform_impl::platform::backend::timeout::Timeout::new::h9454998549eff6f1 | @ | wasm-0127f87e-684:1
  | winit::platform_impl::platform::event_loop::runner::Shared<T>::apply_control_flow::h33e6a1ccea7144ae | @ | wasm-0127f87e-315:1
  | winit::platform_impl::platform::event_loop::runner::Shared<T>::run_until_cleared::h7b360a78f7905b35 | @ | wasm-0127f87e-313:1
  | winit::platform_impl::platform::event_loop::runner::Shared<T>::poll::h046578ef90ab390d | @ | wasm-0127f87e-1604:1
  | winit::platform_impl::platform::event_loop::runner::Shared<T>::apply_control_flow::{{closure}}::h3a8c7b2211dc493e | @ | wasm-0127f87e-7377:1
  | <dyn core::ops::function::FnMut<()>+Output = R as wasm_bindgen::closure::WasmClosure>::describe::invoke::h2b0440cdb03d680a | @ | wasm-0127f87e-2352:1
  | __wbg_adapter_30 | @ | states.js:199
  | real | @ | states.js:1255
  | setTimeout (async)

Metadata

Metadata

Assignees

No one assigned

    Labels

    B - bugDang, that shouldn't have happenedC - needs investigationIssue must be confirmed and researchedDS - webAffects the Web backend (WebAssembly/WASM)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions