Skip to content
This repository has been archived by the owner on Apr 18, 2022. It is now read-only.

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

Closed
vilunov opened this issue Nov 20, 2020 · 15 comments · Fixed by #2554
Closed
Assignees
Labels
pri: important Something other teams are relying on, or a low-level, critical piece of functionality. type: bug Something is not working as it should.

Comments

@vilunov
Copy link

vilunov commented Nov 20, 2020

Description

Every showcase game and some examples crash after hovering the cursor over the opened window.

Reproduction Steps

  1. cargo run --example animation --features vulkan
  2. Move the cursor over the window
  3. Observe the crash

Screenshots and Logs

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
             at ./examples/animation/main.rs:242
  18: core::ops::function::FnOnce::call_once
             at /home/nikita/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:227

Your Environment

  1. OS: Arch Linux
  2. Amethyst: current master head, 006e70d57f0a30963d4dab91ae947a6433b26734
  3. rustc/cargo: 1.48.0

Additional Context

This is run using vulkan on integrated AMD GPU, which works fine in games. Relevant vulkan packages are also installed, let me know if I should install something else.

@vilunov vilunov added status: needs triage type: bug Something is not working as it should. labels Nov 20, 2020
@starkat99
Copy link

starkat99 commented Nov 21, 2020

Was trying to setup a brand new project using current stable amethyst (0.15.3), and also getting this exact same crash using vulkan on an Intel gpu.

Minimal code that causes crash:

use amethyst::{
    prelude::*,
    renderer::{plugins::RenderToWindow, types::DefaultBackend, RenderingBundle},
    utils::application_root_dir,
};

struct MainMenuState;
impl SimpleState for MainMenuState {}

fn main() -> amethyst::Result<()> {
    amethyst::start_logger(Default::default());

    let app_root = application_root_dir()?;
    let resources = app_root.join("data");
    let display_config = app_root.join("config/display_config.ron");

    let game_data = GameDataBuilder::default().with_bundle(
        RenderingBundle::<DefaultBackend>::new()
            .with_plugin(RenderToWindow::from_config_path(display_config)?),
    )?;

    let mut game = Application::new(resources, MainMenuState, game_data)?;
    game.run();

    Ok(())
}

display_config.ron:

(
    title: "Test",
    dimensions: Some((800, 600))
)

@ncmd
Copy link

ncmd commented Nov 21, 2020

Encountered the same issue.

Running on Pop OS 20.04, amd 5700XT, amethyst version 0.15.3

I think it was caused by the recent version of rust 1.48.0 https://github.com/rust-lang/rust/blob/master/RELEASES.md

I solved this issue by reverting rust to version 1.47.0 and it fixed the issue
rustup default 1.47.0

@vini84200
Copy link

I have the same issue.
I am running it on Debian 10, and just started to learn Amethyst and I found this issue while following the Book.

@dariusc93
Copy link

Look like it would be best to remain on 1.47.0 until winit is updated on amethyst.

@ghost
Copy link

ghost commented Dec 14, 2020

Got the same issue. Only I got nvidia GPU.

@hojjatabdollahi
Copy link

I tried to run the tutorial. I get this error.
Pop!_OS 20.10, Nvidia 1080Ti.
Reverted Rust to 1.47 and it's working.

@AlveLarsson AlveLarsson added the pri: important Something other teams are relying on, or a low-level, critical piece of functionality. label Dec 19, 2020
@AlveLarsson AlveLarsson added this to the 0.16.0 - Legion milestone Dec 19, 2020
@ezpuzz
Copy link
Contributor

ezpuzz commented Dec 19, 2020

Hi all, thanks for reporting. Our winit dependency is getting out of date and causing issues. I'm going to see what it'll take to get it updated.

@ezpuzz ezpuzz added this to To do in Legion integration via automation Dec 19, 2020
@ezpuzz ezpuzz self-assigned this Dec 19, 2020
@ezpuzz ezpuzz linked a pull request Dec 21, 2020 that will close this issue
@ezpuzz
Copy link
Contributor

ezpuzz commented Dec 21, 2020

hell y'all, if anyone would be kind enough to try out #2554 and see if the issue is resolve that would be most kind. just point your cargo.toml to the branch. it's based on 0.16 legion though so you may need to ask in discord if you get stuck.

legion docs are coming soon! refer to the working examples in that PR until then.

@ezpuzz
Copy link
Contributor

ezpuzz commented Dec 22, 2020

merged to legion_v2 branch if anyone is willing to run those examples

@ezpuzz
Copy link
Contributor

ezpuzz commented Dec 23, 2020

fixed on legion_v2 by #2554

@kainarchai
Copy link

fixed on legion_v2 by #2554

error: failed to get `atelier-assets` as a dependency of package `amethyst_assets v0.15.3 (https://github.com/amethyst/amethyst?branch=legion_v2#17bcb1fa)`
    ... which is depended on by `amethyst v0.15.3 (https://github.com/amethyst/amethyst?branch=legion_v2#17bcb1fa)`
    ... which is depended on by `pong v0.1.0 (/home/usr/code/rust/pong)`

Caused by:
  failed to load source for dependency `atelier-assets`

Caused by:
  Unable to update https://github.com/radium-io/atelier-assets.git?rev=de0e3ab231cabd95c355ebd7da57be8a6405562a

Caused by:
  revspec 'de0e3ab231cabd95c355ebd7da57be8a6405562a' not found; class=Reference (4); code=NotFound (-3)

Can you please update the revision of atelier-assets?

@vitiral
Copy link

vitiral commented Apr 1, 2021

This is still happening for me following the book tutorial

[package]
name = "amethyst-starter-2d"
version = "0.2.0"

dependencies]
amethyst = {version = "0.15.2", features = ["no-slow-safety-checks"]}

rustup show

stable-x86_64-unknown-linux-gnu (default)
rustc 1.51.0 (2fd73fabe 2021-03-23)

@camdendotlol
Copy link

This is still happening for me following the book tutorial

Same here, it's because Cargo only fetches the latest crate release, which is 0.15.3 and predates the fix for this bug.

Until Amethyst 0.16.0 comes out, you can avoid the bug by going into the project folder and running rustup override set 1.47.0 which will tell the compiler to use an old Rust version for that project only, without affecting the global default.

@nblei
Copy link

nblei commented Nov 25, 2021

This is still happening for me following the book tutorial

Same here, it's because Cargo only fetches the latest crate release, which is 0.15.3 and predates the fix for this bug.

Until Amethyst 0.16.0 comes out, you can avoid the bug by going into the project folder and running rustup override set 1.47.0 which will tell the compiler to use an old Rust version for that project only, without affecting the global default.

This leads to (on attempting to build pong_tutorial_01 from the main branch (a4d8771)):

error[E0391]: cycle detected when computing the supertraits of `into_mint::IntoMint`
  --> /home/nathan/.cargo/registry/src/github.com-1ecc6299db9ec823/mint-0.5.8/src/into_mint.rs:10:1
   |
10 | pub trait IntoMint: Into<Self::MintType> {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: ...which again requires computing the supertraits of `into_mint::IntoMint`, completing the cycle
note: cycle used when collecting item types in module `into_mint`
  --> /home/nathan/.cargo/registry/src/github.com-1ecc6299db9ec823/mint-0.5.8/src/into_mint.rs:10:1
   |
10 | pub trait IntoMint: Into<Self::MintType> {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to previous error

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
pri: important Something other teams are relying on, or a low-level, critical piece of functionality. type: bug Something is not working as it should.
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

13 participants