Skip to content

bug: AppImage: releases crash on launch when a scene has a PipeWire screen capture #426

Closed

Description

@rdoupe

The obs-rust AppImage crashes on launch for anyone whose scene has a Screen Capture (PipeWire) source, the usual capture on Wayland. OBS segfaults about a second after start, as soon as the portal hands it the PipeWire connection. (If the portal request is denied or cancelled, OBS never gets that far and doesn't crash.) It has done this since the AppImage was first published (#221, #269), and CI passed every time.

@zackees @probonopd, you're tagged because you merged and wrote the AppImage work (#221, #269, #91).

Affected: every published AppImage. Checked by listing the AppImage contents: continuous (every build since #269; reproduced on f44de6ee6, still missing the files at bbcfb4320) and the dated beta obs-studio-rust-v0.1.0-beta.20261012. The 20261011 beta has no AppImage.

Operating System: Arch Linux, Hyprland (Wayland), PipeWire 1.6.8 with pipewire-pulse, xdg-desktop-portal-hyprland 1.4.1

Steps to reproduce:

  1. Have a scene with a Screen Capture (PipeWire) source.
  2. Start OBS_Studio-33.0.0-beta6-723-gf44de6ee6-x86_64.AppImage.
  3. OBS segfaults after [pipewire] source selected, setting up screencast.

Log and backtrace:

pw.conf: error loading config '/tmp/.mount_obs-XXXXXX/usr/share/pipewire/client.conf': No such file or directory
pw.conf: can't load config client.conf: No such file or directory
Signal: 11 (SEGV) si_code: SEGV_MAPERR
#0  ?? () from usr/lib/libpipewire-0.3.so.0
#1  pw_context_connect_fd () from usr/lib/libpipewire-0.3.so.0

Cause

Two bugs line up:

  1. The AppImage ships half of PipeWire. It bundles libpipewire-0.3.so.0 and spa-0.2, but not usr/lib/pipewire-0.3/ (the client modules, including the native protocol) or usr/share/pipewire/ (client.conf). AppRun still points PIPEWIRE_MODULE_DIR and PIPEWIRE_CONFIG_DIR at those missing directories.
    • assemble-appdir.sh copies them with [ -d "$SYSLIB/pipewire-0.3" ] && cp ..., which silently skips a missing directory despite set -euo pipefail.
    • The CI build host (Ubuntu 26.04) installs only libpipewire-0.3-dev with --no-install-recommends. The client modules live in libpipewire-0.3-modules and client.conf in pipewire-bin, so they were never on the host to copy.
  2. OBS doesn't check pw_context_new(). In plugins/linux-pipewire/pipewire.c, the result is stored and the next call uses it. Without client.conf, pw_context_new() returns NULL, and pw_context_connect_fd(NULL, …) segfaults. On a normal install the system config is always there, so this never fires, but it should fail the source rather than crash OBS.

Reproduced outside OBS: a five-line program calling pw_context_new() then pw_context_connect() connects normally with the system libpipewire. With only the AppImage's PIPEWIRE_MODULE_DIR/PIPEWIRE_CONFIG_DIR set, it gets context=(nil) and segfaults with the same config error.

Why CI passed

test-appimage.sh starts the AppImage in Debian, Ubuntu and Fedora containers with a fresh profile and no scenes, and checks that a window appears and renders. Nothing connects to PipeWire, PulseAudio or a portal, so the code that crashes never runs. The test proves the window opens, not that OBS can capture or record. continuous is published on that result.

Upstream OBS has nothing to copy here: its CI never launches OBS, and its Flatpak gets PipeWire from the runtime. This repo already has the pieces, though: the private PipeWire daemon harness (test_pipewire_cursor_hdr.sh, test_pulse_monitor_device.sh) and the fake ScreenCast portal in test_pipewire_screencast_resume.c.

Fix (two PRs, in progress)

  1. linux-pipewire: don't crash when PipeWire setup fails (linux-pipewire: Fail cleanly when the PipeWire client cannot start #429). Check the results of pw_context_new() and the connect calls, log the cause, and leave the source failed instead of segfaulting. RED→GREEN cmocka test with a missing config directory; it needs no PipeWire daemon, so it also runs in CI.
  2. AppImage: bundle PipeWire completely and test what users run. All headless, with fakes instead of devices:
    • Install libpipewire-0.3-modules and pipewire-bin on the build host. assemble-appdir.sh fails if any directory AppRun exports is missing or incomplete, instead of skipping it.
    • Layer 1, everything loads: inside the AppRun environment, dlopen every bundled library, OBS plugin, PipeWire module, SPA plugin, GIO module, gconv module and Qt plugin. OBS's "Loaded modules" list must match the build, with a short allowlist for hardware-only modules (DeckLink, NVENC, QSV).
    • Layer 2, each subsystem is used once: a probe connects to a private PipeWire daemon and pipewire-pulse and does one round trip with each.
    • Layer 3, a real profile records: a seeded profile with a PipeWire screen capture, a PulseAudio mic and a PipeWire camera; the fake ScreenCast portal on a private D-Bus; fake producers replaying a known moving pattern and a known tone. OBS records a few seconds, and ffmpeg checks that the picture moves and the tone is there. OBS must stay up and the screencast must reach streaming.
    • These tests have to fail on today's continuous before they pass on the fix, and continuous only updates when all three pass.
    • Rule in AGENTS.md: packaging PRs must pass the real-profile launch, and review checks that the tests cover what users run, not only that a window opens.

Written with Claude Code (Claude Opus 5.5).

Activity

  1. rdoupe commented on Oct 13, 2026

    @rdoupe
    CollaboratorAuthor

    Follow-ups found while fixing this. They're listed here so nobody duplicates them. Each one gets its own issue and claim when its PR starts, in this order:

    Release launch safety (each of these could still let a release crash on launch with CI green):

    1. No Wayland launch test. Every AppImage launch test forces X11. Planned: a headless Wayland compositor lane running the same saved-profile test, gating continuous and the dated betas. This one is next, right after the packaging PR.
    2. Host GPU drivers next to bundled libraries. The host's Mesa/NVIDIA and VA-API drivers load into OBS beside our bundled libstdc++, libdrm and so on, and CI only uses software GL. Planned: fail the build on libraries the driver stack must share (the usual AppImage excludelist), and load the distro's EGL/VA-API drivers against the bundle in the test containers.
    3. Every AppRun redirect needs a test that uses it. The guard proves each exported path exists. A table in build-aux/appimage/README.md maps each export and bundled subsystem to its test, and lists what's still untested (V4L2, JACK, GlobalShortcuts portal).
    4. Release AppRun enables Qt, GL and EGL debug logging (QT_DEBUG_PLUGINS=1 LIBGL_DEBUG=verbose EGL_LOG_LEVEL=debug), which floods users' logs.
    5. ALSA config and plugins aren't bundled. Unconfirmed whether this breaks anything. Planned: a hardware-free null PCM probe first.

    PipeWire source behaviour (no crash, but users are left guessing):

    1. A camera portal failure disables cameras until restart. One Deny, or an accidental Escape, leaves initializing set, so camera sources stay black, with no explanation and no retry.
    2. Failed PipeWire sources show nothing in the UI. The cause only goes to the log. Planned: a status line in the source's Properties, with retry only on a user action, so there are no surprise portal dialogs.
    3. Handshake edge cases in obs_pipewire_connect_fd(). A dead peer during the first sync may hang the camera setup (needs a repro first), and the duplicated fd can leak if PipeWire fails before taking it.
  2. zackees commented on Oct 13, 2026

    @zackees
    Member

    Heads-up from #436 (maintainer request): Flatpak, the macOS/Windows OBS builds, Ubuntu Rust-libobs and Tier 2 macOS/Windows are moving out of PR and master-push runs into a gate that the daily release requires. appimage.yaml stops running per master push (continuous refreshes from the daily release). Those jobs still run, so caching work still pays off at release time. I'll keep my appimage.yaml edit to the trigger and the publish condition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions