Skip to content

ci: prevent shared Xvfb resets and diagnose libobs startup failures - #1365

Merged
zackees merged 6 commits into
masterfrom
fix/1355-startup-failure-diagnostics
Oct 18, 2026
Merged

zackees merged 6 commits into
masterfrom
fix/1355-startup-failure-diagnostics

Conversation

@zackees

@zackees zackees commented Oct 17, 2026 •

Copy link
Copy Markdown
Member

Summary

Refs #1355 and #1286. Startup failure diagnostics needed to identify the intermittent CI blocker; the root cause remains unknown.

RED

A new Linux cmocka test interposes XOpenDisplay to return NULL with ECONNREFUSED, calls real shared libobs, preserves its false startup return, and requires error diagnostics naming hotkey initialization and the failed platform call. It also runs against libobs-with-rust in the ordinary OFF/ON suite.

Local RED: compiled the new test in the existing Linux validation image against this checkout's existing build volume mounted read-only. It failed saw_hotkeys_stage is not true. Existing C tests and public headers are unchanged.

GREEN

Add error diagnostics for data, handler, hotkey, main-canvas and destruction-task-queue initialization failure; identify failed XOpenDisplay during hotkey initialization and report DISPLAY. Startup return values and cleanup are unchanged.

Rebuilt real C libobs in the existing checkout-owned Linux build volume and ran the new test successfully. The test asserts the injected call was reached, startup still returned false, and both stage/platform error messages were emitted. Raw RED/GREEN output is under ignored build_ci_audit/startup-diagnostics-*.log. The build needed container-local git safe-directory configuration and removal of an unavailable legacy ccache launcher from the local CMake cache; these are not repository changes or timing measurements.

Verification: pinned clang-format 22.1.3 and gersemi 0.25.0 checks pass; six build-group checks pass; git diff --check passes. Existing C tests/public headers are unchanged, and the feature ledger records the log change. Full OFF/ON CI and the Rust-substituted consumer remain pending. No Rust port or network protocol change: new Rust unit/differential/protocol tests do not apply.

This does not establish that X11 caused the original CI incident; further failures should now identify the failed stage. Refs #1355 rather than closing the unknown-cause issue.

Reproduced display-lifetime failure and fix

The real unchanged slideshow binary, using the diagnostic C libobs and shared authenticated xvfb-run display, reproduced XOpenDisplay failure in hotkey initialization: six failed invocations among 68 attempted (workers stop on first failure), across 816 startup groups. Changing only Xvfb's -noreset option produced 160/160 successful invocations across 1,920 startup groups, using the same eight workers and library. The earlier raw-Xlib-only probe did not reproduce it; the real OBS test did. This is a local reproduction, not a claim that every historical CI startup failure has the same cause.

Add -noreset to both normal and repeated Tier 2 display sessions, preserving geometry, test parallelism and failure propagation. RED f00beb4b6 requires the lifetime policy. GREEN 6acb527da executes the real suite invocation with a recording launcher, verifies the single server-argument string and exit-17 propagation, and checks repeated tests use the same arguments. uv run --no-project python -m unittest ci.test_tier2_xvfb_lifetime ci.test_tier2_build_errors passes all six checks. Shell syntax and diff checks pass. Captured local results are in docs/ci-evidence/2026-10-17-startup-xvfb-lifetime.json; raw logs remain in ignored in-repo scratch.

Fresh full OFF/ON CI remains required. Existing C tests and assertions remain unchanged; no test retry or skip was introduced.

Follow-up 0a28cd3ee: CI identified two timing-persistence checks that located CTest by the old literal xvfb-run -a ctest. They now locate the actual invocation independently of server arguments while retaining restore-before/run/save-after assertions. uv run --no-project python -m unittest ci.test_tier2_schedule ci.test_tier2_xvfb_lifetime ci.test_tier2_build_errors passes all 10 focused checks. Cancellation was requested for the superseded red run after this correction; the new required run is 39079466829.

CMake-built interposer correction

The full OFF/ON run reached 294 registrations each and failed only the new diagnostics test: injected_display_failure remained false. All pre-existing tests had no failures. The CMake test build hid XOpenDisplay (LOCAL in the symbol table), unlike the earlier standalone compile (GLOBAL DEFAULT); the loader could not reach the hook.

Reproduced that exact assertion with the real CMake-built target under a valid private Xvfb display. Marked only the interposer EXPORT, rebuilt that same target, verified the dynamic symbol is GLOBAL DEFAULT, and ran it successfully under the same display. The assertion that the injected call was reached is retained. Pinned clang-format and diff checks pass. Raw verification logs: build_ci_audit/startup-interposer-visibility-{red-test,green}.log. Fresh full CI remains required.

@zackees
zackees marked this pull request as ready for review October 17, 2026 23:21
@zackees
zackees enabled auto-merge October 17, 2026 23:21
@zackees zackees changed the title libobs: identify failed startup initializer in error diagnostics ci: prevent shared Xvfb resets and diagnose libobs startup failures Oct 17, 2026
@zackees
zackees added this pull request to the merge queue Oct 17, 2026
@zackees

zackees commented Oct 18, 2026

Copy link
Copy Markdown
Member Author

Fresh complete PR run 39080388954 passed on the exported-interposer correction. OFF and ON each registered 295 tests with zero failures; CTest 315.01/308.97 s. Both the unchanged slideshow test and the new diagnostic fault-injection test passed in each mode (diagnostic test 0.03/0.02 s). This validates the actual CMake-built test with the normal hidden-visibility build, including the Rust-substituted library. No failed-job retry was used to obtain this result.

#1365 is now in the merge queue. Keep #1355 open until fresh queue/master validation; this passing run alone does not assign all historical startup incidents to one cause.

Merged via the queue into master with commit 3c20ca7 Oct 18, 2026
23 checks passed
@zackees
zackees deleted the fix/1355-startup-failure-diagnostics branch October 26, 2026 15:43
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.

1 participant