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

platform::platform::x11::util::input::PointerState` uninitialized, which is invalid #1811

Closed
amarao opened this issue Dec 30, 2020 · 2 comments

Comments

@amarao
Copy link

amarao commented Dec 30, 2020

After upgrading from Rust 1.47.0 to 1.48.0 existing code (based on piston) start to crash in event.next() if mouse is moved over the window (X, Linux).

Versions:
winit 0.19.5
piston 0.52.1
piston_window 0.116.0

The code to reproduce the problem: https://github.com/amarao/equart/tree/c20a1a6188da076ef3791f94ffa662a2da1ce00c

Under Rust 1.47.0 it's working without panic, with Rust 1.48.0 it's panicking:

thread 'main' panicked at 'attempted to leave type `platform::platform::x11::util::input::PointerState` uninitialized, which is invalid', /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/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: winit::platform::platform::x11::util::input::<impl winit::platform::platform::x11::xdisplay::XConnection>::query_pointer
   4: winit::platform::platform::x11::EventsLoop::process_event
   5: winit::platform::platform::EventsLoop::poll_events
   6: glutin_window::GlutinWindow::poll_event
   7: <glutin_window::GlutinWindow as window::Window>::poll_event
   8: event_loop::Events::next
   9: equart::main
@maroider
Copy link
Member

Older versions of Winit aren't really supported.

Getting PistonDevelopers/glutin_window#179 merged is probably your best shot at getting rid of this error.

@msiglreith
Copy link
Member

Closing as discussed in #1773 and #1778
Resolution was that 0.19 won't be patched and latest winit version should be used as maroider already mentioned

gstreamer-github pushed a commit to sdroege/gstreamer-rs that referenced this issue Apr 11, 2021
Winit 0.19 uses uninitialized variables which is invalid since Rust
1.48, leading to a runtime panic [1].  Updating to the latest version
resolves these issues but requires significant refactoring since the
event loop now runs entirely within a closure.

[1]: rust-windowing/winit#1811
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants