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

Closing window with mouse causes panic #418

Open
milesand opened this issue Jul 9, 2018 · 2 comments
Open

Closing window with mouse causes panic #418

milesand opened this issue Jul 9, 2018 · 2 comments

Comments

@milesand
Copy link

milesand commented Jul 9, 2018

On Linux Mint 18.3 Cinnamon 64-bit, using rustc 1.27.0 and cargo 1.27.0.

Cloning the repository and running cargo run --bin (binary name), then closing the resulting window with mouse by clicking x results in the following panic:

thread 'main' panicked at 'Failed to close input method: XError { description: "BadDrawable (invalid Pixmap or Window parameter)", error_code: 9, request_code: 14, minor_code: 0 }', libcore/result.rs:945:5
note: Run with `RUST_BACKTRACE=1` for a backtrace.

Running with RUST_BACKTRACE=1 results in the following stack backtrace:

stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
             at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::print
             at libstd/sys_common/backtrace.rs:71
             at libstd/sys_common/backtrace.rs:59
   2: std::panicking::default_hook::{{closure}}
             at libstd/panicking.rs:211
   3: std::panicking::default_hook
             at libstd/panicking.rs:227
   4: std::panicking::rust_panic_with_hook
             at libstd/panicking.rs:463
   5: std::panicking::begin_panic_fmt
             at libstd/panicking.rs:350
   6: rust_begin_unwind
             at libstd/panicking.rs:328
   7: core::panicking::panic_fmt
             at libcore/panicking.rs:71
   8: core::result::unwrap_failed
             at /checkout/src/libcore/macros.rs:26
   9: <core::result::Result<T, E>>::expect
             at /checkout/src/libcore/result.rs:809
  10: <winit::platform::platform::x11::util::Ime as core::ops::drop::Drop>::drop
             at /home/milesand/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.12.0/src/platform/linux/x11/util.rs:409
  11: core::ptr::drop_in_place
             at /checkout/src/libcore/ptr.rs:59
  12: core::ptr::drop_in_place
             at /checkout/src/libcore/ptr.rs:59
  13: <std::collections::hash::table::RawTable<K, V>>::rev_drop_buckets
             at /checkout/src/libstd/collections/hash/table.rs:889
  14: <std::collections::hash::table::RawTable<K, V> as core::ops::drop::Drop>::drop
             at /checkout/src/libstd/collections/hash/table.rs:1172
  15: core::ptr::drop_in_place
             at /checkout/src/libcore/ptr.rs:59
  16: core::ptr::drop_in_place
             at /checkout/src/libcore/ptr.rs:59
  17: core::ptr::drop_in_place
             at /checkout/src/libcore/ptr.rs:59
  18: core::ptr::drop_in_place
             at /checkout/src/libcore/ptr.rs:59
  19: core::ptr::drop_in_place
             at /checkout/src/libcore/ptr.rs:59
  20: core::ptr::drop_in_place
             at /checkout/src/libcore/ptr.rs:59
  21: core::ptr::drop_in_place
             at /checkout/src/libcore/ptr.rs:59
  22: core::ptr::drop_in_place
             at /checkout/src/libcore/ptr.rs:59
  23: core::ptr::drop_in_place
             at /checkout/src/libcore/ptr.rs:59
  24: sprite::main
             at src/sprite.rs:78
  25: std::rt::lang_start::{{closure}}
             at /checkout/src/libstd/rt.rs:74
  26: std::panicking::try::do_call
             at libstd/rt.rs:59
             at libstd/panicking.rs:310
  27: __rust_maybe_catch_panic
             at libpanic_unwind/lib.rs:105
  28: std::rt::lang_start_internal
             at libstd/panicking.rs:289
             at libstd/panic.rs:374
             at libstd/rt.rs:58
  29: std::rt::lang_start
             at /checkout/src/libstd/rt.rs:74
  30: main
  31: __libc_start_main
  32: _start

Checked hello_world, draw_state, sprite and paint; All panics on click-closing. The rest are not tested.

@jcbritobr
Copy link

Happens to me in mint 19 tara, also.

@mandx
Copy link

mandx commented Sep 15, 2018

Same here:

  • Ubuntu 18.04
  • Gnome 3 on X11
  • Default window backend (which I assume is Glutin).

It could be something specific to the window backend, because if I use the SDL backend like:

let mut window: PistonWindow<Sdl2Window> = ...

Then I can't reproduce it anymore, closing with click and Esc works as expected.

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

3 participants