Repository navigation
infra: Dispatchable sanitizer workflow (ASan/UBSan, TSan, valgrind) - #171
Merged
Merged
Conversation
This was referenced Oct 11, 2026
zackees
force-pushed
the
infra/sanitizer-workflow
branch
from
October 11, 2026 01:08
ecd0761 to
c468e75
Compare
…ind) .github/workflows/sanitizers.yaml runs rust/tools/sanitize/sanitize.sh once per tool on ubuntu-26.04. Each job builds the tree with that tool's flags (ENABLE_RUST_LIBOBS selectable), runs every cmocka test under it, launches OBS headless under Xvfb with a fresh profile and closes it with SIGINT after a timeout, then writes triage.py's summary to the job summary and uploads the logs. It is triggered by workflow_dispatch (tools, launch time, Rust libobs, fail-on-findings) and by PRs that change the harness. - sanitize.sh: one script for Ubuntu and NixOS (shell.nix); valgrind runs with QT_ENABLE_REGEXP_JIT=0 (the PCRE2 JIT memfd is opaque to it) and full paths. - install-ubuntu-deps.sh: the Tier 2 image's package list, read from rust/tools/linux-validate/Dockerfile, plus valgrind/Xvfb/Mesa/D-Bus. - triage.py: counts a report only where OBS code is where it happens. TSan races must have OBS frames on both accesses; valgrind leaks are ignored after a crash. These are the rules used to file #128, #133 and #160. Refs #143 Local-Gate: v1 tree=689bce76047a4fe654972487d26acc006458444b secs=177 lanes=lint:run,rust-test:run,tier2-linux:run Ci-Attestation: {"at":1791677636,"gate":"rust/all/fmt","host":"linux-x86_64","key":"2f269309edac4bdcfec213dd1ac4f955d0fc07c9ab43a823ee2504849242caee","lane":"lint","parents":["29e2dfa5cb3ee8187bb78e37703980618e066026"],"secs":15,"stamp":"c5bcc4177ae6beb2bd2776139d126bd4","tree":"689bce76047a4fe654972487d26acc006458444b","v":1,"via":"run"} Ci-Attestation: {"at":1791677636,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"2f269309edac4bdcfec213dd1ac4f955d0fc07c9ab43a823ee2504849242caee","lane":"lint","parents":["29e2dfa5cb3ee8187bb78e37703980618e066026"],"secs":15,"stamp":"245d40fa95a10eede9c886c760824cc6","tree":"689bce76047a4fe654972487d26acc006458444b","v":1,"via":"run"} Ci-Attestation: {"at":1791677636,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"16a68186c17f58e2766c2dbe062436d7fb710f35ed72eb3faf1db90acd343b1d","lane":"rust-test","parents":["29e2dfa5cb3ee8187bb78e37703980618e066026"],"secs":43,"stamp":"4a7cd87eb2a7baa50be72ee569262fea","tree":"689bce76047a4fe654972487d26acc006458444b","v":1,"via":"run"} Ci-Attestation: {"at":1791677636,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"1cc0c2a2f3093a51c0f591ce0003f91f81c96c44631c9b4ead2221445afe3995","lane":"tier2-linux","parents":["29e2dfa5cb3ee8187bb78e37703980618e066026"],"secs":118,"stamp":"1a0fc099a8a5226a3570900284acd8b2","tree":"689bce76047a4fe654972487d26acc006458444b","v":1,"via":"run"}
From the first workflow run (#176): - UBSan prints to stderr even with log_path set, and recovers, so a passing test or the app's stderr can carry reports. triage.py now also scans the tests' stdout logs and app.log, counting a report seen twice once. This surfaced #173 and #174, which the exit codes and log files hid. - TSan's own crash reports (ERROR: ThreadSanitizer: SEGV) are counted, not just WARNING races. - Known tool limitations are listed but not counted: under valgrind, test_pipe's missing-binary case (posix_spawn runs as a plain fork) and test_svt_av1 (VEX temporary storage exhausted). - A crash in OBS code under valgrind is a finding; --tool= overrides the tool that the directory name implies. - sanitize.sh gives valgrind 240 s between SIGINT and SIGKILL. Refs #143 Local-Gate: v1 tree=6ce7acd50e76b91ceacc4223492de8b5168cfd0a secs=69 lanes=lint:reused@9b503e30ab5a,rust-test:reused@3f31f0ee7558,tier2-linux:run Ci-Attestation: {"at":1791679651,"gate":"rust/all/fmt","host":"linux-x86_64","key":"9b503e30ab5a1e42eb712e1a4c1ee6ed8eb7dca395f6b148e613506b5e1ed900","lane":"lint","parents":["986e0d1d601052e07301615d44ec84fa61a0a504"],"secs":null,"stamp":"d39dfc8d476574f6ef491d23a621c450","tree":"6ce7acd50e76b91ceacc4223492de8b5168cfd0a","v":1,"via":"reused"} Ci-Attestation: {"at":1791679651,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"9b503e30ab5a1e42eb712e1a4c1ee6ed8eb7dca395f6b148e613506b5e1ed900","lane":"lint","parents":["986e0d1d601052e07301615d44ec84fa61a0a504"],"secs":null,"stamp":"d09711598f207f5d9fc803a530960f15","tree":"6ce7acd50e76b91ceacc4223492de8b5168cfd0a","v":1,"via":"reused"} Ci-Attestation: {"at":1791679651,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"3f31f0ee75580fa32253bf463998aef2645b379a5f217d18857a16dda768c645","lane":"rust-test","parents":["986e0d1d601052e07301615d44ec84fa61a0a504"],"secs":null,"stamp":"80872b939dcb70d5e2c4e0f56f82d00e","tree":"6ce7acd50e76b91ceacc4223492de8b5168cfd0a","v":1,"via":"reused"} Ci-Attestation: {"at":1791680917,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"98e730162a506b503ad495e8f240654ec5fc298a3ecad31b046c19df7c19b700","lane":"tier2-linux","parents":["986e0d1d601052e07301615d44ec84fa61a0a504"],"secs":69,"stamp":"9a438c39712c6aff006d694641146293","tree":"6ce7acd50e76b91ceacc4223492de8b5168cfd0a","v":1,"via":"run"}
Member
Author
|
Heads up: master pinned Rust 1.99.0, which soldr does not support, so Tier 2 / local-gate tier2-linux failed with "Could not find toolchain '1.99.0'". That was a repo bug, not this change. It is fixed in #185: the toolchain is pinned to 1.98.1 (the version soldr supports) and lint now enforces it, so branches still on 1.99.0 would fail lint. I rebased this branch onto master (no conflicts, commits unchanged), new head 663117b. Please run |
zackees
force-pushed
the
infra/sanitizer-workflow
branch
from
October 11, 2026 02:54
c468e75 to
663117b
Compare
…_LIBOBS=ON rustup's auto-install of rust-toolchain.toml is deprecated (rust-lang/rustup#4836) and was what broke Tier 2 after the 1.99.0 pin (#180); install it explicitly, as the Tier 2 image now does (#185). Refs #143 Local-Gate: v1 tree=cf745e8b9398beee80d989502785c338f51992bc secs=93 lanes=lint:run,rust-test:run,tier2-linux:run Ci-Attestation: {"at":1791687772,"gate":"rust/all/fmt","host":"linux-x86_64","key":"9c48a41145f4708d98a900d74ec2ecf4c58436ff012a23d08cd98e76fd12036f","lane":"lint","parents":["d6e212fb5c0f578581356f8f5850a20ba9e38890"],"secs":17,"stamp":"1a34a829bd3c4e83d6c4d4f45de6bb20","tree":"cf745e8b9398beee80d989502785c338f51992bc","v":1,"via":"run"} Ci-Attestation: {"at":1791687772,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"9c48a41145f4708d98a900d74ec2ecf4c58436ff012a23d08cd98e76fd12036f","lane":"lint","parents":["d6e212fb5c0f578581356f8f5850a20ba9e38890"],"secs":17,"stamp":"354e69df08751212ba17cbc1a14bf4be","tree":"cf745e8b9398beee80d989502785c338f51992bc","v":1,"via":"run"} Ci-Attestation: {"at":1791687772,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"7a8e339c11cfe3331cbc43e10651bae59647e856536b7bccf7ca151f6ec927ea","lane":"rust-test","parents":["d6e212fb5c0f578581356f8f5850a20ba9e38890"],"secs":41,"stamp":"2e69978320c00db4ae2aa7918b6add44","tree":"cf745e8b9398beee80d989502785c338f51992bc","v":1,"via":"run"} Ci-Attestation: {"at":1791687772,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"9fc9f5fb384b754a913b3b9656abc68e70a3022f42e3eaf01e5ba966fcdfeafb","lane":"tier2-linux","parents":["d6e212fb5c0f578581356f8f5850a20ba9e38890"],"secs":34,"stamp":"3719087a0c66b49db58d7d9ba6fce886","tree":"cf745e8b9398beee80d989502785c338f51992bc","v":1,"via":"run"}
2 of 3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #143 (claims the "ASan/UBSan variant of the Tier 2 ON build" item).
Adds a sanitizer pass that can be triggered as a GitHub Action, built from the harness used to file #128, #133 and #160.
What it does
.github/workflows/sanitizers.yamlruns one job per tool onubuntu-26.04. Each job:rust/tools/linux-validate/Dockerfile, so the lists can't drift) plus valgrind, Xvfb, Mesa and D-Bus;triage.py's summary to the job summary and uploads the logs assanitize-<tool>.Triggers
workflow_dispatchwith these inputs:tools(all/asan/tsan/valgrind),launch_seconds,rust_libobs(ENABLE_RUST_LIBOBS=ON) andfail_on_findings.rust/tools/sanitize/**or the workflow, so this PR exercises it.Once merged:
Triage rules (
triage.py)A report counts only where OBS code is where it happens:
Run on the manual results from master
ad60c0e39, it reproduces the hand triage exactly: 2 ASan crashes (#126, #127), and 5 TSan reports in OBS code (the races in #130, #131 and #132) against 40 external ones.Notes
fail_on_findingsonce they're fixed.test_formatted_filenameandtest_utf8hardcode ASan, so TSan and valgrind skip them (test/cmocka: hardcoded per-test -fsanitize flags break TSan/MSan builds and valgrind runs #159).nix-shell rust/tools/sanitize/shell.nix --run 'rust/tools/sanitize/sanitize.sh tsan', or on Ubuntu afterinstall-ubuntu-deps.sh.