Repository navigation
Description
Location
test/cmocka/test_fallback_warning_dialog.cpp:129-141 (countdown_moves_the_progress):
show(s, true, 2000);
settle(400);
auto *progress = s.dialog->findChild<QProgressBar *>("progress");show pumps Qt events for 20 ms (54-60); settle pumps events, sends deferred deletes and processes events again (64-68). The window has WA_DeleteOnClose (frontend/dialogs/OBSFallbackWarning.cpp.hpp:10), uses a real QElapsedTimer (55-59,87), and finishes/closes when elapsed >= countdown (101-105). QPointer becomes null on deletion.
Class / reachability
Intermittent test null-pointer dereference, followed by test-fixture leaks. Trusted local test execution only. No remote-input or credential-leak finding. This report concerns the isolated Qt dialog test, not the security properties of fallback callers.
Evidence and frequency
PR #3871 attempt 1, job 128409082134 failed: test_fallback_warning_dialog exit=1 (8.3s). The PR ports hotkey getters and changes no frontend dialog code. Its sanitize-asan artifact contains tests/test_fallback_warning_dialog.log and .ubsan.25488.
The test log reports 8/9 cases passing, with only countdown_moves_the_progress failing at line 135 (null OBSFallbackWarning / QObject, then SIGSEGV). The leak stack explicitly runs from settle line 66 / caller line 133 through QTest::qWait, QTimer, OBSFallbackWarning::tick:104, ended, and the callback's ends.push_back:58. Thus the countdown actually completed during the wait, before line 135.
LeakSanitizer reports 180 bytes / 4 allocations: QObject private state from Shown:46 (120), QPointer weak-reference state from show:56 (16), vector allocation from callback line 58 (4), connection state from line 57 (40). Likely secondary to cmocka signal recovery bypassing stack C++ destructors after the fault, rather than a leaked live dialog.
Bounded convenience sample (not an exhaustive incidence estimate): 1 failure / 17 actual test executions checked, 16 passes. Earliest observed failure in this sample: 2026-11-07 13:02 UTC. The test file has been unchanged since #2238 (2026-10-25, 4d73452); this does not establish when failures first began.
| Cohort | Actual test executions | Pass | Fail |
|---|---|---|---|
| Recent PRs Nov 7, including reported failure and previous hotkey run | 10 | 9 | 1 |
| Older PRs Nov 6 | 3 | 3 | 0 |
| Master scheduled sanitizers Nov 3–6 | 4 | 4 | 0 |
Three sampled successful merge-group runs (42376234390,42371446973,42370675616) have no asan execution; do not count their green workflows as passes. ci.yml --event push returned no runs; current master push workflow push.yaml run 42371994305 only has asan cache-state/refresh jobs and a skipped Sanitize call, also not a test pass.
Previous same hotkey branch: 42368049799 / 128391834166, test exit=0 (6.2s). Representative other PR pass: 42373580556 / 128410223942. Master scheduled passes: 42235134335 / 127950774150, 42049821983 / 127322784486, 41851659014 / 126649434446, 41655492536 / 125984690630.
PR #3871 attempt 2 job 128424520098 remains in progress at this investigation's check; no rerun requested here. One older failed asan job (128221813245) contains no result for this test and is excluded.
Cause and proposed fix / failing-test sketch
The test assumes that pumping events for nominally 400 ms always returns before a real 2000 ms countdown expires. Scheduling/sanitizer overhead can exceed that window. The dialog correctly emits CountdownDone, closes, and deletes itself while Qt events are being pumped. Missing QApplication pumping is not the cause: pumping is visible both in source and in the artifact stack. This is the wall-clock/load class described by #838, though that issue covers audio tests, not this dialog.
Maintainer decision required: the direct correction is in the existing C++ test, which workers must not edit (same policy boundary as #3789/#3808/#3810). No small non-test frontend correctness fix is justified by these logs; changing automatic closure to satisfy the test would change intended behavior.
Prefer a controlled clock/tick observation for progress assertions so reaching nonzero progress cannot race expiration; check lifetime before dereferencing, with cleanup owned outside cmocka's signal/longjmp path. A null assertion alone improves diagnostics but does not fix timing. Increasing the countdown or applying the timing resource lock is only a mitigation. RED sketch: deliberately deschedule/delay the progress test across the countdown deadline; GREEN must inspect intermediate progress without relying on beating wall time. New tests alone cannot remove the existing failing assumption. No source/test edits or claim made during triage.
Searches for test_fallback_warning_dialog, countdown_moves_the_progress, fallback warning and fallback+sanitizer found no dedicated existing report. #1390 mentions the test in the broad native-test migration work; #838 is related background, not a duplicate.
Activity
zackees commentedon Nov 11, 2026
Coordinator investigation confirms the remaining failure is in the existing C++ fixture: settle(400) may deliver deferred deletion after the 2000 ms countdown under load, and the fixture dereferences its QPointer before checking lifetime. The product intentionally auto-closes and must not be changed to rescue this assertion. Maintainer authorization needed: may a narrowly scoped fixture correction use deterministic countdown/event synchronization and safe lifetime observation, preserving automatic completion, exactly-once end and every existing functional assertion? Recommendation: permit only that test correction with focused RED→GREEN evidence; no timing-threshold relaxation or product behavior change. No existing test has been edited by this coordinator work. Reply beginning
Decided:orDecision:can define the exception and clear human-review-needed.zackees commentedon Nov 21, 2026
Decided: yes, the fixture correction is allowed. Scope:
test/cmocka/test_fallback_warning_dialog.cpp, plus a behavior-neutral time-source seam inOBSFallbackWarning. The countdown must come from a controlled clock, not from beating wall time. Lifetime is checked before every dereference, and cleanup runs in cmocka teardown. Every existing assertion stays. The countdown still auto-accepts, ends exactly once and deletes itself. No timing threshold is relaxed.Why this edit is allowed. The "never edit an existing C test" rule (testing-policy.md, Tier 2) protects tests that check compatibility of a Rust port. This test is one we wrote for the C++-only dialog (#2238), and nothing here accommodates a port. The test has its own race, so fixing it follows the #3810 precedent: a test-only change in its own commit that cites this decision.
Cause (origin/master a98b199).
frontend/dialogs/OBSFallbackWarning.cpp.hpp:55-59,87,101-105: the countdown adds realQElapsedTimertime on each 50 ms tick, then finishes and callsclose().WA_DeleteOnClose(line 10) deletes the dialog.test/cmocka/test_fallback_warning_dialog.cpp:132-135:show(s, true, 2000); settle(400);and thens.dialog->findChild(...)with no null check. When the runner stalls for 2 s or more insidesettle, the countdown completes duringQTest::qWait. The deferred delete clears theQPointer, and line 135 dereferences null. The stack in the obs-hotkey: Port read-only object field getters (#3868) #3871 artifact shows exactly this:tick:104→ended→ends.push_back.Shown s(itsQObject context, theQPointerand the vector).accept_click_ends_once,cancel_click_ends_once,escape_closesandwindow_close_closesuse 300 ms countdowns. If the countdown wins,click()at line 81,keyClickat line 178 ands.dialog->close()at line 216 dereference null, or the recorded end isCountdownDone.countdown_pauses_while_another_dialog_is_modaluses a 400 ms countdown withsettle(100)before the modal opens.Still on master? Yes, latent. The test and the dialog are unchanged since #2238. No PR references this issue, and
known-flaky.txthas no entry for it. The failure is rare: the master asan job passed this test on all 15 scheduled runs from 2026-11-06 to 2026-11-21 (exit=0 (6.2s)each time). No failed PR or merge-queue run from 2026-11-14 to 2026-11-21 shows it. The code path that crashes is still there.Fix plan.
OBSFallbackWarningreads elapsed time through an injectable monotonic time source. By default it usesQElapsedTimer, so live callers such asfrontend/utility/FallbackWarning.cpp.hpp:75behave exactly as before. The seam is test-only and has no new user-facing behavior.OBSFallbackWarning.hppis a frontend-internal header, not a public C header.countdown_moves_the_progressadvances it by 400 ms and waits on an event condition:QTest::qWaitForuntilprogress->value()changes, with a large bound that only turns a hang into a failure. Then it asserts the existing checks:> 0,< 2000,maximum() == 2000,value() == elapsedShown()andends.empty(). The countdown cannot expire until the test advances time past 2000.countdown_accepts_onceadvances past its countdown and waits forended. The pause case advances time while the modal is open and asserts the existing<= before + 100check andends.empty(). Then it closes the modal, advances past the countdown and assertscheck_one_end(CountdownDone).assert_non_null(s.dialog.data())before every dereference, so a regression fails as an assertion instead of a SIGSEGV.Shownin a cmocka setup and free it in teardown (cmocka_unit_test_setup_teardown), so a failed assertion leaks nothing.Acceptance.
countdown_moves_the_progressbetweenshowand the progress read. The old test crashes at line 135. With the same stall, the new test passes. Record both outputs in the PR.rust/tools/linux-validate/run.py --repeat 100 --tests test_fallback_warning_dialogruns 100 times clean, and the asan job passes with no LeakSanitizer report.rdoupe commentedon Nov 22, 2026
Claiming: the fallback warning dialog test fix, under the 2026-11-21 decision above. Branch:
test/3908-fallback-warning-clock.countdown_moves_the_progresscrashes the current test at the progress read (recorded, not committed).OBSFallbackWarning(defaults toQElapsedTimer), a manual clock in the test, lifetime asserted before every dereference,Shownowned by cmocka setup/teardown. Every existing assertion stays; the same stall passes.test_fallback_warning_dialog, and the asan run clean.test: drive the fallback warning countdown with a manual clock (Fixes o…