Example: attempted to leave type `platform::platform::x11::util::input::PointerState`
This error occures when the example is run.
thread 'main' panicked at 'attempted to leave type `platform::platform::x11::util::input::PointerState` uninitialized, which is invalid', /home/nelson/.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/nelson/.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/nelson/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.19.5/src/platform/linux/x11/util/input.rs:94
5: winit::platform::platform::x11::window::UnownedWindow::new::{{closure}}
at /home/nelson/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.19.5/src/platform/linux/x11/window.rs:91
6: core::option::Option<T>::unwrap_or_else
at /home/nelson/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs:424
7: winit::platform::platform::x11::window::UnownedWindow::new
at /home/nelson/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.19.5/src/platform/linux/x11/window.rs:90
8: winit::platform::platform::x11::Window::new
at /home/nelson/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.19.5/src/platform/linux/x11/mod.rs:1368
9: winit::platform::platform::Window::new
at /home/nelson/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.19.5/src/platform/linux/mod.rs:148
10: winit::window::<impl winit::WindowBuilder>::build
at /home/nelson/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.19.5/src/window.rs:157
11: glutin::platform::platform::x11::Context::new_impl
at /home/nelson/.cargo/registry/src/github.com-1ecc6299db9ec823/glutin-0.21.2/src/platform/linux/x11.rs:422
12: glutin::platform::platform::x11::Context::new::{{closure}}
at /home/nelson/.cargo/registry/src/github.com-1ecc6299db9ec823/glutin-0.21.2/src/platform/linux/x11.rs:351
13: glutin::platform::platform::x11::Context::try_then_fallback
at /home/nelson/.cargo/registry/src/github.com-1ecc6299db9ec823/glutin-0.21.2/src/platform/linux/x11.rs:89
14: glutin::platform::platform::x11::Context::new
at /home/nelson/.cargo/registry/src/github.com-1ecc6299db9ec823/glutin-0.21.2/src/platform/linux/x11.rs:350
15: glutin::platform::platform::Context::new_windowed
at /home/nelson/.cargo/registry/src/github.com-1ecc6299db9ec823/glutin-0.21.2/src/platform/linux/mod.rs:111
16: glutin::windowed::<impl glutin::ContextBuilder<T>>::build_windowed
at /home/nelson/.cargo/registry/src/github.com-1ecc6299db9ec823/glutin-0.21.2/src/windowed.rs:349
17: glutin_window::GlutinWindow::new
at /home/nelson/.cargo/registry/src/github.com-1ecc6299db9ec823/pistoncore-glutin_window-0.67.1/src/lib.rs:120
18: <glutin_window::GlutinWindow as window::BuildFromWindowSettings>::build_from_window_settings
at /home/nelson/.cargo/registry/src/github.com-1ecc6299db9ec823/pistoncore-glutin_window-0.67.1/src/lib.rs:483
19: window::WindowSettings::build
at /home/nelson/.cargo/registry/src/github.com-1ecc6299db9ec823/pistoncore-window-0.47.0/src/lib.rs:467
20: <piston_window::PistonWindow<W> as window::BuildFromWindowSettings>::build_from_window_settings
at /home/nelson/.cargo/registry/src/github.com-1ecc6299db9ec823/piston_window-0.116.0/src/lib.rs:191
21: window::WindowSettings::build
at /home/nelson/.cargo/registry/src/github.com-1ecc6299db9ec823/pistoncore-window-0.47.0/src/lib.rs:467
22: maze_game::main
at ./src/main.rs:4
23: core::ops::function::FnOnce::call_once
at /home/nelson/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:227
OS: Arch Linux 5.9.10 wm: i3-wm Rust: 1.4.8.0
Similar here except thread 'main' panicked at 'attempted to leave type std::mem::ManuallyDropxlib::Xlib uninitialized, which is invalid', /build/rust/src/rustc-1.48.0-src/library/core/src/mem/mod.rs:658:9
This is when I try to compile hematite, however it seems to be a bug with piston rather than hematite.
stack backtrace:
0: 0x560deea39f50 - std::backtrace_rs::backtrace::libunwind::trace::h3244117ea50123fe
at /build/rust/src/rustc-1.48.0-src/library/std/src/../../backtrace/src/backtrace/libunwind.rs:96
1: 0x560deea39f50 - std::backtrace_rs::backtrace::trace_unsynchronized::h68c610493487144f
at /build/rust/src/rustc-1.48.0-src/library/std/src/../../backtrace/src/backtrace/mod.rs:66
2: 0x560deea39f50 - std::sys_common::backtrace::_print_fmt::h98a015f47bac7d62
at /build/rust/src/rustc-1.48.0-src/library/std/src/sys_common/backtrace.rs:79
3: 0x560deea39f50 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hc852ad3e88e43049
at /build/rust/src/rustc-1.48.0-src/library/std/src/sys_common/backtrace.rs:58
4: 0x560deea5b9bc - core::fmt::write::h5437b03347b2ec7a
at /build/rust/src/rustc-1.48.0-src/library/core/src/fmt/mod.rs:1080
5: 0x560deea35f85 - std::io::Write::write_fmt::h1c132b3b8a60ce2f
at /build/rust/src/rustc-1.48.0-src/library/std/src/io/mod.rs:1516
6: 0x560deea3c33d - std::sys_common::backtrace::_print::hdfae0c73b5d1550a
at /build/rust/src/rustc-1.48.0-src/library/std/src/sys_common/backtrace.rs:61
7: 0x560deea3c33d - std::sys_common::backtrace::print::h846d8b35d353226f
at /build/rust/src/rustc-1.48.0-src/library/std/src/sys_common/backtrace.rs:48
8: 0x560deea3c33d - std::panicking::default_hook::{{closure}}::h611a677a9567debb
at /build/rust/src/rustc-1.48.0-src/library/std/src/panicking.rs:208
9: 0x560deea3bfe8 - std::panicking::default_hook::hfc5e7967f3ac8efb
at /build/rust/src/rustc-1.48.0-src/library/std/src/panicking.rs:227
10: 0x560deea3ca21 - std::panicking::rust_panic_with_hook::h86da1db1d0779194
at /build/rust/src/rustc-1.48.0-src/library/std/src/panicking.rs:577
11: 0x560deea3c5c9 - std::panicking::begin_panic_handler::{{closure}}::h8deb4831e8e5befc
at /build/rust/src/rustc-1.48.0-src/library/std/src/panicking.rs:484
12: 0x560deea3a3bc - std::sys_common::backtrace::__rust_end_short_backtrace::h67eb25f573b71150
at /build/rust/src/rustc-1.48.0-src/library/std/src/sys_common/backtrace.rs:153
13: 0x560deea3c589 - rust_begin_unwind
at /build/rust/src/rustc-1.48.0-src/library/std/src/panicking.rs:483
14: 0x560deea59551 - core::panicking::panic_fmt::h8d2c19297fe96b44
at /build/rust/src/rustc-1.48.0-src/library/core/src/panicking.rs:85
15: 0x560deea5949d - core::panicking::panic::hfbe00deb325a44ca
at /build/rust/src/rustc-1.48.0-src/library/core/src/panicking.rs:50
16: 0x560dee56b15e - core::mem::uninitialized::h3189cb94ebf13ecf
at /build/rust/src/rustc-1.48.0-src/library/core/src/mem/mod.rs:658
17: 0x560dee56b15e - x11_dl::xlib::Xlib::open::h8eea26f83c009d12
at /home/james/.cargo/registry/src/github.com-1ecc6299db9ec823/x11-dl-2.18.3/src/link.rs:59
18: 0x560dee345f41 - winit::platform::platform::x11::xdisplay::XConnection::new::h9703abfe8de28c65
at /home/james/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.18.1/src/platform/linux/x11/xdisplay.rs:32
19: 0x560dee35cfae - <winit::platform::platform::X11_BACKEND as core::ops::deref::Deref>::deref::__static_ref_initialize::hca32642242eb6189
at /home/james/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.18.1/src/platform/linux/mod.rs:54
20: 0x560dee35cfae - core::ops::function::FnOnce::call_once::he7751a7195e3ce40
at /build/rust/src/rustc-1.48.0-src/library/core/src/ops/function.rs:227
21: 0x560dee370092 - lazy_static::lazy::Lazy<T>::get::{{closure}}::hc4ab265c6de27255
at /home/james/.cargo/registry/src/github.com-1ecc6299db9ec823/lazy_static-1.2.0/src/inline_lazy.rs:28
22: 0x560dee30232f - std::sync::once::Once::call_once::{{closure}}::h7439fd5986755c0e
at /build/rust/src/rustc-1.48.0-src/library/std/src/sync/once.rs:261
23: 0x560deea397f2 - std::sync::once::Once::call_inner::hb95f64afa5be7c39
at /build/rust/src/rustc-1.48.0-src/library/std/src/sync/once.rs:419
24: 0x560dee301db1 - std::sync::once::Once::call_once::h2ced4b55d21f2afa
at /build/rust/src/rustc-1.48.0-src/library/std/src/sync/once.rs:261
25: 0x560dee36fcb9 - lazy_static::lazy::Lazy<T>::get::h13ef9051b9fe3119
at /home/james/.cargo/registry/src/github.com-1ecc6299db9ec823/lazy_static-1.2.0/src/inline_lazy.rs:27
26: 0x560dee36fcb9 - <winit::platform::platform::X11_BACKEND as core::ops::deref::Deref>::deref::__stability::he477ceda8d0f251b
at /home/james/.cargo/registry/src/github.com-1ecc6299db9ec823/lazy_static-1.2.0/src/lib.rs:139
27: 0x560dee36fcb9 - <winit::platform::platform::X11_BACKEND as core::ops::deref::Deref>::deref::hac9e3d271df73633
at /home/james/.cargo/registry/src/github.com-1ecc6299db9ec823/lazy_static-1.2.0/src/lib.rs:141
28: 0x560dee36f994 - winit::platform::platform::EventsLoop::new_x11::h17d75848023c9d24
at /home/james/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.18.1/src/platform/linux/mod.rs:459
29: 0x560dee36f642 - winit::platform::platform::EventsLoop::new::hbac614062757cb58
at /home/james/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.18.1/src/platform/linux/mod.rs:440
30: 0x560dee2cba81 - winit::EventsLoop::new::h3a0c4ce2012f24b2
at /home/james/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.18.1/src/lib.rs:247
31: 0x560dee231449 - glutin_window::GlutinWindow::new::hda66dbf7007dc911
at /home/james/.cargo/registry/src/github.com-1ecc6299db9ec823/pistoncore-glutin_window-0.54.0/src/lib.rs:104
32: 0x560dee234357 - <glutin_window::GlutinWindow as window::BuildFromWindowSettings>::build_from_window_settings::h76772491b19a3982
at /home/james/.cargo/registry/src/github.com-1ecc6299db9ec823/pistoncore-glutin_window-0.54.0/src/lib.rs:441
33: 0x560dee1d6d77 - window::WindowSettings::build::hea96905431a83e1e
at /home/james/.cargo/registry/src/github.com-1ecc6299db9ec823/pistoncore-window-0.37.0/src/lib.rs:460
34: 0x560dee1d3a13 - hematite::main::h16d81b6add05f12c
at /home/james/Build/hematite/src/main.rs:132
35: 0x560dee14739b - core::ops::function::FnOnce::call_once::hd02b6f27f8941098
at /build/rust/src/rustc-1.48.0-src/library/core/src/ops/function.rs:227
36: 0x560dee14176e - std::sys_common::backtrace::__rust_begin_short_backtrace::hd650e2a32ffe97f5
at /build/rust/src/rustc-1.48.0-src/library/std/src/sys_common/backtrace.rs:137
37: 0x560dee141bc1 - std::rt::lang_start::{{closure}}::h268b9fd503ab125a
at /build/rust/src/rustc-1.48.0-src/library/std/src/rt.rs:66
38: 0x560deea3cf37 - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::hba2eeded6e43561f
at /build/rust/src/rustc-1.48.0-src/library/core/src/ops/function.rs:259
39: 0x560deea3cf37 - std::panicking::try::do_call::h2d2f9a7ece5d85e2
at /build/rust/src/rustc-1.48.0-src/library/std/src/panicking.rs:381
40: 0x560deea3cf37 - std::panicking::try::he67fa7d0004e7010
at /build/rust/src/rustc-1.48.0-src/library/std/src/panicking.rs:345
41: 0x560deea3cf37 - std::panic::catch_unwind::h61fcdf94f063131b
at /build/rust/src/rustc-1.48.0-src/library/std/src/panic.rs:382
42: 0x560deea3cf37 - std::rt::lang_start_internal::h0c3b9dc1678c8c77
at /build/rust/src/rustc-1.48.0-src/library/std/src/rt.rs:51
43: 0x560dee141b97 - std::rt::lang_start::hc60de2d2af6015f2
at /build/rust/src/rustc-1.48.0-src/library/std/src/rt.rs:65
44: 0x560dee1d644a - main
45: 0x7fed07de5152 - __libc_start_main
46: 0x560dee12d11e - _start
47: 0x0 - <unknown>
I'm also experiencing this problem, it seems to happen when you move the cursor directly over the progam.
I also seem to get a different error now:
thread 'main' panicked at 'attempted to leave type `&back_end::PositionFormat` uninitialized, which is invalid', /home/jonathan/.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/jonathan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/mem/mod.rs:658
4: <gfx_graphics::back_end::PositionFormat as gfx::pso::buffer::Structure<gfx_core::format::Format>>::query
at /home/jonathan/.cargo/registry/src/github.com-1ecc6299db9ec823/gfx-0.12.2/src/macros/structure.rs:32
5: <gfx::pso::buffer::VertexBufferCommon<T,I> as gfx::pso::DataLink>::link_input
at /home/jonathan/.cargo/registry/src/github.com-1ecc6299db9ec823/gfx-0.12.2/src/pso/buffer.rs:79
6: <gfx_graphics::back_end::pipe_colored::Init as gfx::pso::PipelineInit>::link_to
at /home/jonathan/.cargo/registry/src/github.com-1ecc6299db9ec823/gfx-0.12.2/src/macros/pso.rs:46
7: gfx::factory::FactoryExt::create_pipeline_from_program
at /home/jonathan/.cargo/registry/src/github.com-1ecc6299db9ec823/gfx-0.12.2/src/factory.rs:171
8: gfx_graphics::back_end::Gfx2d<R>::new::{{closure}}
at /home/jonathan/.cargo/registry/src/github.com-1ecc6299db9ec823/piston2d-gfx_graphics-0.31.2/src/back_end.rs:215
9: gfx_graphics::back_end::PsoStencil<T>::new
at /home/jonathan/.cargo/registry/src/github.com-1ecc6299db9ec823/piston2d-gfx_graphics-0.31.2/src/back_end.rs:123
10: gfx_graphics::back_end::Gfx2d<R>::new
at /home/jonathan/.cargo/registry/src/github.com-1ecc6299db9ec823/piston2d-gfx_graphics-0.31.2/src/back_end.rs:230
11: piston_window::PistonWindow<W>::new
at /home/jonathan/.cargo/registry/src/github.com-1ecc6299db9ec823/piston_window-0.51.1/src/lib.rs:188
12: <piston_window::PistonWindow<W> as window::BuildFromWindowSettings>::build_from_window_settings
at /home/jonathan/.cargo/registry/src/github.com-1ecc6299db9ec823/piston_window-0.51.1/src/lib.rs:146
13: window::WindowSettings::build
at /home/jonathan/.cargo/registry/src/github.com-1ecc6299db9ec823/pistoncore-window-0.21.0/src/lib.rs:349
14: pendulum::main
at ./src/main.rs:11
15: core::ops::function::FnOnce::call_once
at /home/jonathan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:227
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
The same issue on the amethyst issue tracker mentions downgrading to Rust 1.47.0 as a possible workaround for now.
rustup default 1.47.0
thread 'main' panicked at 'attempted to leave type `platform::platform::x11::util::input::PointerState` uninitialized, which is invalid', /home/rishit/.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/rishit/.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/rishit/.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/rishit/.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/rishit/.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/rishit/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.19.5/src/platform/linux/mod.rs:522
8: winit::EventsLoop::poll_events
at /home/rishit/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.19.5/src/lib.rs:277
9: glutin_window::GlutinWindow::poll_event
at /home/rishit/.cargo/registry/src/github.com-1ecc6299db9ec823/pistoncore-glutin_window-0.67.2/src/lib.rs:231
10: <glutin_window::GlutinWindow as window::Window>::poll_event
at /home/rishit/.cargo/registry/src/github.com-1ecc6299db9ec823/pistoncore-glutin_window-0.67.2/src/lib.rs:476
11: event_loop::Events::next
at /home/rishit/.cargo/registry/src/github.com-1ecc6299db9ec823/pistoncore-event_loop-0.52.0/src/lib.rs:253
12: piston::main
at ./src/main.rs:67
13: core::ops::function::FnOnce::call_once
at /home/rishit/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:227
this is the error i am getting with RUST_BACKTRACE=1
i am using PopOS 20.04
From the linked issue, it seems like this is down to rust 1.48.0 not working with winit 0.19.5. updating pistoncore-glutin_window to a recent version of glutin that uses a recent version of winit seemed a bit too involved for me as an outsider.