Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tiled panics on resizing #473

Open
GDelevoye opened this issue Apr 23, 2021 · 0 comments
Open

tiled panics on resizing #473

GDelevoye opened this issue Apr 23, 2021 · 0 comments

Comments

@GDelevoye
Copy link

GDelevoye commented Apr 23, 2021

Hello :)

I just ran rs-tiled-piston ang got this when I attempted to resize the window:

guillaume@A320MA:~/GitHub/piston-examples/examples/tiled$ cargo run
...
...
...
   Compiling pistoncore-glutin_window v0.63.0
   Compiling piston_window v0.105.0
   Compiling rs-tiled-piston v0.1.0 (/home/guillaume/GitHub/piston-examples/examples/tiled)
    Finished dev [unoptimized + debuginfo] target(s) in 35.77s
     Running `target/debug/rs-tiled-piston`
thread 'main' panicked at 'attempted to leave type `platform::platform::x11::util::input::PointerState` uninitialized, which is invalid', /home/guillaume/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/mem/mod.rs:671:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

I'm on Ubuntu 20 LTS 64bits 86x, with an r5 ryzen CPU, and a dedicated nvidia GPU (gtx 980ti), cargo 1.51.0 (43b129a20 2021-03-16)

Detailed backtrace:

guillaume@A320MA:~/GitHub/piston-examples/examples/tiled$ RUST_BACKTRACE=1 cargo run
    Finished dev [unoptimized + debuginfo] target(s) in 0.04s
     Running `target/debug/rs-tiled-piston`
thread 'main' panicked at 'attempted to leave type `platform::platform::x11::util::input::PointerState` uninitialized, which is invalid', /home/guillaume/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/mem/mod.rs:671:9
stack backtrace:
   0: rust_begin_unwind
             at /rustc/2fd73fabe469357a12c2c974c140f67e7cdd76d0/library/std/src/panicking.rs:493:5
   1: core::panicking::panic_fmt
             at /rustc/2fd73fabe469357a12c2c974c140f67e7cdd76d0/library/core/src/panicking.rs:92:14
   2: core::panicking::panic
             at /rustc/2fd73fabe469357a12c2c974c140f67e7cdd76d0/library/core/src/panicking.rs:50:5
   3: core::mem::uninitialized
             at /home/guillaume/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/mem/mod.rs:671:9
   4: winit::platform::platform::x11::util::input::<impl winit::platform::platform::x11::xdisplay::XConnection>::query_pointer
             at /home/guillaume/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.19.5/src/platform/linux/x11/util/input.rs:94:51
   5: winit::platform::platform::x11::EventsLoop::process_event
             at /home/guillaume/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.19.5/src/platform/linux/x11/mod.rs:956:45
   6: winit::platform::platform::x11::EventsLoop::poll_events
             at /home/guillaume/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.19.5/src/platform/linux/x11/mod.rs:270:13
   7: winit::platform::platform::EventsLoop::poll_events
             at /home/guillaume/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.19.5/src/platform/linux/mod.rs:522:44
   8: winit::EventsLoop::poll_events
             at /home/guillaume/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.19.5/src/lib.rs:277:9
   9: glutin_window::GlutinWindow::poll_event
             at /home/guillaume/.cargo/registry/src/github.com-1ecc6299db9ec823/pistoncore-glutin_window-0.63.0/src/lib.rs:204:17
  10: <glutin_window::GlutinWindow as window::Window>::poll_event
             at /home/guillaume/.cargo/registry/src/github.com-1ecc6299db9ec823/pistoncore-glutin_window-0.63.0/src/lib.rs:449:49
  11: event_loop::Events::next
             at /home/guillaume/.cargo/registry/src/github.com-1ecc6299db9ec823/pistoncore-event_loop-0.49.0/src/lib.rs:253:38
  12: piston_window::PistonWindow<W>::next
             at /home/guillaume/.cargo/registry/src/github.com-1ecc6299db9ec823/piston_window-0.105.0/src/lib.rs:310:26
  13: rs_tiled_piston::main
             at ./src/main.rs:41:25
  14: core::ops::function::FnOnce::call_once
             at /home/guillaume/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:227:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

EDIT: Sorry, apparently the bug is not deterministic. Sometimes the window works a little bit before crashing, which made me wrongly think it was due to resizing although, probably, it's not related

EDIT 2 : I think it happens when the mouse goes over the window. If by lack of luck the program starts with the mouse already on the window, it crashes before the user could even see it

shinmili added a commit to shinmili/piston-examples that referenced this issue Sep 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant