Skip to content

CEF prewarm webview triggers a fatal X_ConfigureWindow BadWindow crash on Wayland #2463

@distorx

Description

@distorx

Summary

On KDE Plasma (Wayland → XWayland), the v0.54.0 Linux AppImage crashes ~1–2 seconds after the window appears: an Xlib BadWindow error on X_ConfigureWindow aborts the process. Setting OPENHUMAN_CEF_PREWARM=0 fully resolves it, which points the cause at the CEF cold-start prewarm webview.

Problem

Expected: the app window opens and stays usable.

Actual: the window appears, CEF + GTK initialize (RunEvent::Ready logs), then the process exits (code 1) with the default Xlib error handler firing:

[tray] skipping tray setup on linux: tray menu creation still panics inside GTK during packaged runs
data directory is not yet implemented
X Error of failed request:  BadWindow (invalid Window parameter)
  Major opcode of failed request:  12 (X_ConfigureWindow)
  Resource id in failed request:  0x1200001
  Serial number of failed request:  7
  Current serial number in output stream:  11

The resource id varies per run (0x1200001, 0x1400001, 0x1600001), consistent with a freshly-created window being configured before it is valid.

Steps to reproduce:

  1. KDE Plasma 6 on Wayland (the app runs via XWayland).
  2. Install the v0.54.0 release AppImage (OpenHuman_0.54.0_amd64.AppImage).
  3. Launch openhuman.
  4. The window opens, then the process aborts with the X_ConfigureWindow BadWindow error above.

Note: on Arch-family distros the AppImage first fails to launch at all with sharun: Interpreter not found! (#2417 / #2380 / #2368). To get far enough to reach this crash I worked around that with SHARUN_LDNAME=/lib64/ld-linux-x86-64.so.2. The X crash itself is independent of that workaround.

Impact: the app is unusable on this setup — it crashes on every launch within ~2s of the window appearing. Tried with GDK_BACKEND=x11, --ozone-platform=wayland, and --enable-features=UseOzonePlatform --ozone-platform-hint=auto — all crash identically.

Version / platform:

  • OpenHuman v0.54.0, packaged AppImage (latest release)
  • CachyOS (Arch-based), Linux 7.x, KDE Plasma 6 on Wayland → app runs under XWayland
  • Desktop (packaged), not a dev build

Solution (optional)

OPENHUMAN_CEF_PREWARM=0 completely resolves the crash — with it set, the app launches and stays up indefinitely with normal JSON-RPC traffic. The crash therefore traces to the CEF prewarm path (spawn_cef_prewarm), which spawns a hidden 1×1 child webview parked off-screen shortly after the main window's first paint. Positioning/configuring that off-screen child webview appears to issue an X_ConfigureWindow against a window that is not yet valid under XWayland, and the resulting BadWindow is fatal.

The app appears to install a silent X error handler, but it does not catch this one — likely because the failing X request originates in a CEF subprocess rather than the main process where the handler is installed (a shared_memory_switch.cc … Failed global descriptor lookup: 7 subprocess error is logged just before the crash).

Possible directions:

  • Ensure the silent X error handler also covers CEF subprocesses.
  • Delay/guard the prewarm child webview until its X window is realized, or skip the off-screen reposition under XWayland.
  • Gate prewarm off by default on Linux/XWayland.

Acceptance criteria

  • Repro gone — the v0.54.x AppImage launches and stays up on KDE Wayland/XWayland with prewarm enabled (default).
  • Regression safety — coverage added for the prewarm child-webview path / X-error handling on Linux.
  • Diff coverage ≥ 80% — the fix PR meets the changed-lines coverage gate.
  • Subprocess X errors covered — the silent X error handler is verified to apply to CEF subprocesses, not just the main process.

Related

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions