avandolder/tetrominoes-rust

issue on cargo run

Opened this issue · 2 comments

this is what issue showed up:

    Finished dev [optimized + debuginfo] target(s) in 0.14s
     Running `target/debug/tetrominoes`
thread 'main' panicked at 'attempted to leave type `std::mem::ManuallyDrop<xlib::Xlib>` uninitialized, which is invalid', /build/rust/src/rustc-1.52.1-src/library/core/src/mem/mod.rs:660:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

and this is the issue with a rust backtrace:

    Finished dev [optimized + debuginfo] target(s) in 0.14s
     Running `target/debug/tetrominoes`
thread 'main' panicked at 'attempted to leave type `std::mem::ManuallyDrop<xlib::Xlib>` uninitialized, which is invalid', /build/rust/src/rustc-1.52.1-src/library/core/src/mem/mod.rs:660:9
stack backtrace:
   0: rust_begin_unwind
             at /build/rust/src/rustc-1.52.1-src/library/std/src/panicking.rs:493:5
   1: core::panicking::panic_fmt
             at /build/rust/src/rustc-1.52.1-src/library/core/src/panicking.rs:92:14
   2: core::panicking::panic
             at /build/rust/src/rustc-1.52.1-src/library/core/src/panicking.rs:50:5
   3: core::mem::uninitialized
             at /build/rust/src/rustc-1.52.1-src/library/core/src/mem/mod.rs:660:9
   4: x11_dl::xlib::Xlib::open
             at /home/bachittle/.cargo/registry/src/github.com-1ecc6299db9ec823/x11-dl-2.18.3/src/link.rs:59:17
   5: winit::platform::platform::x11::xdisplay::XConnection::new
             at /home/bachittle/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.19.2/src/platform/linux/x11/xdisplay.rs:34:20
   6: <winit::platform::platform::X11_BACKEND as core::ops::deref::Deref>::deref::__static_ref_initialize
             at /home/bachittle/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.19.2/src/platform/linux/mod.rs:54:20
   7: core::ops::function::FnOnce::call_once
             at /build/rust/src/rustc-1.52.1-src/library/core/src/ops/function.rs:227:5
   8: lazy_static::lazy::Lazy<T>::get::{{closure}}
             at /home/bachittle/.cargo/registry/src/github.com-1ecc6299db9ec823/lazy_static-1.3.0/src/inline_lazy.rs:28:29
   9: std::sync::once::Once::call_once::{{closure}}
             at /build/rust/src/rustc-1.52.1-src/library/std/src/sync/once.rs:261:41
  10: std::sync::once::Once::call_inner
             at /build/rust/src/rustc-1.52.1-src/library/std/src/sync/once.rs:418:21
  11: std::sync::once::Once::call_once
             at /build/rust/src/rustc-1.52.1-src/library/std/src/sync/once.rs:261:9
  12: lazy_static::lazy::Lazy<T>::get
             at /home/bachittle/.cargo/registry/src/github.com-1ecc6299db9ec823/lazy_static-1.3.0/src/inline_lazy.rs:27:9
  13: <winit::platform::platform::X11_BACKEND as core::ops::deref::Deref>::deref::__stability
             at /home/bachittle/.cargo/registry/src/github.com-1ecc6299db9ec823/lazy_static-1.3.0/src/lib.rs:138:21
  14: <winit::platform::platform::X11_BACKEND as core::ops::deref::Deref>::deref
             at /home/bachittle/.cargo/registry/src/github.com-1ecc6299db9ec823/lazy_static-1.3.0/src/lib.rs:140:17
  15: winit::platform::platform::EventsLoop::new_x11
             at /home/bachittle/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.19.2/src/platform/linux/mod.rs:468:9
  16: winit::platform::platform::EventsLoop::new
             at /home/bachittle/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.19.2/src/platform/linux/mod.rs:449:29
  17: winit::EventsLoop::new
             at /home/bachittle/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.19.2/src/lib.rs:250:26
  18: ggez::context::Context::from_conf
             at /home/bachittle/.cargo/registry/src/github.com-1ecc6299db9ec823/ggez-0.5.1/src/context.rs:85:27
  19: ggez::context::ContextBuilder::build
             at /home/bachittle/.cargo/registry/src/github.com-1ecc6299db9ec823/ggez-0.5.1/src/context.rs:304:9
  20: tetrominoes::main
             at ./src/main.rs:54:34
  21: core::ops::function::FnOnce::call_once
             at /build/rust/src/rustc-1.52.1-src/library/core/src/ops/function.rs:227:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Hm. Well I'm experiencing the same issue when I try to run it under my recent Arch Linux install. It also fails under WSL/Ubuntu in the same way. I'm guessing x11_dl broke at some point. I'll see if I can find a fix.

It seems to build & run under Windows just fine, so it definitely seems like an issue with just the X11 backend.