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

[BUG] attempted to leave type platform::platform::x11::util::input::PointerState uninitialized #1773

Closed
icefoxen opened this issue Nov 25, 2020 · 6 comments

Comments

@icefoxen
Copy link
Contributor

icefoxen commented Nov 25, 2020

This is a bug with winit 0.19, so I dunno if it's reasonable to expect a fix, but this appears to be hitting a couple different projects so it deserves to be consolidated here.

Characteristic backtrace:

Thread 'main' panicked at 'attempted to leave type `platform::platform::x11::util::input::PointerState` uninitialized, which is invalid', /home/nikita/.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/nikita/.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/nikita/.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/nikita/.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/nikita/.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/nikita/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.19.5/src/platform/linux/mod.rs:522
   8: winit::EventsLoop::poll_events
             at /home/nikita/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.19.5/src/lib.rs:277
   9: <amethyst_window::system::EventsLoopSystem as shred::system::RunNow>::run_now
             at ./amethyst_window/src/system.rs:116
  10: shred::dispatch::dispatcher::Dispatcher::dispatch_thread_local
             at /home/nikita/.cargo/registry/src/github.com-1ecc6299db9ec823/shred-0.10.2/src/dispatch/dispatcher.rs:113
  11: shred::dispatch::dispatcher::Dispatcher::dispatch
             at /home/nikita/.cargo/registry/src/github.com-1ecc6299db9ec823/shred-0.10.2/src/dispatch/dispatcher.rs:65
  12: amethyst::game_data::GameData::update
             at ./src/game_data.rs:47
  13: <T as amethyst::state::State<amethyst::game_data::GameData,amethyst::state_event::StateEvent>>::update
             at ./src/state.rs:345
  14: amethyst::state::StateMachine<T,E>::update
             at ./src/state.rs:447
  15: amethyst::app::CoreApplication<T,E,R>::advance_frame
             at ./src/app.rs:381
  16: amethyst::app::CoreApplication<T,E,R>::run
             at ./src/app.rs:245
  17: animation::main

Downstream bugs:

This occurs on Rust 1.48+ due to tightening some constraints over what can be non-initialized: rust-lang/rust#66059

@chrisduerr
Copy link
Contributor

The latest version of winit is 0.23.0, not 0.19.5. Have you confirmed that this issue is still present in the latest winit version?

@icefoxen
Copy link
Contributor Author

Confirmed that winit 0.23 works fine. Upgrading out of winit 0.19 is just a breaking change for ggez, so it's kind of tricky. It doesn't look like there's a branch for winit 0.19, so I presume submitting a patch to fix it wouldn't result in a winit 0.19.6 with this fixed.

@chrisduerr
Copy link
Contributor

See, having ggez on an ancient winit version has already caused this one bug with maintenance overhead. For winit there's no good reason to keep supporting it. There's nothing inherently wrong with new winit versions and forcing downstream to update only has benefits for winit.

It's not like 0.19 is a LTS release or anything like that. The only supported version of winit is the latest one and everyone is encouraged to update that. If previous versions suddenly break completely, that's just more of an incentive to update as far as winit is concerned.

So realistically I feel like allowing patches to 0.19 would just make the situation worse. Any effort put in to support that old version, review code, write that code and maintain it, would be much better spent updating ggez to the latest winit version.

@kchibisov
Copy link
Member

So realistically I feel like allowing patches to 0.19 would just make the situation worse. Any effort put in to support that old version, review code, write that code and maintain it, would be much better spent updating ggez to the latest winit version.

I'm against patching 0.19.x, since Wayland is entirely broken on it, and bringing it up to date on it is insane amount of work, which I won't do. So please, don't use 0.19.x.

@memoryruins
Copy link

ggez is already on the latest winit version on the devel branch. Since there are other libraries running into this issue, I appreciate that you opened this to link to @icefoxen ^^

@icefoxen
Copy link
Contributor Author

icefoxen commented Dec 1, 2020

Yeah, it's perfectly reasonable to not support/patch 0.19. Just wanted to have a single point to gather info/links for people having this problem and what the solution is. Using Rust 1.47 works fine, and updating Winit works fine, so. ❤️

bors-servo added a commit to servo/pathfinder that referenced this issue Jun 6, 2021
Update canvas_nanovg example

The `canvas_nanovg` example would not run on my Linux machine due to the bug in `winit` 0.19 (rust-windowing/winit#1773)

In this PR, I updated `winit` and `surfman` and made the minimum necessary changes so that the example would compile and run.
tgockel added a commit to tgockel/rendology that referenced this issue Aug 12, 2021
This change updates to the latest version of glium (0.30), which brings
glutin to version 0.27 and winit to 0.25. This fixes known issue
[#1773](rust-windowing/winit#1773) in winit
0.19 on Linux X11.

The key stubstanitive change to the examples is the change from glutin's
`EventsLoop` to `EventLoop`. Instead of a user-defined while loop where
`EventsLoop::poll_events` is called, `EventLoop` has switched to a run
function which is event-driven by glutin's core. This slightly changes
the program structure.

The other changes are minor, as glutin moved a few data structures into
modules instead of having everything visible at the top-level.
tmfink added a commit to tmfink/winit that referenced this issue Jan 5, 2022
The latest published surfman (0.4.3) expects winit 0.24.

Upstream winit issue:
rust-windowing#1773
tmfink added a commit to tmfink/pathfinder that referenced this issue Jan 5, 2022
The latest published surfman (0.4.3) expects winit 0.24.

Upstream winit issue:
rust-windowing/winit#1773
leod pushed a commit to leod/rendology that referenced this issue Jun 3, 2023
This change updates to the latest version of glium (0.30), which brings
glutin to version 0.27 and winit to 0.25. This fixes known issue
[#1773](rust-windowing/winit#1773) in winit
0.19 on Linux X11.

The key stubstanitive change to the examples is the change from glutin's
`EventsLoop` to `EventLoop`. Instead of a user-defined while loop where
`EventsLoop::poll_events` is called, `EventLoop` has switched to a run
function which is event-driven by glutin's core. This slightly changes
the program structure.

The other changes are minor, as glutin moved a few data structures into
modules instead of having everything visible at the top-level.
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

4 participants