-
Notifications
You must be signed in to change notification settings - Fork 937
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
X11 crash: [xcb] Unknown sequence number while processing queue
#458
Comments
Hiya, I have a reliable way of reproducing it (albeit I haven't made a minimal example).
Subsequent runs of the app in the same shell session work. So, I hit this every time I run my project's automated tests, from a new shell session. In my setup, I have unit tests within the same module spawning their own Before upgrading to |
@azriel91 thanks for the info. My winit test app has one thread per window, but I can't reproduce following those instructions. I'm not using (Also, this is sort of embarrassing, but I don't really understand what |
I'm not using The assumption about "open a new shell" is incorrect, the issue can be reproduced if you launch the exe enough times. Here's some output using
I also managed to get another error, but maybe defer it to a different issue:
Running with
|
Ah, awesome, that works! I get a mixture of the XIO error, the XCB error, the XIM error, and the occasional segfault.
I think that error would probably have the same general root cause here. This doesn't seem like it will be easy to track down. I figured the segfaults would be the easiest to investigate (and with some luck, would be related), so I ran with valgrind until I eventually got this: https://gist.github.com/francesca64/5e8512e58d5f728d429bdd28003b4c1a Honestly, it's also possible there's nothing we can do about this. Fundamentally speaking, X11 isn't thread-safe, and we could be hitting some race condition somewhere. Anyway, I looked at your example and noticed something. You create a new That said, doing things the way I suggest leads to any X11 call made from that thread blocking until you receive another event. |
Okay, I got the XCB error once while running Alacritty today. I don't know much about Alacritty's internals, but it has me wondering if this can happen in every winit application. |
Oh I see, good to know, thanks! 🙂 I don't have control over the thread creation in my case ( |
I think I ran into the same problem using the amethyst game engine. |
@MrMinimal thanks. However, if you want this fixed soon, someone other than me will likely have to work on this.
|
Alacritty uses |
@jwilm thanks, though fortunately I already got clarification on that. #462 (comment) |
@francesca64 Running the fullscreen example from master, I can't seem to reproduce the issue. Is there a certain example which would be prone to producing this one? |
@MrMinimal did you try here? https://github.com/azriel91/multithread_window (you'll need to change the |
@francesca64 Thanks for the fast responses! Just tried the link you provided but could not reproduce it with that example. The amethyst examples using winit still reliably reproduce it. |
Maybe this was fixed by #491? I haven't tested it since then. I'll check when I get a chance. Amethyst is still on winit 0.13.1, which doesn't include that PR. |
@francesca64 Oh that might explain it! Thank you for the input, I have not too much experience with amethyst. I'd be interested in your findings, tell me if I can help in any way! |
My bad; sorry! I searched this issue as a precaution but my search ended there. |
@MrMinimal I can still reproduce this easily @jwilm there's no need to apologize. There's an awful lot to keep track of. |
@francesca64 You are right, I can still reproduce it that way, but it happens once in 60 runs. With amethyst it happens more like once in 5 runs. So yes, it happens on older versions more frequently. |
@MrMinimal I've only ever encountered this once in normal usage, which is fortunate, because I'm not optimistic about being able to fix this soon. Also, this is off-topic, but I saw you over on gilrs (I watch that repo) asking about DirectInput. Do you want to implement that yourself? I was planning on doing it when I get a chance; it looks straightforward judging by the SDL source that was linked to. |
@francesca64 offtopic answer: |
More people keep encountering this, so I thought it would be a good idea to actually try to fix it! Running off of this branch #554, |
@francesca64 Your branch works for me as well. This is really great! It must have been frustrating trying to find the culprit here. |
It was actually surprisingly okay! I really did expect to sink my whole day into it, though. What immediately caught my attention was the fact that a single application-global I thought to myself "what happens if two threads try to initialize that concurrently?" so I switched it to That only fixed the XCB and XIO errors, but not the XIM errors and segfaults. Introducing a global lock guarding |
…ples/canvas_webgl_minimal/www/ssri-6.0.2, r=jdm Bump ssri from 6.0.1 to 6.0.2 in /examples/canvas_webgl_minimal/www Bumps [ssri](https://github.com/npm/ssri) from 6.0.1 to 6.0.2. <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/npm/ssri/blob/v6.0.2/CHANGELOG.md">ssri's changelog</a>.</em></p> <blockquote> <h2><a href="https://github.com/zkat/ssri/compare/v6.0.1...v6.0.2">6.0.2</a> (2021-04-07)</h2> <h3>Bug Fixes</h3> <ul> <li>backport regex change from 8.0.1 (<a href="https://github.com/zkat/ssri/commit/b30dfdb">b30dfdb</a>), closes <a href="https://github-redirect.dependabot.com/zkat/ssri/issues/19">#19</a></li> </ul> <p><!-- raw HTML omitted --><!-- raw HTML omitted --></p> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/npm/ssri/commit/b7c8c7c61db89aeb9fbf7596c0ef17071bc216ef"><code>b7c8c7c</code></a> chore(release): 6.0.2</li> <li><a href="https://github.com/npm/ssri/commit/b30dfdb00bb94ddc49a25a85a18fb27afafdfbb1"><code>b30dfdb</code></a> fix: backport regex change from 8.0.1</li> <li>See full diff in <a href="https://github.com/npm/ssri/compare/v6.0.1...v6.0.2">compare view</a></li> </ul> </details> <details> <summary>Maintainer changes</summary> <p>This version was pushed to npm by <a href="https://www.npmjs.com/~nlf">nlf</a>, a new releaser for ssri since your current version.</p> </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=ssri&package-manager=npm_and_yarn&previous-version=6.0.1&new-version=6.0.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) 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>
The following error occurred at startup when running a native GUI program I'm working on. I've run a lot of GUI windows on X11 in the past year and I've never seen this error before, so thought I'd post it:
rustc 1.26.0-nightly (9c9424de5 2018-03-27)
winit 0.12.0
It has only occurred once and I'm not entirely sure how to recreate it yet.
Curiously, the error suggests calling
XInitThreads
however it looks to me like we already do this.The only thing I can think to note is that I do use an EventsLoopProxy to wakeup the main (GUI) thread from a separate audio monitoring thread. There's a chance that
EventsLoopProxy::wakeup
gets called prior to the a call toEventsLoop::run_forever
. I have no idea if this has anything to do with the issue yet, just a thought.The text was updated successfully, but these errors were encountered: