Skip to content

appimage: crashes at start on NixOS Wayland: bundled libxkbcommon finds no keyboard data (/usr/share/X11/xkb) #2437

Description

@zackees

What happens

Run directly on a NixOS 26.05 Wayland session (KDE), not through appimage-run, the AppImage crashes before the main window appears:

xkbcommon: ERROR: failed to add default include path /usr/share/X11/xkb
qt.qpa.wayland: failed to create xkb context
...
Segmentation fault (core dumped) "$HERE/usr/bin/obs-studio-rust-gui"
#0 xkb_context_ref () from .../usr/lib/libxkbcommon.so.0
#1 xkb_keymap_new ()
#2 xkb_keymap_new_from_buffer ()

Seen with the master AppImage bb253a0 (0.1.0-beta.20261025) while testing #891. Nix-ld's path held its default plus wayland. Under X11 (Xvfb) the same AppImage starts.

Cause

The bundled libxkbcommon looks for keyboard data only in its compiled default, /usr/share/X11/xkb. NixOS has none there. It provides the data at /etc/X11/xkb (from services.xserver.xkb) and doesn't set XKB_CONFIG_ROOT. Qt's Wayland plugin then gets no xkb context and dereferences it while building the compositor's keymap.

Proposed fix

AppRun exports XKB_CONFIG_ROOT when it is unset and /usr/share/X11/xkb is missing. It uses the first of /etc/X11/xkb and /run/current-system/sw/share/X11/xkb that exists, following the driver search paths of #722. RED/GREEN goes in test-apprun-driver-env.sh. The packaged check is a start on a Wayland compositor (for example headless weston or kwin) on a host without /usr/share/X11/xkb.

Security: local only. The data comes from the user's own system.

Activity

  1. added
    bug
    on Oct 26, 2026
  2. zackees commented on Oct 26, 2026

    @zackees
    MemberAuthor

    Claiming: #2437. RED in build-aux/appimage/test-apprun-driver-env.sh (no /usr/share/X11/xkb, XKB_CONFIG_ROOT unset → AppRun exports the first existing fallback; a set value or an existing default is left alone), then GREEN in AppRun.

  3. added
    ready
    on Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugready

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions