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

Failed to close input method: XError "GLXBadDrawable" #480

Closed
AnneKitsune opened this issue Apr 21, 2018 · 2 comments
Closed

Failed to close input method: XError "GLXBadDrawable" #480

AnneKitsune opened this issue Apr 21, 2018 · 2 comments
Labels
B - bug Dang, that shouldn't have happened C - in progress Implementation is proceeding smoothly DS - x11 P - normal Great to have

Comments

@AnneKitsune
Copy link

Arch Linux
Running X11
Recent nvidia graphics card

Problem discovery:
amethyst/amethyst#655

Trace:

thread 'main' panicked at 'Failed to unfocus input context: XError { description: "BadDrawable (invalid Pixmap or Window parameter)", error_code: 9, request_code: 14, minor_code: 0 }', libcore/result.rs:945:5
stack backtrace:
   8: core::panicking::panic_fmt
             at libcore/panicking.rs:71
   9: core::result::unwrap_failed
             at /checkout/src/libcore/macros.rs:23
  10: <core::result::Result<T, E>>::expect
             at /checkout/src/libcore/result.rs:809
  11: winit::platform::platform::x11::EventsLoop::process_event
             at /home/jojolepro/.cargo/registry/src/jackfan.us.kg-1ecc6299db9ec823/winit-0.12.0/src/platform/linux/x11/mod.rs:768
  12: winit::platform::platform::x11::EventsLoop::poll_events
             at /home/jojolepro/.cargo/registry/src/jackfan.us.kg-1ecc6299db9ec823/winit-0.12.0/src/platform/linux/x11/mod.rs:174
  13: winit::platform::platform::EventsLoop::poll_events
             at /home/jojolepro/.cargo/registry/src/jackfan.us.kg-1ecc6299db9ec823/winit-0.12.0/src/platform/linux/mod.rs:406
  14: winit::EventsLoop::poll_events

FOLLOWED BY
thread 'main' panicked at 'Failed to close input method: XError { description: "GLXBadDrawable", error_code: 172, request_code: 154, minor_code: 11 }', libcore/result.rs:945:5
stack backtrace:
   5:     0x555810d72fce - std::panicking::begin_panic::h8327f16bde15df70
                               at libstd/panicking.rs:537
   6:     0x555810d72ec9 - std::panicking::begin_panic_fmt::h42ff1d37404632d6
                               at libstd/panicking.rs:521
   7:     0x555810d72e52 - rust_begin_unwind
                               at libstd/panicking.rs:497
   8:     0x555810db8350 - core::panicking::panic_fmt::h0bd854df201d1baf
                               at libcore/panicking.rs:71
   9:     0x555810bb7387 - core::result::unwrap_failed::h6f1b44d91ac19d65
                               at /checkout/src/libcore/macros.rs:23
  10:     0x555810bb483b - <core::result::Result<T, E>>::expect::h8d48044b0b4d67ba
                               at /checkout/src/libcore/result.rs:809
  11:     0x555810b51e1c - <winit::platform::platform::x11::util::Ime as core::ops::drop::Drop>::drop::hbdb570fe95ceda22
                               at /home/jojolepro/.cargo/registry/src/jackfan.us.kg-1ecc6299db9ec823/winit-0.12.0/src/platform/linux/x11/util.rs:409
  12:     0x55581057b5f4 - core::ptr::drop_in_place::h6484c2b1b4e02e93
                               at /checkout/src/libcore/ptr.rs:59
  13:     0x555810582958 - core::ptr::drop_in_place::haede5cce9c5935ae
                               at /checkout/src/libcore/ptr.rs:59
  14:     0x555810692293 - <std::collections::hash::table::RawTable<K, V>>::rev_drop_buckets::hceafabe5c4f17b23
                               at /checkout/src/libstd/collections/hash/table.rs:894
  15:     0x5558106a0822 - <std::collections::hash::table::RawTable<K, V> as core::ops::drop::Drop>::drop::hb4607198a0fc7fc0
                               at /checkout/src/libstd/collections/hash/table.rs:1177
  16:     0x555810577044 - core::ptr::drop_in_place::h3cab75a0d75a69ac
                               at /checkout/src/libcore/ptr.rs:59
  17:     0x55581057ec98 - core::ptr::drop_in_place::h84b46bd2490b0274
                               at /checkout/src/libcore/ptr.rs:59
  18:     0x5558105743c4 - core::ptr::drop_in_place::h206374a67182035f
                               at /checkout/src/libcore/ptr.rs:59
  19:     0x555810581748 - core::ptr::drop_in_place::ha0507a4c4d8be4cf
                               at /checkout/src/libcore/ptr.rs:59
  20:     0x555810573f55 - core::ptr::drop_in_place::h1d079cd928d61a52
                               at /checkout/src/libcore/ptr.rs:59
  21:     0x555810577d51 - core::ptr::drop_in_place::h45af71f14cb4553c
                               at /checkout/src/libcore/ptr.rs:59
  22:     0x55581057ef14 - core::ptr::drop_in_place::h86196f8b6f2094bb
                               at /checkout/src/libcore/ptr.rs:59
  23:     0x55581058549c - core::ptr::drop_in_place::hc689e7f64767bde1
                               at /checkout/src/libcore/ptr.rs:59
  24:     0x55581058635d - core::ptr::drop_in_place::hcdb836734999b7c4
                               at /checkout/src/libcore/ptr.rs:59
  25:     0x55581057a4c6 - core::ptr::drop_in_place::h5c469d375b738a54
                               at /checkout/src/libcore/ptr.rs:59
  26:     0x55581056d78d - <smallvec::SmallVec<A> as core::ops::drop::Drop>::drop::he415eb2ce45137e0
                               at /home/jojolepro/.cargo/registry/src/jackfan.us.kg-1ecc6299db9ec823/smallvec-0.4.4/lib.rs:914
  27:     0x55581058a9e4 - core::ptr::drop_in_place::hf4c9e618f8f16e3f
                               at /checkout/src/libcore/ptr.rs:59
  28:     0x5558105833dd - core::ptr::drop_in_place::hb4a9c5f4a452fd22
                               at /checkout/src/libcore/ptr.rs:59
  29:     0x5558105889b9 - core::ptr::drop_in_place::he6452c4ccebbb61a
                               at /checkout/src/libcore/ptr.rs:59
  30:     0x555810550438 - ui::run::h7890b107233bc50a
                               at examples/ui/main.rs:295
  31:     0x555810550f49 - ui::main::hce4c03ca6ea0af65
                               at examples/ui/main.rs:304
  32:     0x5558105f3a91 - std::rt::lang_start::{{closure}}::h5b3487d8c4331bdc
                               at /checkout/src/libstd/rt.rs:74
  33:     0x555810d72db7 - std::panicking::try::do_call::hd12baa704e255980
                               at libstd/rt.rs:59
                               at libstd/panicking.rs:479
  34:     0x555810d7d96e - __rust_maybe_catch_panic
                               at libpanic_unwind/lib.rs:102
  35:     0x555810d735d3 - std::rt::lang_start_internal::h764d480f090a00ea
                               at libstd/panicking.rs:458
                               at libstd/panic.rs:358
                               at libstd/rt.rs:58
  36:     0x5558105f3a71 - std::rt::lang_start::h4f1bfefa147f3fe6
                               at /checkout/src/libstd/rt.rs:74
  37:     0x55581055213d - main
  38:     0x7f953daeff49 - __libc_start_main
  39:     0x55581052e369 - _start
  40:                0x0 - <unknown>
thread panicked while panicking. aborting.
zsh: illegal hardware instruction (core dumped)  RUST_BACKTRACE=1 cargo run --example ui
@francesca64 francesca64 added B - bug Dang, that shouldn't have happened DS - x11 labels Apr 21, 2018
@francesca64
Copy link
Member

francesca64 commented Apr 21, 2018

This should actually be fixed by #476. GLXBadDrawable happens when you try to render to a destroyed window, and the associated error messages aren't relevant, since those are just the first checks to catch the error. Looking at your issue report on Amethyst, the reason it started after a glutin update was likely due to #416 being included in that.

I've had this same general problem in my own gfx apps. I was handling Closed by stopping the loop at the end of the iteration rather than immediately, which I imagine is a common pattern. After #416, that means you'll always attempt to do one render after the window's already been destroyed. The reason this doesn't come up when closing with escape is because escape doesn't actually destroy the window, you just safely exit the loop and then the window is ultimately dropped.

In the short term, I don't recommend doing anything to fix this in Amethyst, since you'd just end up reverting that once CloseRequested/Destroyed lands in a release.

@francesca64 francesca64 added C - in progress Implementation is proceeding smoothly P - normal Great to have labels May 6, 2018
@francesca64
Copy link
Member

Closing via amethyst/amethyst#698

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B - bug Dang, that shouldn't have happened C - in progress Implementation is proceeding smoothly DS - x11 P - normal Great to have
Development

No branches or pull requests

2 participants