Skip to content

fix(desktop): preload host libwayland in AppImage to fix EGL abort (#892)#944

Open
esengine wants to merge 1 commit into
mainfrom
fix/desktop-appimage-wayland-libpath
Open

fix(desktop): preload host libwayland in AppImage to fix EGL abort (#892)#944
esengine wants to merge 1 commit into
mainfrom
fix/desktop-appimage-wayland-libpath

Conversation

@esengine
Copy link
Copy Markdown
Owner

Summary

  • #895 shipped WEBKIT_DISABLE_DMABUF_RENDERER=1 for APPIMAGE启动后黑屏 #892, but the reporter still hits the same WebKitWebProcess SIGABRT on openSUSE Tumbleweed + KDE Plasma 6 Wayland + Intel UHD. Reproduced in a Tumbleweed VM — the actual abort message is Could not create default EGL display: EGL_BAD_PARAMETER. Aborting..., which fires before DMABUF init, so fix(desktop): disable WebKit DMABUF renderer on Linux (AppImage black screen) #895 was treating a symptom that isn't on the failing path.
  • Root cause: AppImages bundle libwayland-client.so.0 from the Ubuntu CI runner; distros with a divergent libwayland ABI (Tumbleweed / Fedora / Arch on some weeks) make eglGetDisplay() return EGL_BAD_PARAMETER and WebKitGTK 2.42+ aborts unconditionally. Same pattern Tauri ecosystem has hit repeatedly — see tauri-apps/tauri#11988, gitbutlerapp/gitbutler#5282, Tolaria's auto-handling, yaak.app's writeup.
  • Fix: at main() entry, when we detect AppImage (APPDIR) + Wayland (WAYLAND_DISPLAY) on Linux, set LD_PRELOAD to the first existing host libwayland (/usr/lib64/..., then Debian-multiarch path). WebKitWebProcess is fork+exec'd from us, inherits the env, and links against the host libwayland instead of the bundled one. Also force WEBKIT_DISABLE_COMPOSITING_MODE=1 on the same code path. The DMABUF disable from fix(desktop): disable WebKit DMABUF renderer on Linux (AppImage black screen) #895 becomes a small helper but stays always-on for Linux (covers Mesa stacks that DON'T need the libwayland swap).

Test plan

  • cargo check --target x86_64-pc-windows-msvc — confirms the rest of main.rs still compiles
  • CI build matrix (Ubuntu/macOS/Windows) — exercises the target_os = "linux" body on Linux runners
  • Out-of-CI: rebuild AppImage from this branch via workflow_dispatch and hand to the APPIMAGE启动后黑屏 #892 reporter for a real-hardware confirmation before declaring fixed. The fix is environment-specific enough that VM testing alone isn't sufficient — the Tumbleweed VM hits the same EGL abort because the VBox vmwgfx driver is independently broken, which masked the libwayland-mismatch theory until we actually read the error message.

Refs #892. Will close once huangsijun17 confirms on real hardware.

)

The bundled libwayland-client.so.0 inside the AppImage was built on
Ubuntu 22.04 CI and ABI-mismatches the host Wayland compositor on
distros that ship a different libwayland (openSUSE Tumbleweed,
Fedora, Arch on some weeks). The mismatch makes
WebKitWebProcess::eglGetDisplay() return EGL_BAD_PARAMETER and the
process aborts with a short stack before the first paint — exactly
the SIGABRT the AppImage user in #892 still hits even with #895's
DMABUF disable in place.

WebKitWebProcess is fork+exec'd from the parent and inherits the env,
so setting LD_PRELOAD to the host's libwayland in main() redirects
just the child's dynamic linker without disturbing the already-loaded
parent. Gate it on APPDIR + WAYLAND_DISPLAY so distro packages,
debug builds, and X11 sessions are untouched. Skip the bare
/usr/lib/libwayland-client.so.0 path — on 64-bit Fedora it can be
a 32-bit library and the loader rejects it with an ELF-class warning.

Pattern confirmed by Tolaria, yaak, nym-vpn-client and the wider
Tauri AppImage user base (tauri-apps/tauri#11988,
gitbutlerapp/gitbutler#5282).
@esengine esengine mentioned this pull request May 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant