PistonDevelopers / glutin_window

A Piston window back-end using the Glutin library
MIT License
25 stars 40 forks source link

Panic when polling event in rust 1.48.0 in piston rotating box example #193

Open ghost opened 3 years ago

ghost commented 3 years ago

Using this example: https://github.com/PistonDevelopers/Piston-Tutorials/tree/master/getting-started

I get the following stack trace when mousing over the window:

thread 'main' panicked at 'attempted to leave type `platform::platform::x11::util::input::PointerState` uninitialized, which is invalid', /home/USER/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/mem/mod.rs:658:9
stack backtrace:
   0: rust_begin_unwind
             at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/panicking.rs:483
   1: core::panicking::panic_fmt
             at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/core/src/panicking.rs:85
   2: core::panicking::panic
             at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/core/src/panicking.rs:50
   3: core::mem::uninitialized
             at /home/USER/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/mem/mod.rs:658
   4: winit::platform::platform::x11::util::input::<impl winit::platform::platform::x11::xdisplay::XConnection>::query_pointer
             at /home/USER/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.19.5/src/platform/linux/x11/util/input.rs:94
   5: winit::platform::platform::x11::EventsLoop::process_event
             at /home/USER/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.19.5/src/platform/linux/x11/mod.rs:956
   6: winit::platform::platform::x11::EventsLoop::poll_events
             at /home/USER/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.19.5/src/platform/linux/x11/mod.rs:270
   7: winit::platform::platform::EventsLoop::poll_events
             at /home/USER/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.19.5/src/platform/linux/mod.rs:522
   8: winit::EventsLoop::poll_events
             at /home/USER/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.19.5/src/lib.rs:277
   9: glutin_window::GlutinWindow::poll_event
             at /home/USER/.cargo/registry/src/github.com-1ecc6299db9ec823/pistoncore-glutin_window-0.67.2/src/lib.rs:231
  10: <glutin_window::GlutinWindow as window::Window>::poll_event
             at /home/USER/.cargo/registry/src/github.com-1ecc6299db9ec823/pistoncore-glutin_window-0.67.2/src/lib.rs:476
  11: event_loop::Events::next
             at /home/USER/.cargo/registry/src/github.com-1ecc6299db9ec823/pistoncore-event_loop-0.52.0/src/lib.rs:253
  12: PROJECT::main
             at ./src/main.rs:67
  13: core::ops::function::FnOnce::call_once
             at /home/USER/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:227

I updated the dependencies to look like this:

[dependencies]
piston = "0.52.1"
piston2d-graphics = "0.39.0"
pistoncore-glutin_window = "0.67.2"
piston2d-opengl_graphics = "0.76.0"

The issue does not occur with rust 1.47.0