winit: X11 crash: `[xcb] Unknown sequence number while processing queue`

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:

    Finished release [optimized + debuginfo] target(s) in 18.95 secs
     Running `target/release/audio_server`
[xcb] Unknown sequence number while processing queue
[xcb] Most likely this is a multi-threaded client and XInitThreads has not been called
[xcb] Aborting, sorry about that.
audio_server: xcb_io.c:259: poll_for_event: Assertion `!xcb_xlib_threads_sequence_lost' failed.

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 to EventsLoop::run_forever. I have no idea if this has anything to do with the issue yet, just a thought.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 1
  • Comments: 23 (17 by maintainers)

Commits related to this issue

Most upvoted comments

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, multithread_window generates no errors for me.

@MrMinimal I can still reproduce this easily while true; do target/debug/multithread_window; done. Was this something that happens to you frequently on older versions? It’s supposed to be extremely rare in normal usage (at least, that’s why I have the priority set to low).

@jwilm there’s no need to apologize. There’s an awful lot to keep track of.