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

Panic when using optirun and typing dead keys #440

Open
quininer opened this issue Mar 31, 2018 · 14 comments
Open

Panic when using optirun and typing dead keys #440

quininer opened this issue Mar 31, 2018 · 14 comments
Labels
B - bug Dang, that shouldn't have happened C - needs investigation Issue must be confirmed and researched D - hard Likely harder than most tasks here DS - x11 H - help wanted Someone please save us P - normal Great to have

Comments

@quininer
Copy link

quininer commented Mar 31, 2018

thread 'main' panicked at 'attempt to subtract with overflow', /user/winit/src/platform/linux/x11/mod.rs:453:35
note: Run with `RUST_BACKTRACE=1` for a backtrace.
thread 'main' panicked at 'Failed to call XInternAtom (WM_PROTOCOLS): XError { description: "BadValue (integer parameter out of range for operation)", error_code: 2, request_code: 101, minor_code: 0 }', libcore/result.rs:945:5
stack backtrace:
   0:     0x55c1da1bda4b - std::sys::unix::backtrace::tracing::imp::unwind_backtrace::h89ba7da7562701ab
                               at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1:     0x55c1da1c2ac0 - std::sys_common::backtrace::print::h6c31ad9817780cde
                               at libstd/sys_common/backtrace.rs:71
                               at libstd/sys_common/backtrace.rs:59
   2:     0x55c1da1ba16d - std::panicking::default_hook::{{closure}}::h2058dd93a82247f5
                               at libstd/panicking.rs:207
   3:     0x55c1da1b9ecb - std::panicking::default_hook::h679f309f083c9814
                               at libstd/panicking.rs:223
   4:     0x55c1da1ba5bf - std::panicking::rust_panic_with_hook::hf996e11af0921186
                               at libstd/panicking.rs:402
   5:     0x55c1da1ba3e2 - std::panicking::begin_panic_fmt::h8164d62b26e4856a
                               at libstd/panicking.rs:349
   6:     0x55c1da1ba312 - rust_begin_unwind
                               at libstd/panicking.rs:325
   7:     0x55c1da201430 - core::panicking::panic_fmt::hdbf1954249c01b91
                               at libcore/panicking.rs:72
   8:     0x55c1da0d5b77 - core::result::unwrap_failed::h31ff2f70a7055851
                               at /checkout/src/libcore/macros.rs:26
   9:     0x55c1da0d429b - <core::result::Result<T, E>>::expect::h6409ca11a4445996
                               at /checkout/src/libcore/result.rs:809
  10:     0x55c1da09707f - <winit::platform::platform::x11::Window as core::ops::drop::Drop>::drop::h2ff265fd9c5889fb
                               at src/platform/linux/x11/mod.rs:1087
  11:     0x55c1da04bac4 - core::ptr::drop_in_place::h3a2f256af65c530f
                               at /checkout/src/libcore/ptr.rs:59
  12:     0x55c1da04b72f - core::ptr::drop_in_place::h1c4983e117d6cf94
                               at /checkout/src/libcore/ptr.rs:59
  13:     0x55c1da04cb34 - core::ptr::drop_in_place::h9fb6a3aefef6e214
                               at /checkout/src/libcore/ptr.rs:59
  14:     0x55c1da0593c7 - xim::main::ha55699d7099b253c
                               at examples/xim.rs:34
  15:     0x55c1da0543a1 - std::rt::lang_start::{{closure}}::ha4ff232e21bac6fb
                               at /checkout/src/libstd/rt.rs:74
  16:     0x55c1da1ba277 - std::panicking::try::do_call::hf0fdbf659d7b57b7
                               at libstd/rt.rs:59
                               at libstd/panicking.rs:306
  17:     0x55c1da1c9c1e - __rust_maybe_catch_panic
                               at libpanic_unwind/lib.rs:102
  18:     0x55c1da1b7cc5 - std::rt::lang_start_internal::hc1351a73a73f54f6
                               at libstd/panicking.rs:285
                               at libstd/panic.rs:361
                               at libstd/rt.rs:58
  19:     0x55c1da054381 - std::rt::lang_start::hc4156819566d16cc
                               at /checkout/src/libstd/rt.rs:74
  20:     0x55c1da05943d - main
  21:     0x7f427b478f49 - __libc_start_main
  22:     0x55c1da047259 - _start
  23:                0x0 - <unknown>
thread panicked while panicking. aborting.
fish: './target/debug/examples/xim' terminated by signal SIGILL (Illegal instruction)

This may be caused by #297.

@quininer
Copy link
Author

quininer commented Mar 31, 2018

Using release mode, it will works. because overflow checking is optimized.

But alacritty still panics when using optirun.

[Unhandled CSI] action='t', args=[22, 0, 0], intermediates=[]
[Unhandled CSI] action='l', args=[1005], intermediates=[63]
[unhandled osc_dispatch]: [['5','0',],['C','u','r','s','o','r','S','h','a','p','e','=','0',],] at line 746
[unhandled osc_dispatch]: [['5','0',],['C','u','r','s','o','r','S','h','a','p','e','=','0',],] at line 746
[unhandled osc_dispatch]: [['5','0',],['C','u','r','s','o','r','S','h','a','p','e','=','0',],] at line 746
thread 'pty reader' panicked at 'Failed to call XSendEvent after wakeup: XError { description: "BadValue (integer parameter out of range for operation)", error_code: 2, request_code: 101, minor_code: 0 }', libcore/result.rs:945:5
note: Run with `RUST_BACKTRACE=1` for a backtrace.
thread 'main' panicked at 'Error sending shutdown to event loop: Disconnected', libcore/result.rs:945:5

@quininer quininer changed the title Panic when using Fcitx5 input chinese XIM: Panic when using Fcitx5 input chinese Mar 31, 2018
@francesca64
Copy link
Member

This is likely a duplicate of #366. Does PR #432 resolve this for you?

@quininer
Copy link
Author

quininer commented Mar 31, 2018

It fixes integer overflow, but still receives XError. (using optirun)

thread 'main' panicked at 'Failed to query pointer device: XError { description: "BadValue (integer parameter out of range for operation)", error_code: 2, request_code: 101, minor_code: 0 }', libcore/result.rs:945:5
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:207
   3: std::panicking::default_hook
             at libstd/panicking.rs:223
   4: std::panicking::rust_panic_with_hook
             at libstd/panicking.rs:402
   5: std::panicking::begin_panic_fmt
             at libstd/panicking.rs:349
   6: rust_begin_unwind
             at libstd/panicking.rs:325
   7: core::panicking::panic_fmt
             at libcore/panicking.rs:72
   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::EventsLoop::process_event
             at ./winit/src/platform/linux/x11/mod.rs:712
  11: winit::platform::platform::x11::EventsLoop::run_forever
             at ./winit/src/platform/linux/x11/mod.rs:188
  12: winit::platform::platform::EventsLoop::run_forever
             at ./winit/src/platform/linux/mod.rs:415
  13: winit::EventsLoop::run_forever
             at ./winit/src/lib.rs:231
  14: test_winit_xim::main
             at src/main.rs:22
  15: std::rt::lang_start::{{closure}}
             at /checkout/src/libstd/rt.rs:74
  16: std::panicking::try::do_call
             at libstd/rt.rs:59
             at libstd/panicking.rs:306
  17: __rust_maybe_catch_panic
             at libpanic_unwind/lib.rs:102
  18: std::rt::lang_start_internal
             at libstd/panicking.rs:285
             at libstd/panic.rs:361
             at libstd/rt.rs:58
  19: std::rt::lang_start
             at /checkout/src/libstd/rt.rs:74
  20: main
  21: __libc_start_main
  22: _start

This may seem like a NVIDIA error, but it always appears after using IME.

@francesca64
Copy link
Member

The various expects littered throughout the backend are applied to whatever the latest X error is, and since it's not called after every function, the messages can be misleading at times.

Fortunately, the request_code field should tell us what call actually caused the error, and it seems to be... XGetKeyboardMapping, which isn't ever directly called in winit's source code. However, rummaging through X11's source, it's called within XKeycodeToKeysym, XKeysymToKeycode, XLookupKeysym, XRebindKeysym, and XLookupString.

This will be tough to track down unless I can reproduce it. Can you verify that this is specifically an issue when using fcitx, as in, that it doesn't happen if you run with XMODIFIERS="@im=none"?

@quininer
Copy link
Author

Yes, it works fine when don't use IME.

@quininer
Copy link
Author

quininer commented Apr 2, 2018

The backspace appears two consecutive times when using x11-dead-keys branch.

small

This is because the backspace is not filtered.

@francesca64
Copy link
Member

Good catch! Not only that, but the arrow keys are doubled as well. I've removed the filtering hack from that branch, so that shouldn't happen anymore.

For your other problem, is it possible that optirun is changing the environment the program is being run with in some way? (Assuming I'm correctly understanding that it only happens when using optirun)

diff --color <(fcitx-diagnose) <(optirun fcitx-diagnose)

@quininer
Copy link
Author

quininer commented Apr 5, 2018

There is no difference between the output of fcitx-diagnose and optirun fcitx-diagnose.

@francesca64
Copy link
Member

Unfortunately, I doubt #451 helps with this at all. I don't really have any ideas for how to proceed with this at the moment.

@quininer
Copy link
Author

Unfortunately, it doesn't help.

@francesca64
Copy link
Member

Can you give this branch a shot? https://github.com/francesca64/winit/tree/x11-cleanup-keysym

@francesca64
Copy link
Member

I just remembered that Alacritty won't build on winit 0.13, so here's an Alacritty branch you can try: https://github.com/francesca64/alacritty/tree/x11-keysym

@quininer
Copy link
Author

quininer commented Apr 30, 2018

It's still error.

    Finished dev [unoptimized + debuginfo] target(s) in 2.62 secs                                                                                                                      [0/1716]
     Running `target/debug/examples/window`
XInternAtom name:"WM_DELETE_WINDOW" atom:311
XInternAtoms atoms:[401, 392, 395, 396, 393, 394, 406, 400, 397, 398, 603, 1551]
XInternAtom name:"XIM_SERVERS" atom:527
XGetWindowProperty prop:527 fmt:64 len:00 off:1024 out:01, buf:[526]
XInternAtom name:"_NET_SUPPORTED" atom:344
XGetWindowProperty prop:344 fmt:64 len:00 off:1024 out:68, buf:[344, 386, 442, 443, 444, 445, 447, 448, 389, 346, 449, 451, 452, 450, 348, 347, 349, 453, 455, 366, 380, 367, 368, 369, 370, 373, 371, 372, 381, 354, 360, 359, 358, 467, 468, 469, 470, 357, 355, 356, 362, 361, 456, 457, 458, 351, 352, 313, 363, 460, 462, 461, 472, 473, 474, 475, 477, 478, 479, 480, 481, 383, 382, 484, 365, 487, 489, 463]
XInternAtom name:"_NET_SUPPORTING_WM_CHECK" atom:386
XInternAtom name:"_NET_WM_NAME" atom:349
XGetWindowProperty prop:386 fmt:64 len:00 off:1024 out:01, buf:[35651590]
XGetWindowProperty prop:386 fmt:64 len:00 off:1024 out:01, buf:[35651590]
XInternAtom name:"UTF8_STRING" atom:391
XGetWindowProperty prop:349 fmt:08 len:00 off:1024 out:04, buf:[75, 87, 105, 110]
XSync
XSync
XSync
XSync
XSync
XSync
XSync
XSync
XSync
XChangeProperty prop:349 val:[65, 32, 102, 97, 110, 116, 97, 115, 116, 105, 99, 32, 119, 105, 110, 100, 111, 119, 33, 0]
XInternAtom name:"_MOTIF_WM_HINTS" atom:339
XChangeProperty prop:339 val:[2, 0, 1, 0, 0]
XInternAtom name:"XdndAware" atom:401
XChangeProperty prop:401 val:[5]
XInternAtom name:"_NET_WM_STATE_MAXIMIZED_HORZ" atom:358
XInternAtom name:"_NET_WM_STATE_MAXIMIZED_VERT" atom:359
XInternAtom name:"_NET_WM_STATE" atom:354
XInternAtom name:"_NET_WM_STATE_FULLSCREEN" atom:357
XSync
XGetWindowProperty prop:344 fmt:64 len:00 off:1024 out:68, buf:[344, 386, 442, 443, 444, 445, 447, 448, 389, 346, 449, 451, 452, 450, 348, 347, 349, 453, 455, 366, 380, 367, 368, 369, 370, 373, 371, 372, 381, 354, 360, 359, 358, 467, 468, 469, 470, 357, 355, 356, 362, 361, 456, 457, 458, 351, 352, 313, 363, 460, 462, 461, 472, 473, 474, 475, 477, 478, 479, 480, 481, 383, 382, 484, 365, 487, 489, 463]
XGetWindowProperty prop:386 fmt:64 len:00 off:1024 out:01, buf:[35651590]
XGetWindowProperty prop:386 fmt:64 len:00 off:1024 out:01, buf:[35651590]
XGetWindowProperty prop:349 fmt:08 len:00 off:1024 out:04, buf:[75, 87, 105, 110]
XTranslateCoordinates coords:TranslatedCoords { x_rel_root: 0, y_rel_root: 29, child: 35651615 }
XGetGeometry geo:Geometry { root: 392, x_rel_parent: 0, y_rel_parent: 0, width: 1024, height: 768, border: 0, depth: 24 }
XInternAtom name:"_NET_CLIENT_LIST" atom:442
XGetWindowProperty prop:442 fmt:64 len:00 off:1024 out:09, buf:[10485774, 10485801, 56623105, 65011733, 75497475, 77594627, 56623129, 56623138, 73400324]
XInternAtom name:"_NET_FRAME_EXTENTS" atom:383
XGetWindowProperty prop:383 fmt:64 len:00 off:1024 out:04, buf:[0, 0, 29, 0]
thread 'main' panicked at 'Failed to unfocus input context: XError { description: "BadValue (integer parameter out of range for operation)", error_code: 2, request_code: 101, minor_code: 0 }', libcore/result.rs:945:5
note: Run with `RUST_BACKTRACE=1` for a backtrace.

@francesca64 francesca64 added H - help wanted Someone please save us C - needs investigation Issue must be confirmed and researched D - hard Likely harder than most tasks here P - normal Great to have B - bug Dang, that shouldn't have happened labels May 6, 2018
@quininer quininer changed the title XIM: Panic when using Fcitx5 input chinese Panic when using optirun and typing dead keys May 11, 2018
@quininer
Copy link
Author

Related alacritty/alacritty#1038 (comment)

tmfink pushed a commit to tmfink/winit that referenced this issue Jan 5, 2022
…ples/canvas_webgl_minimal/www/http-proxy-1.18.1, r=jdm

Bump http-proxy from 1.18.0 to 1.18.1 in /examples/canvas_webgl_minimal/www

Bumps [http-proxy](https://github.com/http-party/node-http-proxy) from 1.18.0 to 1.18.1.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/http-party/node-http-proxy/blob/master/CHANGELOG.md">http-proxy's changelog</a>.</em></p>
<blockquote>
<h2><a href="https://github.com/http-party/node-http-proxy/compare/1.18.0...v1.18.1">v1.18.1</a> - 2020-05-17</h2>
<h3>Merged</h3>
<ul>
<li>Skip sending the proxyReq event when the expect header is present <a href="https://github-redirect.dependabot.com/http-party/node-http-proxy/pull/1447"><code>[#1447](https://github.com/http-party/node-http-proxy/issues/1447)</code></a></li>
<li>Remove node6 support, add node12 to build <a href="https://github-redirect.dependabot.com/http-party/node-http-proxy/pull/1397"><code>[#1397](https://github.com/http-party/node-http-proxy/issues/1397)</code></a></li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/http-party/node-http-proxy/commit/9b96cd725127a024dabebec6c7ea8c807272223d"><code>9b96cd7</code></a> 1.18.1</li>
<li><a href="https://github.com/http-party/node-http-proxy/commit/335aeeba2f0c286dc89c402eeb76af47834c89a3"><code>335aeeb</code></a> Skip sending the proxyReq event when the expect header is present (<a href="https://github-redirect.dependabot.com/http-party/node-http-proxy/issues/1447">#1447</a>)</li>
<li><a href="https://github.com/http-party/node-http-proxy/commit/dba39668ba4c9ad461316e834b2d64b77e1ca88e"><code>dba3966</code></a> Remove node6 support, add node12 to build (<a href="https://github-redirect.dependabot.com/http-party/node-http-proxy/issues/1397">#1397</a>)</li>
<li>See full diff in <a href="https://github.com/http-party/node-http-proxy/compare/1.18.0...1.18.1">compare view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=http-proxy&package-manager=npm_and_yarn&previous-version=1.18.0&new-version=1.18.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/configuring-github-dependabot-security-updates)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language

You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/servo/pathfinder/network/alerts).

</details>
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 - needs investigation Issue must be confirmed and researched D - hard Likely harder than most tasks here DS - x11 H - help wanted Someone please save us P - normal Great to have
Development

No branches or pull requests

3 participants