Skip to content

bug: master's Sanitizers lane is red — asan finds 8 conversion sites the Tier 2 build never compiles, valgrind finds a v4l2 format mismatch #2923

Closed

Description

@zackees

What

Sanitizers is red on master. Run 40884102538 at 32c4bcc19 fails two of its four jobs: asan 🧪 and valgrind 🧪 (tsan passes).

The previous run, 40774974849 at 7b1546a72 (2026-10-28 21:48 UTC), was green in all four jobs, so this arrived inside that window — the same window as the #2625 per-target ratchet merges.

asan 🧪 — 8 diagnostics in targets ratcheted on 2026-10-29

Compile errors (-Werror), no runtime report was reached:

File Line Diagnostic
plugins/obs-ffmpeg/obs-ffmpeg-vaapi.c.h 434 conversion to unsigned int from int may change sign [-Wsign-conversion]
plugins/obs-ffmpeg/obs-ffmpeg-vaapi.c.h 435 same, height /= 1 << fmt_desc->log2_chroma_h
plugins/obs-outputs/rtmp-av1.c.h 109 int to uint8_t may change value [-Wconversion] (result >>= 8 - 1)
plugins/obs-outputs/rtmp-av1.c.h 499, 500 int to uint8_t (seq_params.profile << 5 | seq_params.level, …)
plugins/obs-outputs/mp4-mux.c.h 524 int to uint8_t (s_w8(s, full_range << 7))
plugins/obs-outputs/rtmp-hevc.c.h 827, 843 int to uint8_t (s_w8(...) bit-field expressions)

obs-ffmpeg was ratcheted by #2865 (merged 2026-10-29 05:45) and obs-outputs by #2872. Both are the exact class these ratchets remove, so the ratchet's validation lane did not compile these sites: earlier slices hit the same blind spot on macOS (rist_sender_create, #2869/#2875) and on the Cocoa seams (#2900). Every site is a bit-shift expression whose value provably fits the destination byte, so the fix is a cast at the call (s_w8(s, (uint8_t)(...)), (unsigned)(1 << ...)), not a value change.

valgrind 🧪 — two classes, one proven change and one unmasked

Why this matters beyond the two lanes

Sanitizers runs on a schedule, so nothing here blocks a PR: Tier 2, Fast Gate and CI Gate ✅ are green on the same commit. That is exactly how a ratchet can ratchet over a build configuration it never compiles — the third time this has happened in this series. Two options, for a maintainer to choose:

  1. Add the sanitizer configuration to the ratchet PR checklist (compile the target in the -DDEBUG asan tree before queueing).
  2. Better: have ci/ detect it mechanically — a ci/test_*.py that compiles each already-ratcheted target's TUs in the sanitizer configuration is a build, not a test, so this may belong in the asan/valgrind lane's own "select passes" instead: select asan when a ratcheted target's sources change, so the PR that rats it pays for the check.

Acceptance

  • Sanitizers green on master again.
  • No value change at any site: the casts only state the conversion that already happened.
  • The chosen mitigation from the two options above, so the next ratchet slice cannot land with a sanitizer-only error.

Filed from a worker tick; the run links and log lines above are from gh run view 40884102538 --log.

Activity

  1. added
    bug
    P1
    size:M
    on Oct 29, 2026
  2. zackees commented on Oct 29, 2026

    @zackees
    MemberAuthor

    Claiming: the Sanitizers lane's asan + valgrind diagnostics

    Plan, in two PRs if the valgrind half turns out to be a different mechanism:

    1. Reproduce the asan half locally: configure a -DDEBUG -DENABLE_HEVC tree (or reuse the lane's .sanitize/build-asan shape) and compile the eight TUs, so the RED is a real compile, not a log read. If that configuration cannot be built on this box, say so in the PR and let the lane itself be the evidence (as frontend: state the conversions the app target now reports (#2625) #2909 does).
    2. State the eight conversions at their call sites — (uint8_t) around the s_w8/shift expressions in rtmp-av1, rtmp-hevc, mp4-mux; (unsigned)/(uint32_t) for the two vaapi chroma divisions. Values unchanged.
    3. Then the valgrind half: find the %lu caller behind v4l2-helpers.c.h:20 (the diagnostic points at the macro, not the call) and restore a type that matches the format, rather than widening the format. Fix gl_enable_debug() to (void) if that is the whole -Wstrict-prototypes finding, and check the 2026-10-28 run's zccache lines to settle whether it was cached or new.
    4. File the lane-coverage follow-up from the issue's two options, whichever the maintainer prefers, so the next ratchet slice cannot land a sanitizer-only error.
  3. added
    ready
    on Oct 29, 2026
  4. zackees commented on Oct 29, 2026

    @zackees
    MemberAuthor

    Claiming: the Sanitizers asan + valgrind diagnostics

    Plan stays as above: reproduce the asan half in a -DDEBUG configuration, state the eight conversions at their call sites with values unchanged, then the valgrind %lu caller and gl_enable_debug(void).

  5. zackees commented on Oct 29, 2026

    @zackees
    MemberAuthor

    Continuing this claim in the next worker tick: starting from current master (18f8a3f22), branch fix/2923-sanitizer-conversions in the warm checkout. First I replay the five affected TUs through the local compile database with the three conversion groups appended, to turn the lane log into a local RED.

  6. zackees commented on Oct 29, 2026

    @zackees
    MemberAuthor

    Status of this claim, after the first two Sanitizers dispatches:

    What the lane runs found that the master log could not, because master's valgrind job stopped at compile:

    1. asan 🧪 on the branch (artifact sanitize-asan of 40893068597) listed exactly two diagnostics after the first fix: mp4-mux.c.h:524 (build(obs-outputs): state the mp4-mux and rtmp-hevc conversions macOS clang reports (#2921) #2922) and rtmp-av1.c.h:109, the left shift.
    2. valgrind 🧪 on the same branch built all 2204 targets and failed at the link of test_scene_crop_steps: undefined reference to symbol 'ceilf@@GLIBC_2.2.5'. That is the UBSan float-cast-overflow runtime calling libm, which libobs only links privately. build: state the other get_bit1 shift and link libm where the sanitizer needs it (#2923) #2935 adds m under if(NOT MSVC), the convention the other scene-step tests already use.

    So Sanitizers on master is green only when #2935 and #2922 have both landed; the next scheduled run after that is the acceptance check.

    The second acceptance item — a mechanism so a ratchet slice cannot land with a sanitizer-only error — is still open. The cheapest one that fits what was measured here: the lane's Select passes 🎯 job already decides whether to run asan, so it can also select asan when a target whose conversion groups are on has its sources changed, which bills the ratchet PR instead of the nightly. That is a workflow-graph change and needs a maintainer's yes.

  7. zackees commented on Oct 29, 2026

    @zackees
    MemberAuthor

    Status from the worker tick: the compile sites are stated on master, and the lane is re-verifying.

    Fixes landed on 2026-10-29 (all linked to this issue):

    • #2925 (6c5fd45) — the vaapi 1u << shifts, the v4l2 %lu sites, gl_enable_debug(void).
    • #2922 (985ccf2) — mp4-mux s_w8 and rtmp-hevc bit fields.
    • #2935 (6d5ba5f) — the second get_bit1 shift, and libm linked where the sanitizer needs it.

    No value changed at any site: every fix states a conversion that already happened.

    Verification in flight: Sanitizers run 40919949570 at master c2df54a7f — Select passes 🎯 green, valgrind, asan and tsan running. The two runs between were red at commits older than #2935 (13:40 at 32c4bcc19, 15:32 at 562079974), so neither says anything about the current tree. If any of the three jobs still fails, the remainder comes back here as the next slice.

    Decision needed: which mitigation stops the next ratchet from passing over a configuration it never compiles. My recommendation is option 2, narrowed: ci/ci_scope.py selects the asan lane when a diff touches a target already in the conversion ratchet (ci/ knows that list), so the PR that ratchets a target pays for the check, and nothing else does. Cost is one extra asan build on those PRs, on a lane that already exists, so no new workflow file and no change to the merge-queue critical path (#2072). Option 1 stays a checklist item either way, because it costs a reviewer's attention instead of CI time.

    This part waits on your answer; the casts above do not.

  8. added
    decision-needed
    on Oct 29, 2026
  9. 15 remaining items

  10. zackees commented on Oct 29, 2026

    @zackees
    MemberAuthor

    Worker tick: Sanitizers is green on master again, so the acceptance bullet this issue was opened for is met.

    Evidence — run 40942190769 at 6ca10e79f, all four jobs success: Select passes 🎯, asan 🧪, tsan 🧪, valgrind 🧪. 6ca10e79f is an ancestor of current origin/master (9ffa4e65c) and postdates every fix linked here:

    • #2925 (6c5fd4516) — vaapi 1u <<, the v4l2 %lu sites, gl_enable_debug(void)
    • #2922 (985ccf278) — mp4-mux s_w8, rtmp-hevc bit fields
    • #2935 (6d5ba5fad) — the second get_bit1 left shift, libm for test_scene_crop_steps

    No value changed at any site; every edit states a conversion that already happened.

    What is left is only the mitigation bullet ("the chosen mitigation from the two options, so the next ratchet slice cannot land this way"). The repo rules do not pick between them, and both are defensible:

    1. add the sanitizer configuration to the ratchet PR checklist (a human step), or
    2. have ci/ select the asan/valgrind passes when an already-ratcheted target's sources change, so the ratcheting PR pays for the check (the issue calls this one better).

    Decision needed: option 1 or option 2 for the ratchet/sanitizer coverage mitigation. I recommend option 2, implemented as a lane-selection test in ci/ so it cannot regress silently; option 1 costs nothing in code but relies on a checklist nobody enforces. On your answer I will land the chosen form and close this issue.

  11. added
    decision-needed
    claim-blocked
    on Oct 29, 2026
  12. zackees commented on Oct 29, 2026

    @zackees
    MemberAuthor

    Verdict: Sanitizers is green on master — all four jobs, acceptance met.

    Dispatch 40942190769 on master at 6ca10e79f:

    job verdict
    Select passes 🎯 ✅ success
    asan 🧪 (job 123688342240) ✅ success 19:40:46 → 20:23:14
    tsan 🧪 (job 123688342444) ✅ success 19:40:46 → 20:12:24
    valgrind 🧪 (job 123688342445) ✅ success 19:40:46 → 21:44:50

    6ca10e79f is an ancestor of current master (c3a8a6319), so this verdict is not stale:

    $ git merge-base --is-ancestor 6ca10e79f origin/master && echo on-master
    on-master
    

    Against the issue's acceptance list:

    • Sanitizers green on master again — yes, the whole 4/4 run above. asan compiles past the eight conversion sites (obs-ffmpeg-vaapi.c.h:434,435, rtmp-av1.c.h:109,499,500, mp4-mux.c.h:524, rtmp-hevc.c.h:827,843), and valgrind passes v4l2-helpers.c.h:20 and gl-subsystem.c.h:115 (%lu/uint and the strict-prototypes finding). Earlier in the same sequence valgrind was already green at c2df54a7f (run 40919949570), so both red classes from the original report have a green run behind them.
    • No value change at any site — the landed slices only state the conversion that already happened (s_w8(s, (uint8_t)(…)), (unsigned)(1 << …), size_t/%zu on the v4l2 format, static void foo(void)).
    • Mitigation so the next slice cannot land with a sanitizer-only error — landed as ci: the ratchet opt-in PR runs the sanitizer lane (#2923, #2956) #2961 (5f166c9e6): conversion_ratchet.hit() now matches a ratcheted target's own CMakeLists.txt, so the PR that turns a ratchet on selects the sanitizer lane. Test pinned in ci/test_conversion_ratchet.py.

    Nothing is left open on this issue; closing it.

  13. removed
    claim-blocked
    on Oct 29, 2026
  14. zackees commented on Oct 29, 2026

    @zackees
    MemberAuthor

    Verdict: Sanitizers is green on master, and the acceptance item on this issue is met.

    Dispatch 40942190769 at 6ca10e79f (master), whole run success:

    job verdict
    asan 🧪 ✅ success (19:40:46 → 20:23:14)
    tsan 🧪 ✅ success (19:40:46 → 20:12:24)
    valgrind 🧪 ✅ success (19:40:46 → 21:53 UTC, the long one)
    Select passes 🎯 ✅ success

    That closes the last acceptance item recorded here: the eight conversion sites the asan lane found are fixed by #2952 / #2955 / #2956, valgrind and tsan no longer see a regression from the same window, and the ratchet scope now sends a PR that touches a ratcheted target through this lane (#2961), so the next one of these is caught on the PR that causes it instead of at the night's schedule.

    No fix PR is left open for this issue; closing it. If Sanitizers goes red again on master it is a new issue with a new run to cite, not a reopen of this one.

  15. moved this from In progress to Done in obs-rust Multiviewon Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P1bugdecision-neededreadysize:M

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions