Skip to content

test(v4l2): exec the slow holder so TSan runs its SIGTERM handler - #3893

Merged
zackees merged 4 commits into
masterfrom
agent/bug-3810
Nov 9, 2026
Merged

zackees merged 4 commits into
masterfrom
agent/bug-3810

Conversation

@zackees

@zackees zackees commented Nov 7, 2026 •

Copy link
Copy Markdown
Member

Refs #3810

ThreadSanitizer does not run the user SIGTERM handler in the slow holder forked from multithreaded OBS, so the existing force-release test times out. The maintainer approved restarting only that helper as a fresh copy of the test program, with its private mode dispatched before OBS startup. Assertions, timeouts, product code and the other plain-fork helpers are preserved.

The slow helper execs the original program path supplied by the existing CTest/sanitizer registration. Using /proc/self/exe instead launches the Memcheck runtime under valgrind and fails the readiness assertion; the validation follow-up fixes that fixture problem.

RED: original TSan failures documented in the issue; commit 656e842 additionally records the valgrind readiness regression (four of five cases pass). GREEN: ab4219d passes all five cases in each required lane: TSan, ASan/UBSan, valgrind, plain hybrid libobs and plain C reference. Sanitizer triage reports no findings. Detailed commands and retained logs are in the validation comment.

The requested full local lint invocation exited one at the changed execl line wrapping. Pinned clang-format corrected it and its subsequent full-file check passes. The full lint suite was not repeated; hosted Fast Gate remains the lint gate.

)

ThreadSanitizer does not run a user signal handler in a child forked from
a multithreaded parent, so force_camera_opens_while_the_holder_is_still_exiting
timed out under TSan only. The slow holder now restarts as a fresh copy of
the test program (exec with --slow-holder), handled in main() before OBS
starts. No assertion, timeout or product code changes; the other cases keep
their plain fork.

Test-only change to a C test, allowed by the maintainer decision on #3810
(#3810).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@zackees

zackees commented Nov 7, 2026

Copy link
Copy Markdown
Member Author

Local TSan re-run on this branch did not run: configure failed on this host (missing ECM / extra-cmake-modules), so nothing was built or tested. TSan GREEN still rests on the 10/10 runs of the same diff reported in #3810; it needs to be confirmed in the TSan lane before merge.

@github-actions github-actions Bot added the claim-conflict A PR closing reference conflicts with the issue claim label Nov 8, 2026
@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown

On 42efad3, the repository valgrind harness runs 5 cases: 4 pass, slow-holder readiness fails at line 250. /proc/self/exe launches memcheck-amd64-linux instead of the test program: valgrind reports that it cannot run test_v4l2_busy_signal directly. Memcheck reports 0 errors. Evidence: pool/san-3893/valgrind/tests/. Refs #3810; maintainer Decided authorizes this fixture-only correction.
Use the original test program path from argv[0] for the approved slow-holder exec. /proc/self/exe names the Memcheck runtime under valgrind and cannot launch the test helper. The existing ctest and sanitizer registrations invoke the test with its absolute executable path. No assertions, timeouts, or product behavior change. Refs #3810 and its maintainer Decided comment. TSan, ASan/UBSan, valgrind, plain hybrid and C-reference runs each pass all 5 cases; sanitizer triage is clean.
@github-actions github-actions Bot removed the claim-conflict A PR closing reference conflicts with the issue claim label Nov 8, 2026
@zackees

zackees commented Nov 8, 2026

Copy link
Copy Markdown
Member Author

Completed the maintainer-required focused validation for Refs #3810 on ab4219d, after a plain merge of current master (18a4f79bb) in 42efad3ea.

Lane Executables Cases Result
TSan, hybrid 1/1 5/5 exit 0; repository triage clean, no reports
ASan/UBSan, hybrid 1/1 5/5 exit 0; repository triage clean, no reports
valgrind, hybrid 1/1 5/5 exit 0; zero errors, zero definitely lost bytes; triage clean
plain hybrid libobs 1/1 5/5 CTest exit 0
plain C-reference libobs 1/1 5/5 CTest exit 0

The final replay was run after committing and pushing the formatted GREEN head. These are focused runs of the entire existing test_v4l2_busy_signal executable, including all five assertions-bearing cases; no new test executable or workflow. App launch and unrelated tests were outside this assignment.

The initial valgrind run provided RED evidence: 4/5 cases passed; the slow helper failed readiness because /proc/self/exe identifies the Memcheck runtime, which refused to launch as the test. 656e84283 records RED; ab4219d23 uses the original test executable path from argv[0] (the existing registrations pass an absolute path). This stays within the approved helper-only scope: no assertion, timeout, product, public-header or websocket changes.

Commands/settings:

  • Tier 2 image obs-rust-linux-validate:e718f7a0f723d48e, container obs-studio9-san-3893, four CPUs, --security-opt seccomp=unconfined, private Xvfb display; SOLDR_PORCELAIN=0, parallel compiles 4. Build volume obs-studio9-san-3893-build retained.
  • uv run --no-project /evidence/focused.py imports the repository sanitize.py helpers: configure_command, tool_cmake_args, ctest_tests, test_command, run_one_test. It uses the unchanged tool flags/build types/options/Valgrind argument list, HYBRID backend, OBS_BUILD_C_REFERENCE=ON, ENABLE_FRONTEND=OFF, OBS_BUILD_NUMBER=1.
  • cmake --build /build/san-3893/build-<tool> --parallel 4 --target test_v4l2_busy_signal for tsan/asan/valgrind; valgrind also builds libobs-c-reference.
  • uv run --no-project /ro/rust/tools/sanitize/triage.py /evidence/<tool> --fail-on-findings exits 0 for all three tools.
  • LD_LIBRARY_PATH=/build/san-3893/build-valgrind/libobs xvfb-run -a ctest --test-dir /build/san-3893/build-valgrind -R '^test_v4l2_busy_signal$' --verbose
  • Same plain command with LD_LIBRARY_PATH=/build/san-3893/build-valgrind/libobs-c-reference. Retained ldd evidence confirms each selected implementation.
  • Requested full SOLDR_PORCELAIN=0 ./lint: rc 1, only reached a changed-line clang-format wrapping error. Corrected with pinned clang-format 22.1.3; subsequent full-file --dry-run --Werror and git diff --check: rc 0. Full lint was not repeated; hosted Fast Gate remains responsible for the remaining lanes.

Retained local evidence: /home/niteris/.clud/tmp/claude-1000/-home-niteris-dev-obs-rust/2fecc293-3180-4006-b4f3-db7c5d8bc947/scratchpad/pool/san-3893/. focused.py and commands.md give the reproducible driver/settings; driver.log ends ALL FIVE LANES PASSED; each tool directory has configure/build, test and triage logs; valgrind/hybrid.log, c-reference.log and *-libraries.log record backend validation; red-valgrind/ preserves RED evidence; lint.log records rc 1. Initial environment setup needed pinned submodule initialization and Xvfb for the plain runs; final runs passed as above.

@zackees
zackees enabled auto-merge November 8, 2026 23:38
@zackees
zackees added this pull request to the merge queue Nov 8, 2026
Merged via the queue into master with commit 3061439 Nov 9, 2026
39 of 40 checks passed
@zackees
zackees deleted the agent/bug-3810 branch November 9, 2026 00:52
@obs-rust-project-manager obs-rust-project-manager Bot moved this from Needs fix to Done in obs-rust Multiview Nov 9, 2026
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