Skip to content

fix(sanitize): suppress FFmpeg 8.0.1's VP9-alpha probe leak, not the test (#3365) - #4872

Merged
rdoupe merged 2 commits into
masterfrom
fix/lsan-ffmpeg-vp9-alpha-3365
Nov 15, 2026
Merged

rdoupe merged 2 commits into
masterfrom
fix/lsan-ffmpeg-vp9-alpha-3365

Conversation

@rdoupe

@rdoupe rdoupe commented Nov 15, 2026 •

Copy link
Copy Markdown
Collaborator

The asan pass kept test_media_alpha_network on the known list for a leak that is FFmpeg 8.0.1's own, so any other leak in that test was hidden too. This follows the decision on #3365 (option B): a narrow LeakSanitizer suppression, a third-party kind in triage.py, and the known entry removed.

What changes

  • rust/tools/sanitize/lsan.supp (new), one line: leak:avformat_find_stream_info. sanitize.py passes it as LSAN_OPTIONS=suppressions=... to every test and the app launch. LSAN_OPTIONS names no log_path, so the reports still go to the ASan log that ASAN_OPTIONS names.
  • triage.py: the ("asan", "test_media_alpha_network") bug entry is gone. A new third-party kind is for a library failure that no narrow suppression can match. Like bug, it names its issue, and a clean run fails the job so the entry gets dropped.
  • ci/test_sanitize_triage.py: the known-kind rules are now tested with synthetic entries, since the real list has no bug entry left. KNOWN_ENTRIES goes from 3 to 2.
  • Knowledge docs: sanitizer-known-list.md (kinds, when to suppress instead of listing), asan-pr-failure.md, local-sanitizers.md.

The leak, reproduced

ubuntu:26.04 (the asan runner's image) with libavformat62 7:8.0.1-3ubuntu2. The test is test_media_alpha_network's own write_clip and check_clip, copied into a standalone program built with gcc -fsanitize=address against the distro FFmpeg. No OBS code is involved.

  • Only the VP9-alpha clip that starts between keyframes (vp9-alpha-late.webm, where the decoder logs "Not all references are available") leaks. The other four clips run clean.
  • It leaks 480 + 8242 + 960 bytes in 60 allocations, the same numbers as on the asan runner.
  • The direct leak comes from av_buffer_ref ← (libavcodec) ← avcodec_send_packet ← (libavformat) ← avformat_find_stream_info ← check_clip. The two indirect leaks come from av_buffer_realloc ← (libavformat) ← avformat_find_stream_info.
  • FFmpeg is stripped, so the exported entry points are the only names a suppression can match. A module match (libavcodec.so) would also hide an AVPacket that OBS allocates and never frees.
suppression (LSAN_OPTIONS) reported, with a planted malloc(77) and a planted av_packet_alloc() leak in main
none FFmpeg direct 480 B, indirect 8242 B + 960 B, planted 77 B, planted 104 B
leak:avformat_find_stream_info planted 77 B, planted 104 B only (FFmpeg's indirect leaks go too)

FFmpeg 9.0.2 (Arch, libavformat 63.1.102) runs the same program clean. So per the decision no FFmpeg report is needed, and the line comes out when the asan runner's FFmpeg is past 8.0 (the comment in lsan.supp says so).

RED → GREEN

RED (78c320f3c1, the tests against master's sanitize.py and triage.py):

$ uv run --no-project -m unittest ci/test_sanitize_triage.py ci/test_sanitize_harness.py
ERROR: test_lsan_suppressions_are_the_ffmpeg_probe_only ... KeyError: 'LSAN_OPTIONS'
FAIL: test_the_list_does_not_grow_unseen ... AssertionError: 3 != 2
FAIL: test_media_alpha_network_leaks_count ... AssertionError: 0 != 1
FAIL: test_third_party_entry_that_ran_clean_is_a_finding ... AssertionError: 0 != 1
Ran 71 tests ... FAILED (failures=3, errors=1)

GREEN (928eec602b): Ran 71 tests ... OK, and ./lint is ok.

The scheduled Sanitizers run is the end-to-end check: on master, test_media_alpha_network exits 0 but is listed under "Known (not counted)" because of these reports (run 43601400610). With this change it should count as clean. That run is red at the moment for an unrelated reason, so this PR will not make it green on its own.

Fixes #3365

🤖 Generated with Claude Code

rdoupe and others added 2 commits November 14, 2026 22:16
The asan pass keeps test_media_alpha_network on the known list for a leak
that is FFmpeg 8.0.1's own: probing a VP9-alpha WebM that starts between
keyframes leaks one AVBufferRef per probed packet, with no OBS frame below
avformat_find_stream_info. Listing the test hides every other leak in it.

- harness: LSAN_OPTIONS names lsan.supp, whose only line is
  leak:avformat_find_stream_info, and no log_path.
- triage: test_media_alpha_network's leaks count again; a third-party
  kind exists, tracks an issue, and fails the job once it runs clean;
  the known-kind rules are kept tested with synthetic entries, since the
  real list no longer has a bug entry. KNOWN_ENTRIES drops to 2.

Refs #3365

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…test (#3365)

rust/tools/sanitize/lsan.supp holds one line, leak:avformat_find_stream_info,
and sanitize.py passes it as LSAN_OPTIONS (no log_path, so the reports stay
in the ASan log). test_media_alpha_network leaves the known list, so any
other leak in it fails the asan pass again.

Reproduced on ubuntu:26.04 (libavformat62 7:8.0.1-3ubuntu2) with the test's
own write_clip and check_clip: the VP9-alpha clip that starts between
keyframes leaks 480 + 8242 + 960 bytes in 60 allocations, every frame below
check_clip in FFmpeg. With the suppression only a planted malloc and a
planted av_packet_alloc leak are reported. FFmpeg 9.0.2 runs it clean.

triage.py gains a third-party kind for a library failure no narrow
suppression can match; like bug, it names its issue and a clean run fails
the job so the entry goes.

Fixes #3365

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Ci-Attestation: {"at":1794712732,"gate":"data/all/compatibility","host":"linux-x86_64","key":"","lane":"client-checks","parents":["78c320f3c1fe253378739f5aa01f6e5f1538335a"],"secs":51,"stamp":"f137128554842fefdd6e51647135da45","tree":"6ec8a2332c4614a1099c0053951eef6a2cffc698","v":1,"via":"run"}
Ci-Attestation: {"at":1794712732,"gate":"data/all/flatpak-manifest","host":"linux-x86_64","key":"","lane":"client-checks","parents":["78c320f3c1fe253378739f5aa01f6e5f1538335a"],"secs":51,"stamp":"241c5e7857df7324701d81f893c23c3a","tree":"6ec8a2332c4614a1099c0053951eef6a2cffc698","v":1,"via":"run"}
Ci-Attestation: {"at":1794712732,"gate":"data/all/qt-xml","host":"linux-x86_64","key":"","lane":"client-checks","parents":["78c320f3c1fe253378739f5aa01f6e5f1538335a"],"secs":51,"stamp":"cdccc455ab075eb9393819050cfca228","tree":"6ec8a2332c4614a1099c0053951eef6a2cffc698","v":1,"via":"run"}
Ci-Attestation: {"at":1794712732,"gate":"data/all/services-schema","host":"linux-x86_64","key":"","lane":"client-checks","parents":["78c320f3c1fe253378739f5aa01f6e5f1538335a"],"secs":51,"stamp":"ab68c71c21e9b8cd57762dd820eed519","tree":"6ec8a2332c4614a1099c0053951eef6a2cffc698","v":1,"via":"run"}
Ci-Attestation: {"at":1794712680,"gate":"general/all/client-lint","host":"linux-x86_64","key":"b11a1f7a1d2c8a39f4a19148e3c522b78b915c9b16cc7d6d4f672d71f72e4ad5","lane":"client-lint","parents":["78c320f3c1fe253378739f5aa01f6e5f1538335a"],"secs":10,"stamp":"b0677ae5d0ce93b71094e4463eb1fae1","tree":"6ec8a2332c4614a1099c0053951eef6a2cffc698","v":1,"via":"run"}
Ci-Attestation: {"at":1794712732,"gate":"python/all/self-test","host":"linux-x86_64","key":"","lane":"client-checks","parents":["78c320f3c1fe253378739f5aa01f6e5f1538335a"],"secs":51,"stamp":"3743492a23debaf365cace2d4285a59a","tree":"6ec8a2332c4614a1099c0053951eef6a2cffc698","v":1,"via":"run"}
Ci-Attestation: {"at":1794712681,"gate":"rust/aarch64-apple-darwin/client-clippy","host":"linux-x86_64","key":"b11a1f7a1d2c8a39f4a19148e3c522b78b915c9b16cc7d6d4f672d71f72e4ad5","lane":"client-lint","parents":["78c320f3c1fe253378739f5aa01f6e5f1538335a"],"secs":10,"stamp":"8774caafac6640adbc8179daec010c98","tree":"6ec8a2332c4614a1099c0053951eef6a2cffc698","v":1,"via":"run"}
Ci-Attestation: {"at":1794712681,"gate":"rust/aarch64-apple-darwin/client-dylint","host":"linux-x86_64","key":"b11a1f7a1d2c8a39f4a19148e3c522b78b915c9b16cc7d6d4f672d71f72e4ad5","lane":"client-lint","parents":["78c320f3c1fe253378739f5aa01f6e5f1538335a"],"secs":10,"stamp":"9f1ab59a4bee5bad12fca72e3db950b2","tree":"6ec8a2332c4614a1099c0053951eef6a2cffc698","v":1,"via":"run"}
Ci-Attestation: {"at":1794712681,"gate":"rust/aarch64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"b11a1f7a1d2c8a39f4a19148e3c522b78b915c9b16cc7d6d4f672d71f72e4ad5","lane":"client-lint","parents":["78c320f3c1fe253378739f5aa01f6e5f1538335a"],"secs":10,"stamp":"9a559dfa1c39dc5514f5adf97b9010a7","tree":"6ec8a2332c4614a1099c0053951eef6a2cffc698","v":1,"via":"run"}
Ci-Attestation: {"at":1794712681,"gate":"rust/aarch64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"b11a1f7a1d2c8a39f4a19148e3c522b78b915c9b16cc7d6d4f672d71f72e4ad5","lane":"client-lint","parents":["78c320f3c1fe253378739f5aa01f6e5f1538335a"],"secs":10,"stamp":"db42489d5a1590f6e1b6db3cec622eb3","tree":"6ec8a2332c4614a1099c0053951eef6a2cffc698","v":1,"via":"run"}
Ci-Attestation: {"at":1794712681,"gate":"rust/aarch64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"b11a1f7a1d2c8a39f4a19148e3c522b78b915c9b16cc7d6d4f672d71f72e4ad5","lane":"client-lint","parents":["78c320f3c1fe253378739f5aa01f6e5f1538335a"],"secs":10,"stamp":"584fff7c41e4456d992fbd680e628c18","tree":"6ec8a2332c4614a1099c0053951eef6a2cffc698","v":1,"via":"run"}
Ci-Attestation: {"at":1794712681,"gate":"rust/aarch64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"b11a1f7a1d2c8a39f4a19148e3c522b78b915c9b16cc7d6d4f672d71f72e4ad5","lane":"client-lint","parents":["78c320f3c1fe253378739f5aa01f6e5f1538335a"],"secs":10,"stamp":"2ad37ee02cd8901efe30f91049478db0","tree":"6ec8a2332c4614a1099c0053951eef6a2cffc698","v":1,"via":"run"}
Ci-Attestation: {"at":1794712681,"gate":"rust/x86_64-apple-darwin/client-clippy","host":"linux-x86_64","key":"b11a1f7a1d2c8a39f4a19148e3c522b78b915c9b16cc7d6d4f672d71f72e4ad5","lane":"client-lint","parents":["78c320f3c1fe253378739f5aa01f6e5f1538335a"],"secs":10,"stamp":"f7fb04ab687b85bf08b90ab72fe3855d","tree":"6ec8a2332c4614a1099c0053951eef6a2cffc698","v":1,"via":"run"}
Ci-Attestation: {"at":1794712681,"gate":"rust/x86_64-apple-darwin/client-dylint","host":"linux-x86_64","key":"b11a1f7a1d2c8a39f4a19148e3c522b78b915c9b16cc7d6d4f672d71f72e4ad5","lane":"client-lint","parents":["78c320f3c1fe253378739f5aa01f6e5f1538335a"],"secs":10,"stamp":"6d9576083559e8a2d642bf5fc2643f2b","tree":"6ec8a2332c4614a1099c0053951eef6a2cffc698","v":1,"via":"run"}
Ci-Attestation: {"at":1794712681,"gate":"rust/x86_64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"b11a1f7a1d2c8a39f4a19148e3c522b78b915c9b16cc7d6d4f672d71f72e4ad5","lane":"client-lint","parents":["78c320f3c1fe253378739f5aa01f6e5f1538335a"],"secs":10,"stamp":"98a7a5ff07b8823fafbdc7e4dc50b79c","tree":"6ec8a2332c4614a1099c0053951eef6a2cffc698","v":1,"via":"run"}
Ci-Attestation: {"at":1794712681,"gate":"rust/x86_64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"b11a1f7a1d2c8a39f4a19148e3c522b78b915c9b16cc7d6d4f672d71f72e4ad5","lane":"client-lint","parents":["78c320f3c1fe253378739f5aa01f6e5f1538335a"],"secs":10,"stamp":"b84ff86671c60a6565c6c0d47f03bcee","tree":"6ec8a2332c4614a1099c0053951eef6a2cffc698","v":1,"via":"run"}
Ci-Attestation: {"at":1794712681,"gate":"rust/x86_64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"b11a1f7a1d2c8a39f4a19148e3c522b78b915c9b16cc7d6d4f672d71f72e4ad5","lane":"client-lint","parents":["78c320f3c1fe253378739f5aa01f6e5f1538335a"],"secs":10,"stamp":"3b0845068f7d57a478209fcfe890e88a","tree":"6ec8a2332c4614a1099c0053951eef6a2cffc698","v":1,"via":"run"}
Ci-Attestation: {"at":1794712681,"gate":"rust/x86_64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"b11a1f7a1d2c8a39f4a19148e3c522b78b915c9b16cc7d6d4f672d71f72e4ad5","lane":"client-lint","parents":["78c320f3c1fe253378739f5aa01f6e5f1538335a"],"secs":10,"stamp":"da33d8415f2bd6d9800c7eab0f3bb829","tree":"6ec8a2332c4614a1099c0053951eef6a2cffc698","v":1,"via":"run"}
Ci-Attestation: {"at":1794713143,"gate":"rust/x86_64-unknown-linux-gnu/client-test","host":"linux-x86_64","key":"8149cab6a61cd3282508520b4e613d95075781bd42e195f970ce10d57aae1c16","lane":"client-test-x86_64-unknown-linux-gnu","parents":["78c320f3c1fe253378739f5aa01f6e5f1538335a"],"secs":410,"stamp":"d84303893f6f92dc129aa0715f0cc081","tree":"6ec8a2332c4614a1099c0053951eef6a2cffc698","v":1,"via":"run"}

Client-Checks: {"checks":{"base":"cb5adffb4dadaaecb904be7211096642a22936d7","coverage":"all-tracked-applicable-files","diff":["ci/test_sanitize_harness.py","ci/test_sanitize_triage.py","docs/knowledge/asan-pr-failure.md","docs/knowledge/index.md","docs/knowledge/local-sanitizers.md","docs/knowledge/sanitizer-known-list.md","rust/tools/sanitize/lsan.supp","rust/tools/sanitize/sanitize.py","rust/tools/sanitize/triage.py"],"head":"a38fafaa1e215379a37f8f67116e92a16ba34a84","tools":{"orchestrator-python":"3.13.16 (main, Oct 14 2026, 01:04:01) [Clang 23.1.3 ]","schema-dependencies":"3.13.16 (main, Oct 14 2026, 01:04:01) [Clang 23.1.3 ]\n{'jsonschema': '4.26.0', 'json_source_map': '1.0.5'}","uv":"uv 0.13.5 (x86_64-unknown-linux-gnu)","xmllint":"xmllint: using libxml version 21504-GITv2.15.4\n   compiled with: Threads Tree Output Push Reader Patterns Writer SAXv1 DTDValid HTML C14N Catalog XPath XPointer XInclude Iconv ICU ISO8859X Regexps Automata RelaxNG Schemas Schematron Modules Debug Zlib"},"tracked-digest":"c400de69ef84c37e346689092c93e03091286db0f362d8eb63bb022e7a5fff76","tree":"6ec8a2332c4614a1099c0053951eef6a2cffc698"}}
@rdoupe
rdoupe requested a review from zackees as a code owner November 15, 2026 03:25
@rdoupe
rdoupe added this pull request to the merge queue Nov 15, 2026
Merged via the queue into master with commit 846ca85 Nov 15, 2026
41 checks passed
@rdoupe
rdoupe deleted the fix/lsan-ffmpeg-vp9-alpha-3365 branch November 15, 2026 04:12
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: media-playback: LeakSanitizer reports FFmpeg packet buffers in test_media_remux and test_media_alpha_network

1 participant