Bug 517711 - kwin_wayland crashes on startup when XKBVARIANT is set to an invalid value
Summary: kwin_wayland crashes on startup when XKBVARIANT is set to an invalid value
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (other bugs)
Version First Reported In: 6.6.2
Platform: Gentoo Packages Linux
: NOR crash
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
: 509637 518540 (view as bug list)
Depends on:
Blocks:
 
Reported: 2026-03-17 18:08 UTC by Balrog86
Modified: 2026-04-05 07:53 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 6.6.4
Sentry Crash Report:


Attachments
Backtrace+kwin buildinfo+systeminfo separated by ##### (17.24 KB, text/plain)
2026-03-17 18:08 UTC, Balrog86
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Balrog86 2026-03-17 18:08:51 UTC
Created attachment 190739 [details]
Backtrace+kwin buildinfo+systeminfo separated by #####

kwin_wayland crashes on the first keypress after startup (and restarts on every subsequent keypress) when XKBVARIANT=latin is set in /etc/vconsole.conf, because de(latin) is not a valid XKB variant. Critically, kwin_wayland emits no error or warning related to the invalid keymap — making the root cause extremely difficult to diagnose without external help. The crash is fully reproducible via XKB_DEFAULT_VARIANT=latin startplasma-wayland. The core issue is twofold: the crash itself, and the complete absence of any actionable error output from kwin_wayland that would point a user toward the actual cause.

Steps to Reproduce:
1a. Set XKBVARIANT=latin in /etc/vconsole.conf (results in an invalid XKB keymap entry de(latin))
Start a Plasma Wayland session via either:
2a. exec startplasma-wayland from a TTY (with DBus already started by systemd-logind), or
SDDM display manager
3a. Observe that kwin_wayland crashes on the first keypress and restarts on every subsequent keypress

1b. Launch plasma from cli via 'XKB_DEFAULT_VARIANT=latin startplasma-wayland'

Attachments:
- Backtrace (compiled with debug flags for kwin, libxkbcommon, qtbase - thanks to sam_ from #gentoo)
- KWin build configuration
- Plasma Systeminfo
Comment 1 Nicolas Fella 2026-03-17 18:53:54 UTC
> Critically, kwin_wayland emits no error or warning related to the invalid keymap

It does print warnings, see https://invent.kde.org/plasma/kwin/-/blob/master/src/xkb.cpp#L546
Comment 2 Bug Janitor Service 2026-03-17 19:54:12 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/8989
Comment 3 Balrog86 2026-03-17 21:47:54 UTC
(In reply to Nicolas Fella from comment #1)
> > Critically, kwin_wayland emits no error or warning related to the invalid keymap
> 
> It does print warnings, see
> https://invent.kde.org/plasma/kwin/-/blob/master/src/xkb.cpp#L546

I did re-check journalctl and I now do see this message indeed. Hopefully this will help somebody else. Thanks for the quick review/commit
Comment 4 Nicolas Fella 2026-03-18 10:09:06 UTC
Git commit 1c1329945cc6a39e9ad4d2b775802bfe07e56904 by Nicolas Fella.
Committed on 18/03/2026 at 09:45.
Pushed by nicolasfella into branch 'master'.

A11yKeyboardMonitor: Don't crash when XKB state is null

M  +4    -0    src/a11ykeyboardmonitor.cpp

https://invent.kde.org/plasma/kwin/-/commit/1c1329945cc6a39e9ad4d2b775802bfe07e56904
Comment 5 Nicolas Fella 2026-03-18 10:53:04 UTC
Git commit 0a513d4b404777399de369ec9d919b6956f7ba5a by Nicolas Fella.
Committed on 18/03/2026 at 10:09.
Pushed by nicolasfella into branch 'Plasma/6.6'.

A11yKeyboardMonitor: Don't crash when XKB state is null


(cherry picked from commit 1c1329945cc6a39e9ad4d2b775802bfe07e56904)

Co-authored-by: Nicolas Fella <nicolas.fella@gmx.de>

M  +4    -0    src/a11ykeyboardmonitor.cpp

https://invent.kde.org/plasma/kwin/-/commit/0a513d4b404777399de369ec9d919b6956f7ba5a
Comment 6 Nicolas Fella 2026-04-05 07:52:40 UTC
*** Bug 518540 has been marked as a duplicate of this bug. ***
Comment 7 Nicolas Fella 2026-04-05 07:53:03 UTC
*** Bug 509637 has been marked as a duplicate of this bug. ***