Skip to content

appimage: Take ffmpeg 8.1.2 r3 from obs-studio-libs, with libsrt 1.5.7 - #1083

Merged
zackees merged 2 commits into
obs-rust:masterfrom
rdoupe:build/appimage-one-libsrt-157
Oct 18, 2026
Merged

zackees merged 2 commits into
obs-rust:masterfrom
rdoupe:build/appimage-one-libsrt-157

Conversation

@rdoupe

@rdoupe rdoupe commented Oct 16, 2026

Copy link
Copy Markdown
Collaborator

Fixes #1082

What and why

The AppImage now ships libsrt 1.5.7 instead of 1.5.2. The build also fails if it ever bundles more than one libsrt, or one older than 1.5.7.

  • libsrt version. Since the glibc 2.28 base (appimage: Build on a glibc 2.28 base and stop bundling glibc #927, appimage: Pin obs-studio-libs b35437f2c (rebuilds resolve by pinned sha256) #1047), the AppImage's only libsrt comes from the obs-studio-libs ffmpeg 8.1.2 r2 artifact, which builds libsrt 1.5.2 with mbedTLS. Both FFmpeg's srt:// protocol (libavformat) and the SRT output (obs-ffmpeg.so, which finds it through CMAKE_PREFIX_PATH) use that copy. 1.5.2 is older than the 1.5.4 that 0.1.0-beta.20261014 shipped. It is affected by three public upstream advisories: GHSA-6xg9-784j-24rm (KMREQ/KMRSP stack buffer overflow, fixed in 1.5.6), GHSA-4mc6-qmpp-g7gw (encryption downgrade, fixed in 1.5.6) and GHSA-m96h-3rc9-xx6h (heap buffer overflow, fixed in 1.5.7).
  • One libsrt. 0.1.0-beta.20261014 bundled two copies, libsrt.so.1.5 (OpenSSL) and libsrt-gnutls.so.1.5, and OBS aborted on quit after any SRT use: both copies destroyed the same interposed C++ globals. Master has one copy. Nothing kept it that way until now.

Change

  • ffmpeg 8.1.2 r3: libsrt 1.5.7 obs-studio-libs#4 (separate change, must be merged and the r3 artifact published first): in recipes/linux/ffmpeg.sh, srt() takes the v1.5.7 tag archive, pinned by sha256 017cd1e4...055d32b (the same tree as tag commit 899348d8). The options are unchanged (mbedTLS from the same prefix, shared only, no apps), and so are the soname (libsrt.so.1.5) and every other pin in the artifact. The artifact is packed with --label r3 next to r2.
  • build-aux/appimage/manylinux/deps.lock.json: ffmpeg 8.1.2 flavor r3. The sha256 in this commit is from a local build of that recipe. It must be replaced by the published asset's sha256 (dist/*.tar.zst.json of the maintainer's build) before merging.
  • check-appdir.sh (run by assemble-appdir.sh, so a failure stops the build, and again in the bundle scenario) fails unless:
    • the AppDir holds exactly one libsrt*.so*;
    • its version, read from its SRT_VERSION string with tr/grep (the test containers have no binutils), is at least 1.5.7;
    • no bundled ELF file needs another libsrt soname (libsrt-gnutls.so.1.5, ...).
  • test-appimage.sh: require_one_libsrt_mapped requires exactly one libsrt, inside the AppImage, in OBS's /proc/<pid>/maps, in first-start and saved-profile.
  • README: the check-appdir row and the Tests section.

Not changed: FFmpeg, mbedTLS, libvpx and the other codecs keep their versions. Windows and macOS (obs-deps libsrt 1.5.2) are a separate change.

RED → GREEN

  • RED: f79da41 test: check-appdir requires exactly one libsrt, at least 1.5.7. On master's AppImage build (manylinux_2_28 image, build.py --base manylinux), the appdir step stops with ::error::the bundled usr/lib/libsrt.so.1.5 is libsrt 1.5.2; at least 1.5.7 is required. Against the 0.1.0-beta.20261014 tree it reports expected exactly one libsrt in the AppImage, found 2: usr/lib/libsrt-gnutls.so.1.5 usr/lib/libsrt.so.1.5.
  • GREEN: 2bc1d6c. With the r3 artifact, the full workflow sequence (version, configure, build, appdir, appimage) passes in the image. check-appdir: ... one libsrt (1.5.7), check-glibc-floor: all 239 ELF files run on glibc 2.28.
  • libsrt 1.5.7's own test-srt (mbedTLS build, googletest) passes 277 tests (1 upstream-disabled) when run against the libsrt and mbedTLS libraries shipped in this AppImage.
  • Product A/B. A = master's AppImage, B = this branch's, both built the same way and run extracted. The setup was headless (private Xvfb, D-Bus and HOME), with a private network namespace (loopback only) and ulimit -c 0; each check ran on its own. 59 pairs A with B and B with A.
Check A: master (libsrt 1.5.2) B: this branch (1.5.7)
00-smoke (start, websocket, SIGTERM quit) PASS PASS
50-srt-libload (mapped copies, bindings, recording) PASS: 1 copy, 1.5.2 PASS: 1 copy, 1.5.7
51-srt-caller (plain, streamid+latency+pkt_size, rendezvous, F9/F10 hotkeys) PASS PASS
52-srt-listener (streamid, passphrase/pbkeylen 24, listen_timeout) PASS PASS
53-srt-encryption (AES-128/192/256; wrong, one-sided and short passphrases fail cleanly) PASS PASS
54-srt-stop-reconnect (reconnect in caller and listener mode, 8 rapid cycles, SIGTERM while live) PASS PASS
55-srt-listener-stop-waiting FAIL: known listener-stop hang FAIL: same
56-srt-media-source (OBS → OBS, listener/caller/encrypted, sender restart) PASS PASS
57-srt-ffmpeg-url-output (Custom FFmpeg output to srt://) PASS PASS
58-srt-options-long (about 30 URL options, key refresh, 70 s) PASS PASS
59-srt-interop (A ↔ B, encrypted, through the Media Source) PASS PASS
30 / 31 / 40 / 41 / 42 (profile API, record retry, websocket events, rescaled GetStats) PASS ×5 PASS ×5

Measured values match between A and B, including received packets, decode errors (0), audio level (-21 dB at ffmpeg receivers, -22 dB OBS → OBS), stop and reconnect times. No crash and no SIGABRT on quit in either build.

  • Single copy at runtime, B. In one OBS process that streams over SRT (obs-ffmpeg.so) and plays a Media Source srt:// listener (FFmpeg) at the same time:
    • /proc/<pid>/maps has one libsrt file, $APPDIR/usr/lib/libsrt.so.1.5;
    • LD_DEBUG=files loads it once;
    • LD_DEBUG=bindings binds obs-ffmpeg.so (22 srt_*) and libavformat.so.62 (15) to it;
    • SIGTERM quits cleanly ("Number of memory leaks: 0").
  • 55 is the pre-existing hang when stopping an SRT listener-mode stream before anyone connects. It fails identically in A, in B and in 0.1.0-beta.20261014, and it is not touched here.
  • How it ran: no container runtime was available, so the digest-pinned manylinux_2_28 image was unpacked and every RUN step of build-aux/appimage/manylinux/Dockerfile (and of obs-studio-libs recipes/linux/Dockerfile for the r3 build) was run in it under a user namespace. Then build.py --base manylinux ran as the workflow calls it. One local difference: AlmaLinux's ccache package could not be installed through rpm in the user namespace, so it was unpacked from the same rpm instead.

Checklist

  • Base is master
  • I claimed the issue, or no one else has an open PR for it
  • Characterization test (if the unit had none), then RED, then GREEN commits
  • (Optional) Local gate passed and the pushed head is stamped; otherwise PR CI runs the full suite
  • Warning or flag changes (-W..., ratchets): none
  • Intentional differences from C listed in the parity test header and rust/README.md (ports): not a port

AI note: Claude Code (Claude Opus 5.5) wrote the code, the tests, the commit messages and this text under the submitter's direction, and ran the tests above on the submitter's machines.

🤖 Generated with Claude Code

@zackees

zackees commented Oct 16, 2026

Copy link
Copy Markdown
Member

Build AppImage fails at the obs-studio-libs fetch:

ffmpeg 8.1.2: 0 entries match Platform(... glibc 2.28 ...) Variant(optimization='release', flavor='r3') with sha256 6421a3bc...

The obs-studio-libs releases only publish ffmpeg-8.1.2-linux-x86_64-glibc2.28-release.tar.zst (04:37 UTC) and ...-release-r2.tar.zst (08:00 UTC). There's no r3 asset yet. So the lock points at a build that hasn't been published, and the check-appdir RED/GREEN can't run until the r3 (libsrt ≥ 1.5.7) ffmpeg is uploaded to obs-studio-libs, with its sha256 matching deps.lock.json. Once it's there, re-running the job should be enough.

@rdoupe

rdoupe commented Oct 16, 2026

Copy link
Copy Markdown
Collaborator Author

Right, that's expected: this PR waits on obs-rust/obs-studio-libs#4, which builds the r3 ffmpeg with libsrt 1.5.7. The 6421a3bc... in deps.lock.json is from my local r3 build. Once #4 is merged and the r3 asset is published, I'll update the sha256 to the published asset's and push, and the job should pass.

@zackees

zackees commented Oct 16, 2026

Copy link
Copy Markdown
Member

obs-rust/obs-studio-libs#4 is merged (libsrt 1.5.7; I checked the archive sha256 independently). That repo has no workflow that builds the ffmpeg artifact; its only workflow is Qt. So the ffmpeg-8.1.2-linux-x86_64-glibc2.28-release-r3.tar.zst asset still has to be built from the new recipe and uploaded to the ffmpeg 8.1.2 release. Once it's there and its sha256 matches deps.lock.json, re-running Build AppImage here should go green.

@rdoupe

rdoupe commented Oct 16, 2026

Copy link
Copy Markdown
Collaborator Author

Thanks for checking the archive. We only have read access to obs-studio-libs, so building and uploading r3 needs a maintainer. In the manylinux_2_28 image: recipes/linux/build.sh ffmpeg, then pack with --label r3 and upload it to the ffmpeg 8.1.2 release beside r2 (README "Rebuilds sit beside the original").

The recipe isn't bit-reproducible: the temporary build directory ends up inside some codec libraries. So the published asset's sha256 won't match the 6421a3bc... from my local build. Once the asset is up, I'll put its sha256 into deps.lock.json here and re-run Build AppImage. The same applies to r4 (FFmpeg 8.1.3, obs-studio-libs#5) when that one lands.

@zackees

zackees commented Oct 17, 2026

Copy link
Copy Markdown
Member

Feel free to --admin merge through CI as this refactor wraps up.

@zackees
zackees removed this pull request from the merge queue due to a manual request Oct 17, 2026
@zackees

zackees commented Oct 17, 2026

Copy link
Copy Markdown
Member

Maintainer loop: I took this back out of the merge queue (it was queued at 05:28). It pins ffmpeg 8.1.2 r3 with sha256 6421a3bc... from your local build. The obs-studio-libs ffmpeg-8.1.2 release still has only the original and r2 assets, and as you said, the published r3 won't match a local hash. The merge-queue run doesn't build the AppImage, so this would have merged green and broken master's AppImage build. Re-queue once r3 is uploaded and deps.lock.json has its real sha256.

@zackees zackees left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the diff. The check design is sound: exactly one libsrt* in the AppDir, at least 1.5.7, no bundled ELF that NEEDS another libsrt soname, and one mapped copy in /proc/<pid>/maps in first-start and saved-profile. RED against both master (1.5.2) and the beta tree (two copies) is convincing, and so is the A/B table. Findings:

  1. Placeholder issue number. check-appdir.sh and test-appimage.sh both say (obs-rust/obs-studio#ISSUE) in the two-copies comment. Please put the real issue number (the SIGABRT-on-quit report) or drop the reference.
  2. Blocker, already known: deps.lock.json still pins the local r3 sha256 6421a3bc.... It needs the published asset's sha256 before requeueing (maintainer comment above). Build AppImage fails on exactly this.
  3. Version read is a bit loose. tr '\\0' '\\n' | grep -xE '[0-9]+\.[0-9]+\.[0-9]+' over the whole .so assumes libsrt's only bare x.y.z string is SRT_VERSION. It holds for this build (mbedTLS shared), but a static mbedTLS or OpenSSL link would add its own version string and turn this into a 'cannot read the version' error rather than a wrong pass. That's safe-failing, so fine; maybe say so in the comment.
  4. Strict on symlinks. The count uses find -type f -o -type l, so a bundled libsrt.so.1.5 -> libsrt.so.1.5.7 pair would count as 2. Today the AppDir has the soname file only, so OK. Just noting the check would need adjusting if bundling ever keeps the chain.
  5. Nit: when the count isn't 1, srt_version is unset and the final success line can't be reached, so no issue there.

@rdoupe
rdoupe force-pushed the build/appimage-one-libsrt-157 branch from 2bc1d6c to ae3a2ec Compare October 17, 2026 19:09
@rdoupe

rdoupe commented Oct 17, 2026

Copy link
Copy Markdown
Collaborator Author

Thanks for the review. Pushed 12e1b14 (RED) / ae3a2ec (GREEN). The changes are folded into the RED commit, which owns these lines:

  1. Both comments now point at bug: AppImage: libsrt is outdated (public advisories), and the next build drops it from 1.5.4 to 1.5.2 #1082, whose section 2 is the two-copies SIGABRT-on-quit report.
  2. The version-read comment now says it assumes SRT_VERSION is the only bare x.y.z string while mbedTLS is shared. With a static TLS library it fails with "cannot read the version" and never passes a wrong version.
  3. A line above the count notes that symlinks count, so a kept soname chain would need the count adjusted.

2 is unchanged: deps.lock.json still waits for the published r3 sha256.

@zackees

zackees commented Oct 17, 2026

Copy link
Copy Markdown
Member

Thanks @rdoupe. GitHub ran no CI on ae3a2ec because the PR now conflicts with master: build-aux/appimage/test-appimage.sh, which your #1227 also changed. Could you rebase onto master when you get a chance? The r3 artifact is still pending on our side.

@zackees
zackees enabled auto-merge October 17, 2026 23:19
rdoupe and others added 2 commits October 18, 2026 00:56
…Refs obs-rust#1082)

check-appdir.sh fails unless the AppDir holds exactly one libsrt*.so*,
its embedded version (SRT_VERSION, read without binutils) is at least
1.5.7, and no bundled ELF file needs another libsrt soname. Two copies
in one process (the Ubuntu-built AppImages bundled libsrt.so.1.5 and
libsrt-gnutls.so.1.5; obs-ffmpeg.so's srt_* calls bound to the GnuTLS
one) both ran the destructors of the same interposed C++ globals, and
OBS aborted on quit after any SRT use. libsrt before 1.5.7 has public
advisories GHSA-6xg9-784j-24rm, GHSA-4mc6-qmpp-g7gw and
GHSA-m96h-3rc9-xx6h.

test-appimage.sh also requires exactly one libsrt, the AppImage's, in
OBS's /proc/<pid>/maps in first-start and saved-profile.

Fails on the glibc 2.28 build: the obs-studio-libs FFmpeg 8.1.2 r2
artifact bundles libsrt 1.5.2 ("the bundled usr/lib/libsrt.so.1.5 is
libsrt 1.5.2; at least 1.5.7 is required"), so assemble-appdir.sh stops.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Fixes obs-rust#1082)

The obs-studio-libs ffmpeg artifact holds the AppImage's only libsrt:
FFmpeg's srt:// protocol and the SRT output in obs-ffmpeg both link it
(obs-ffmpeg finds it through CMAKE_PREFIX_PATH /opt/obs-deps/ffmpeg).
r2 built libsrt 1.5.2, which has public advisories GHSA-6xg9-784j-24rm,
GHSA-4mc6-qmpp-g7gw and GHSA-m96h-3rc9-xx6h. r3 is the same recipe with
libsrt 1.5.7 (the v1.5.7 tag, pinned by sha256; mbedTLS as before).
Nothing else in the artifact changes version.

Built the AppImage locally the way the workflow does (manylinux_2_28
image, build.py --base manylinux): check-appdir.sh now passes with one
libsrt 1.5.7, and the glibc 2.28 floor check passes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@rdoupe
rdoupe force-pushed the build/appimage-one-libsrt-157 branch from ae3a2ec to dfc9315 Compare October 18, 2026 04:56
@rdoupe

rdoupe commented Oct 18, 2026

Copy link
Copy Markdown
Collaborator Author

Rebased onto master: 82fcf8e (RED) / dfc9315 (GREEN). The only conflict was the comment block at the top of test-appimage.sh; it now names both checks (one libsrt from the AppImage, and no plugins from the host's system directories). The two commits are otherwise unchanged.

deps.lock.json still has the placeholder sha256 for r3, so Build AppImage will fail at the obs-studio-libs fetch until the r3 asset is uploaded. I'll put the published sha256 in as soon as it is up.

On r3: I built the recipe at a5c51cf (the obs-studio-libs#4 merge) twice in the pinned manylinux_2_28 image. Both builds pass pack's glibc 2.28 check and contain lib/libsrt.so.1.5.7, about 6 minutes each. The builds are not bit-reproducible (the mktemp -d work path from common.sh ends up in 13 libraries, and four differ only in their build ID), so the sha256 has to come from the uploaded file. Note that main now builds 8.1.3 (obs-studio-libs#5), so r3 has to be built from a5c51cf, not main.

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

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

bug: AppImage: libsrt is outdated (public advisories), and the next build drops it from 1.5.4 to 1.5.2

2 participants