Skip to content

bug: slideshow: ASan fade_has_both_slides observes completed transition #3789

Closed

Description

@zackees

Location

test/cmocka/test_slideshow_mem_cap.c:438, fade_has_both_slides: assert_true(t < 1.0f).

Class

Existing local test assertion failure; no counted sanitizer finding in this attempt.

How it is reached

Run https://github.com/obs-rust/obs-studio/actions/runs/42315858830/attempts/2, ASan job 128236095239, on unrelated DeckLink PR #3787 head 1aa14446307f51e1d573cebd6e1ab06f2d95ea6b. Download sanitize-asan, inspect tests/test_slideshow_mem_cap.log. Triage: 707/708 clean, 1 known excluded, no counted sanitizer reports. The first attempt instead failed on test_encoding_lag_rescale (#3788); that encoder test passed in this retry. No further rerun was requested.

The test creates local 4096px pictures and a fade slideshow; this is trusted-local test input. Before failure it prints fade 6 -> 7 at 0.00, then fade 6 -> 7 at 1.00: widths 4096 -> 4096, followed by the line-438 failure. Other three test cases pass.

Proposed fix and failing test

Investigate why current_index did not advance to the next expected pair before the check, and whether async slide loading/transition completion escapes the test's wait condition. It waits at most 250 × 10ms for an index change, sleeps 100ms, then assumes a fade is active. This is an investigation hypothesis, not proof of a timing-only cause. Follow docs/knowledge/timing-tests.md; preserve existing C tests per project policy, establish focused RED coverage before fixing a production cause, and show this ASan test passing. Do not suppress it or add a known-list entry to land #3787.

#3787 changes no slideshow, transition, source lifecycle or existing C test code. All its native GCC/Clang replays, 54 ratchet tests, review, hosted Format and Fast Gate passed; it remains draft because CI Gate is red.

Activity

  1. added
    bug
    on Nov 7, 2026
  2. zackees commented on Nov 7, 2026

    @zackees
    MemberAuthor

    Claiming: investigation in pool slot obs-studio2.

    1. Trace the artifact and unchanged slideshow test against production transition/index behavior.
    2. Replay under ASan with CPU load, distinguishing a production failure from the sampling window.
    3. If production is wrong, add focused RED then GREEN coverage; if only timing is wrong, report NEEDS-HELP without editing the C test. First evidence this session.
  3. added
    needs-investigation
    on Nov 7, 2026
  4. zackees commented on Nov 7, 2026

    @zackees
    MemberAuthor

    Investigation update (obs-studio2): the unchanged fade test observes current_index, then sleeps 100 ms, but ss_next_slide publishes that index before do_transition -> ready_slide waits for the decode queue and uploads the destination texture. During that wait the previous transition may legitimately remain at t=1. The test also does not assert its 300 x 10 ms completion wait succeeded. Either explains a stale 6 -> 7 pair; neither alone proves which occurred in the hosted run. Preparing a focused native ASan replay with CPU load and external index/start/time tracing; no existing C test or production changes.

  5. zackees commented on Nov 7, 2026

    @zackees
    MemberAuthor

    Loaded ASan reproduction now confirms the sampling race, without modifying the C test or production. External LD_PRELOAD tracing (logging only) records: prior fade reaches t=1 at monotonic 634318.739880; Next queued at 634318.739933; current_index=7 observed at 634318.750027; test prints the previous pair 5 -> 6 at t=1 and fails line 438; the new 700 ms fade starts successfully at 634319.383341 (633 ms after the index observation). Thus the previous completion wait succeeded and Next was accepted; the assertion ran before destination decode/texture readiness and before the new transition started. Repeating under the same load before final NEEDS-HELP handoff. No suppression, timeout padding, or C-test edits.

  6. zackees commented on Nov 7, 2026

    @zackees
    MemberAuthor

    Releasing #3789 investigation — NEEDS-HELP for the manager/maintainer; no production change or PR justified.

    The unchanged test reproduced line 438 under CPU load in 5/5 traced full runs and 3/3 untraced fade-only runs. The idle control passed all four assertion cases. Each traced failure shows the previous fade completed before Next, index=7 then published, the old 5 -> 6 pair sampled at t=1, and the new 6 -> 7 fade starting successfully 481–658 ms after the index observation. The last three traces additionally verify both expected source files have width 4096 at the real start. This demonstrates that current_index plus 100 ms is not a transition-start barrier: ready_slide finishes on-demand decode/texture preparation between the index publication and obs_transition_start. No stuck load or prematurely completed new fade was observed.

    Smallest proposed test repair, not implemented: capture the existing A/B/time/width snapshot in a synchronized slide_changed callback, wait for that snapshot on the test thread, and preserve all assertions. Assert the prior fade completed before issuing the next command instead of ignoring exhaustion of its completion wait. A test-thread poll alone can miss a short fade under load. No C test, public header, production timeout, known list or workflow was edited; #3787 remains held for the manager's maintainer decision.

    Local limitation: all nine processes also reported a separate 368-byte LeakSanitizer leak in unsymbolized allocation stacks; those reports remain unsuppressed and were not diagnosed. Assertion results above are not claims of sanitizer-clean runs. No hosted rerun was requested.

    Detailed evidence, exact timelines, commands, source hashes and logs: /home/niteris/dev/obs-rust/obs-studio2/build_ci_audit/i3789/response.md. Pool response: /home/niteris/.clud/tmp/claude-1000/-home-niteris-dev-obs-rust/2fecc293-3180-4006-b4f3-db7c5d8bc947/scratchpad/pool/i3789/response.md.

    Slot returned to clean detached origin/master ef696e9. No target pruning or soldr gc; diagnostic artifacts retained.

  7. moved this from Investigating to In review in obs-rust Multiviewon Nov 7, 2026
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

    bugneeds-investigation

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions