Skip to content

bug: media-playback: LeakSanitizer reports FFmpeg packet buffers in test_media_remux and test_media_alpha_network #3365

Closed

Description

@vpacher

What happens

The asan pass reports leaks of FFmpeg buffers in two media tests in every run. Triage puts the first OBS frame at:

  • test_media_alpha_network: shared/media-playback/media-playback/media.c.h:836 and test/cmocka/test_media_alpha_network.c:233, 480 bytes in 20 objects from av_buffer_ref under avcodec_send_packet
  • test_media_remux: test/cmocka/test_media_remux.c:272, 24 bytes from av_buffer_alloc under av_grow_packet in libavformat

Small sizes, but they repeat per packet, so a long playback leaks more.

What to do

  • Check whether media-playback releases every packet and frame it refs, at media.c.h:836 and on stop.
  • Check whether the tests themselves release what they open, at the two test lines.

The sanitizer harness's known list (rust/tools/sanitize/triage.py, #3290) has this as kind bug: the asan job does not count it, but fails once the test runs clean. So the fix PR also drops the entry.

Activity

  1. added
    bug
    P2
    size:M
    on Nov 1, 2026
  2. vpacher commented on Nov 1, 2026

    @vpacher
    MemberAuthor

    /ready

  3. added
    ready
    on Nov 1, 2026
  4. vpacher commented on Nov 1, 2026

    @vpacher
    MemberAuthor

    Claiming: the FFmpeg buffer leaks in the two media tests

    Plan (one PR, after #3290):

    1. Find which side leaks: media-playback (media.c.h:836, stop path) or the tests (test_media_remux.c:272, test_media_alpha_network.c:233).
    2. RED/GREEN on that side.
    3. Drop the two bug entries from the known list.

    First PR: after #3290 merges.

  5. vpacher commented on Nov 1, 2026

    @vpacher
    MemberAuthor

    Blocked: waiting on #3290

  6. added
    claim-blocked
    on Nov 1, 2026
  7. removed
    claim-blocked
    on Nov 1, 2026
  8. moved this from Blocked to In progress in obs-rust Multiviewon Nov 1, 2026
  9. vpacher commented on Nov 1, 2026

    @vpacher
    MemberAuthor

    Releasing the FFmpeg part of this issue.

    Done: the test_media_remux leak was the Rust remux port's (and the C remux's) packet on a cancelled job, fixed in #3432.

    Left: the test_media_alpha_network leak is in FFmpeg itself. A minimal program that only opens, probes and closes the test's VP9-alpha clip (avformat_open_input, avformat_find_stream_info, avformat_close_input) leaks the same 480 + 8242 + 960 bytes in 60 allocations with FFmpeg 8.0.1 (Ubuntu libavformat62 7:8.0.1-3ubuntu2) and no OBS code; the 20 other clips the media tests write do not leak. OBS closes its inputs correctly in media.c.h and in the test's check_clip().

    What is needed: an upstream FFmpeg report with that reproduction (not filed yet), then either a fixed FFmpeg or a suppression for that one stack. Until then the test keeps its known-list entry (rust/tools/sanitize/triage.py), and the entry should move from kind bug to a kind for third-party bugs once one exists.

  10. 9 remaining items

  11. added
    human-review-needed
    on Nov 13, 2026
  12. moved this from Triage to Needs decision in obs-rust Multiviewon Nov 13, 2026
  13. vpacher commented on Nov 14, 2026

    @vpacher
    MemberAuthor

    Decided: option B now, the FFmpeg report only if it still happens on FFmpeg master.

    • Add a narrow LeakSanitizer suppression for the one FFmpeg 8.0.1 stack (VP9-alpha open, probe and close, no OBS frames), plus a third-party kind in rust/tools/sanitize/triage.py, and remove the known entry.
    • FFmpeg wants a report reproduced on its latest master with the ffmpeg/ffprobe command line. If an ASan build of FFmpeg master shows the leak with ffprobe on a VP9-alpha file, we report it there. If not, it is already fixed, and the suppression comes out when our FFmpeg is updated.
  14. removed
    human-review-needed
    on Nov 14, 2026
  15. moved this from Needs decision to Triage in obs-rust Multiviewon Nov 14, 2026
  16. vpacher commented on Nov 14, 2026

    @vpacher
    MemberAuthor

    /ready
    Coordinator triage after the decision of 2026-11-14 08:41 UTC (option B). Acceptance:

    • A LeakSanitizer suppression that matches only the FFmpeg 8.0.1 VP9-alpha open, probe and close stack (no OBS frames in it).
    • A third-party kind in rust/tools/sanitize/triage.py, and the test_media_alpha_network known entry removed.
    • The asan pass is clean for test_media_alpha_network and reports any other leak in that test as before.
    • The FFmpeg report is a separate step: only if an ASan build of FFmpeg master still leaks with ffprobe on a VP9-alpha file.
  17. added
    ready
    size:S
    and removed
    size:M
    on Nov 14, 2026
  18. rdoupe commented on Nov 15, 2026

    @rdoupe
    Collaborator

    Claiming: the LeakSanitizer suppression for the FFmpeg VP9-alpha probe leak in test_media_alpha_network (option B).

    Plan (one PR):

    1. RED: reproduce the leak locally with an ASan build of test_media_alpha_network and a harness test that fails while the known entry has no third-party kind / no suppression.
    2. GREEN: rust/tools/sanitize/lsan.supp matching only that FFmpeg stack, wired into the asan options; a third-party kind in triage.py; the bug entry removed.
    3. Evidence: the test runs clean under asan with the suppression, and a planted OBS leak in the same test is still reported.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P2bugreadysize:S

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions