Ggez: [BUG] attempted to leave type `platform::platform::x11::util::input::PointerState` uninitialized

Created on 23 Nov 2020  路  4Comments  路  Source: ggez/ggez

The whole application crashes on mouse over when compiling with Rust 1.48.

rustc --version
rustc 1.48.0 (7eac88abb 2020-11-16)

OS: Linux (Ubuntu 20.04)

To reproduce simply run a ggez example:

RUST_BACKTRACE=full cargo run --example 01_super_simple

and move the cursor over the window.

Finished dev [unoptimized + debuginfo] target(s) in 0.07s
     Running `target/debug/examples/01_super_simple`
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:     0x560e8f2c4580 - std::backtrace_rs::backtrace::libunwind::trace::h72c2fb8038f1bbee
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/../../backtrace/src/backtrace/libunwind.rs:96
   1:     0x560e8f2c4580 - std::backtrace_rs::backtrace::trace_unsynchronized::h1e3b084883f1e78c
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/../../backtrace/src/backtrace/mod.rs:66
   2:     0x560e8f2c4580 - std::sys_common::backtrace::_print_fmt::h3bf6a7ebf7f0394a
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/sys_common/backtrace.rs:79
   3:     0x560e8f2c4580 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h2e8cb764b7fe02e7
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/sys_common/backtrace.rs:58
   4:     0x560e8f2e736c - core::fmt::write::h7a1184eaee6a8644
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/core/src/fmt/mod.rs:1080
   5:     0x560e8f2c1062 - std::io::Write::write_fmt::haeeb374d93a67eac
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/io/mod.rs:1516
   6:     0x560e8f2c6cad - std::sys_common::backtrace::_print::h1d14a7f6ad632dc8
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/sys_common/backtrace.rs:61
   7:     0x560e8f2c6cad - std::sys_common::backtrace::print::h301abac8bb2e3e81
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/sys_common/backtrace.rs:48
   8:     0x560e8f2c6cad - std::panicking::default_hook::{{closure}}::hde0cb80358a6920a
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/panicking.rs:208
   9:     0x560e8f2c6958 - std::panicking::default_hook::h9b1a691049a0ec8f
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/panicking.rs:227
  10:     0x560e8f2c7391 - std::panicking::rust_panic_with_hook::h2bdec87b60580584
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/panicking.rs:577
  11:     0x560e8f2c6f39 - std::panicking::begin_panic_handler::{{closure}}::h101ca09d9df5db47
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/panicking.rs:484
  12:     0x560e8f2c49ec - std::sys_common::backtrace::__rust_end_short_backtrace::h3bb85654c20113ca
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/sys_common/backtrace.rs:153
  13:     0x560e8f2c6ef9 - rust_begin_unwind
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/panicking.rs:483
  14:     0x560e8f2e4f61 - core::panicking::panic_fmt::h48c31e1e3d550146
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/core/src/panicking.rs:85
  15:     0x560e8f2e4ead - core::panicking::panic::h184ede6dd822ffb4
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/core/src/panicking.rs:50
  16:     0x560e8ef7e011 - core::mem::uninitialized::h2cb405d678c8eec0
                               at /home/{user}/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/mem/mod.rs:658
  17:     0x560e8ef7e011 - winit::platform::platform::x11::util::input::<impl winit::platform::platform::x11::xdisplay::XConnection>::query_pointer::hf062727cb6530689
                               at /home/{user}/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.19.5/src/platform/linux/x11/util/input.rs:94
  18:     0x560e8ea5f54d - winit::platform::platform::x11::EventsLoop::process_event::h3eb09e55b62e85f1
                               at /home/{user}/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.19.5/src/platform/linux/x11/mod.rs:956
  19:     0x560e8ea594f2 - winit::platform::platform::x11::EventsLoop::poll_events::hcfe4bcdcf02754be
                               at /home/{user}/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.19.5/src/platform/linux/x11/mod.rs:270
  20:     0x560e8ea5375c - winit::platform::platform::EventsLoop::poll_events::h3dc00f459d55fafb
                               at /home/{user}/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.19.5/src/platform/linux/mod.rs:522
  21:     0x560e8ea538d7 - winit::EventsLoop::poll_events::h58b5445631fc4962
                               at /home/{user}/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.19.5/src/lib.rs:277
  22:     0x560e8ea54e07 - ggez::event::run::h0b2e5f3212a30983
                               at /tmp/ggez/src/event.rs:175
  23:     0x560e8ea562b1 - _01_super_simple::main::h390b6c9c4a78aaef
                               at /tmp/ggez/examples/01_super_simple.rs:48
  24:     0x560e8ea52e42 - core::ops::function::FnOnce::call_once::h3b6ce00f4f3d84d6
                               at /home/{user}/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:227
  25:     0x560e8ea4b88a - std::sys_common::backtrace::__rust_begin_short_backtrace::h5892065b4a9212e3
                               at /home/{user}/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys_common/backtrace.rs:137
  26:     0x560e8ea52096 - std::rt::lang_start::{{closure}}::h72ce8b5bd8c56c34
                               at /home/{user}/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/rt.rs:66
  27:     0x560e8f2c77b7 - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::he179d32a5d10d957
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/core/src/ops/function.rs:259
  28:     0x560e8f2c77b7 - std::panicking::try::do_call::hcb3d5e7be089b2b4
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/panicking.rs:381
  29:     0x560e8f2c77b7 - std::panicking::try::h7ac93b0cd56fb701
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/panicking.rs:345
  30:     0x560e8f2c77b7 - std::panic::catch_unwind::h7b40e396c93a4fcd
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/panic.rs:382
  31:     0x560e8f2c77b7 - std::rt::lang_start_internal::h142b9cc66267fea1
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/rt.rs:51
  32:     0x560e8ea52067 - std::rt::lang_start::h03b42314f7f55549
                               at /home/{user}/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/rt.rs:65
  33:     0x560e8ea563fa - main
  34:     0x7f5a79b4b0b3 - __libc_start_main
  35:     0x560e8ea4b10e - _start
  36:                0x0 - <unknown>

Seems to be related to https://github.com/amethyst/amethyst/issues/2524

Type-CODE dependency bug

Most helpful comment

If anyone would like to work off the devel branch on a recent stable/nightly, ggez can be used as a git dependency.

[dependencies]
ggez = { git = "https://github.com/ggez/ggez", branch = "devel" }

cargo update will help update deps and the lockfile periodically.

All 4 comments

Thanks for reporting this! It's a bug in winit, but hasn't even been reported yet there, presumably due to the current ggez using an old-ass version of winit. So I reported it: https://github.com/rust-windowing/winit/issues/1773

It's fixed on the ggez devel branch, due to using a newer version of winit. You can also work around this for now by using rustc 1.47 .

Going to close this, since it's fixed on devel and winit doesn't seem terribly inclined to make a new release. Sure can't blame them for that, under the circumstances, it's just annoying.

I can't use 1.47 stable because I use nightly features. For anyone else wondering: the last nightly before the offending commit was added to rustc is March 10 so this command will get you the newest compiler that doesn't have the problem: rustup override set nightly-2020-03-10

If anyone would like to work off the devel branch on a recent stable/nightly, ggez can be used as a git dependency.

[dependencies]
ggez = { git = "https://github.com/ggez/ggez", branch = "devel" }

cargo update will help update deps and the lockfile periodically.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

icefoxen picture icefoxen  路  4Comments

icefoxen picture icefoxen  路  5Comments

ellipticaldoor picture ellipticaldoor  路  3Comments

Catvert picture Catvert  路  5Comments

t-veor picture t-veor  路  5Comments