rust-windowing / rust-windowing/winit

X11: panic on window creation: Failed to call XMapRaised (BadIDChoice)

Open
#4,615 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

B - bug DS - x11
Dominant language
Rust
Stars
6.2k
Forks
1.3k
Avg merge
2d 19h
Merged PRs (30d)
9

Description

Description

Hi, I encountered a consistent fatal crash when launching applications (such as Alacritty) built with the latest winit 0.30.13 under X11 environment.

During the initialization phase, the XMapRaised call triggers an asynchronous BadIDChoice XError, which immediately results in a panic inside winit instead of handling the error or returning a Result gracefully.

Steps to Reproduce

Run any application using winit 0.30.13 (e.g., Alacritty 0.17+ or latest git master) under X11.

The application panics instantly on startup and dumps core.

Backtrace / Log Output

thread 'main' (8376) panicked at /build/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/winit-0.30.13/src/platform_impl/linux/x11/window.rs:1145:41:
Failed to call XMapRaised: XError { description: "BadIDChoice (invalid resource ID chosen for this connection)", error_code: 14, request_code: 138, minor_code: 31 }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

thread 'main' (8376) panicked at /build/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/winit-0.30.13/src/platform_impl/linux/x11/window.rs:586:34:
called `Result::unwrap()` on an `Err` value: PoisonError { .. }
stack backtrace:
   0:     0x55d61d336b2b - <unknown>
   1:     0x55d61d1eb5da - <unknown>
   2:     0x55d61d33fc46 - <unknown>
   3:     0x55d61d310ad0 - <unknown>
   4:     0x55d61d330016 - <unknown>
   5:     0x55d61d33020b - <unknown>
   6:     0x55d61d310b88 - <unknown>
   7:     0x55d61d308009 - <unknown>
   8:     0x55d61d315cfd - <unknown>
   9:     0x55d61d1ebd3c - <unknown>
  10:     0x55d61d1ebb12 - <unknown>
  11:     0x55d61d4670fb - <unknown>
  12:     0x55d61cf48459 - <unknown>
  13:     0x55d61cf67742 - <unknown>
  14:     0x55d61cf61566 - <unknown>
  15:     0x55d61cfa7e41 - <unknown>
  16:     0x55d61cf8eb76 - <unknown>
  17:     0x55d61cf445e8 - <unknown>
  18:     0x55d61d09ee24 - <unknown>
  19:     0x55d61d0a2d7b - <unknown>
  20:     0x55d61cfa637f - <unknown>
  21:     0x55d61cfdb5c6 - <unknown>
  22:     0x55d61d0f16cc - <unknown>
  23:     0x55d61d32e534 - <unknown>
  24:     0x55d61cfab004 - <unknown>
  25:     0x7fd06a42793e - <unknown>
  26:     0x7fd06a427a7c - __libc_start_main
  27:     0x55d61cf3e1d5 - <unknown>
  28:                0x0 - <unknown>

thread 'main' (8376) panicked at library/core/src/panicking.rs:233:5:
panic in a destructor during cleanup
thread caused non-unwinding panic. aborting.
中止                     (核心已傾印)alacritty

OS and window mananger

OS: Artix Linux
Window manager: i3-wm

Winit version

0.30.13

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in platform_impl/linux/x11/window.rs at lines 1145 and 586, where XMapRaised reports BadIDChoice and the follow-up mutex error panics. Reproduce the startup failure with winit 0.30.13 under X11 using the reported Alacritty scenario, then verify that window creation no longer aborts with these panics and handles the X error gracefully.

Written by the indexing model from the issue text.

Assessment

Tech stack
linux, rust
Domain
desktop, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.