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

[BUG] Winit/X11 panic when running examples in legion_v2. #2326

Closed
dkushner opened this issue Jun 22, 2020 · 1 comment
Closed

[BUG] Winit/X11 panic when running examples in legion_v2. #2326

dkushner opened this issue Jun 22, 2020 · 1 comment
Labels
type: bug Something is not working as it should.

Comments

@dkushner
Copy link
Collaborator

dkushner commented Jun 22, 2020

Description

Running examples results in a panic related to X11 and Winit.

Reproduction Steps

  1. Check out dkushner@f96f2d9
  2. Run cargo run --example material --features "vulkan"
  3. See panic message similar to the one disclosed below.

What You Expected to Happen

The given example to build and run on a standard Ubuntu 18.04 system with X11 in use.

What Actually Happened

Attempting to run the example resulted in a runtime panic that appears to be related to X11 and the process by which Winit creates the X11 window.

Screenshots and Logs

Output attempting to run an example:

[INFO][amethyst::app] Initializing Amethyst...
[INFO][amethyst::app] Version: 0.15.0
[INFO][amethyst::app] Platform: x86_64-unknown-linux-gnu
[INFO][amethyst::app] Amethyst git commit: 7ad06fdf95fd073cf1ed3ed8917d233d3af2223b
[INFO][amethyst::app] Rustc version: 1.44.1 Stable
[INFO][amethyst::app] Rustc git commit: c7087fe00d2ba919df1d813c040a5d47e43b0fe7
thread 'main' panicked at 'attempted to leave type `std::mem::ManuallyDrop<xlib_xcb::Xlib_xcb>` uninitialized, which is invalid', /home/davek/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libcore/mem/mod.rs:661:5
stack backtrace:
   0: backtrace::backtrace::libunwind::trace
             at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/libunwind.rs:86
   1: backtrace::backtrace::trace_unsynchronized
             at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/mod.rs:66
   2: std::sys_common::backtrace::_print_fmt
             at src/libstd/sys_common/backtrace.rs:78
   3: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
             at src/libstd/sys_common/backtrace.rs:59
   4: core::fmt::write
             at src/libcore/fmt/mod.rs:1069
   5: std::io::Write::write_fmt
             at src/libstd/io/mod.rs:1504
   6: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:62
   7: std::sys_common::backtrace::print
             at src/libstd/sys_common/backtrace.rs:49
   8: std::panicking::default_hook::{{closure}}
             at src/libstd/panicking.rs:198
   9: std::panicking::default_hook
             at src/libstd/panicking.rs:218
  10: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:511
  11: rust_begin_unwind
             at src/libstd/panicking.rs:419
  12: core::panicking::panic_fmt
             at src/libcore/panicking.rs:111
  13: core::panicking::panic
             at src/libcore/panicking.rs:54
  14: core::mem::uninitialized
             at /home/davek/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libcore/mem/mod.rs:661
  15: x11_dl::xlib_xcb::Xlib_xcb::open
             at /home/davek/.cargo/registry/src/github.com-1ecc6299db9ec823/x11-dl-2.18.3/src/link.rs:59
  16: winit::platform::platform::x11::xdisplay::XConnection::new
             at /home/davek/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.19.5/src/platform/linux/x11/xdisplay.rs:39
  17: <winit::platform::platform::X11_BACKEND as core::ops::deref::Deref>::deref::__static_ref_initialize
             at /home/davek/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.19.5/src/platform/linux/mod.rs:55
  18: core::ops::function::FnOnce::call_once
             at /home/davek/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libcore/ops/function.rs:232
  19: lazy_static::lazy::Lazy<T>::get::{{closure}}
             at /home/davek/.cargo/registry/src/github.com-1ecc6299db9ec823/lazy_static-1.4.0/src/inline_lazy.rs:31
  20: std::sync::once::Once::call_once::{{closure}}
             at /home/davek/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libstd/sync/once.rs:264
  21: std::sync::once::Once::call_inner
             at src/libstd/sync/once.rs:416
  22: std::sync::once::Once::call_once
             at /home/davek/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libstd/sync/once.rs:264
  23: lazy_static::lazy::Lazy<T>::get
             at /home/davek/.cargo/registry/src/github.com-1ecc6299db9ec823/lazy_static-1.4.0/src/inline_lazy.rs:30
  24: <winit::platform::platform::X11_BACKEND as core::ops::deref::Deref>::deref::__stability
             at /home/davek/.cargo/registry/src/github.com-1ecc6299db9ec823/lazy_static-1.4.0/src/lib.rs:142
  25: <winit::platform::platform::X11_BACKEND as core::ops::deref::Deref>::deref
             at /home/davek/.cargo/registry/src/github.com-1ecc6299db9ec823/lazy_static-1.4.0/src/lib.rs:144
  26: winit::platform::platform::EventsLoop::new_x11
             at /home/davek/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.19.5/src/platform/linux/mod.rs:476
  27: winit::platform::platform::EventsLoop::new
             at /home/davek/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.19.5/src/platform/linux/mod.rs:457
  28: winit::EventsLoop::new
             at /home/davek/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.19.5/src/lib.rs:251
  29: <amethyst_window::bundle::WindowBundle as amethyst_core::dispatcher::SystemBundle>::build
             at amethyst_window/src/bundle.rs:62
  30: <amethyst_rendy::plugins::window::RenderToWindow as amethyst_rendy::bundle::RenderPlugin<B>>::on_build
             at ./amethyst_rendy/src/plugins.rs:80
  31: <amethyst_rendy::bundle::RenderingBundle<B> as amethyst_core::dispatcher::SystemBundle>::build
             at ./amethyst_rendy/src/bundle.rs:93
  32: <amethyst_core::dispatcher::DispatcherSystemBundle<B> as amethyst_core::dispatcher::ConsumeDesc>::consume
             at ./amethyst_core/src/dispatcher.rs:41
  33: amethyst_core::dispatcher::DispatcherBuilder::build_data
             at amethyst_core/src/dispatcher.rs:404
  34: amethyst_core::dispatcher::DispatcherBuilder::build
             at amethyst_core/src/dispatcher.rs:444
  35: <amethyst::game_data::GameDataBuilder as amethyst::game_data::DataInit<amethyst::game_data::GameData>>::build
             at src/game_data.rs:160
  36: amethyst::app::ApplicationBuilder<S,T,E>::build
             at ./src/app.rs:844
  37: fly_camera::main
             at examples/fly_camera/main.rs:196
  38: std::rt::lang_start::{{closure}}
             at /home/davek/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libstd/rt.rs:67
  39: std::rt::lang_start_internal::{{closure}}
             at src/libstd/rt.rs:52
  40: std::panicking::try::do_call
             at src/libstd/panicking.rs:331
  41: std::panicking::try
             at src/libstd/panicking.rs:274
  42: std::panic::catch_unwind
             at src/libstd/panic.rs:394
  43: std::rt::lang_start_internal
             at src/libstd/rt.rs:51
  44: std::rt::lang_start
             at /home/davek/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libstd/rt.rs:67
  45: main
  46: __libc_start_main
  47: _start
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
> $ xdpyinfo | grep version                                                                                                                                                     
version number:    11.0
X.Org version: 1.19.6

Your Environment

  1. Operating System

    Ubuntu

  2. Operating System Version

    18.04.4 LTS

  3. Version of Amethyst

    Experienced while working on my fork dkushner@f96f2d9 but same issue when building from HEAD of amethyst/legion_v2.

@dkushner dkushner added status: needs triage type: bug Something is not working as it should. labels Jun 22, 2020
@dkushner
Copy link
Collaborator Author

Found #1808, ironically by first finding the underlying language issue discussed here rust-lang/rust#53491. After a cargo update everything is working as expected.

Manghi added a commit to conwayste/conwayste that referenced this issue Jun 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug Something is not working as it should.
Projects
None yet
Development

No branches or pull requests

1 participant