Skip to content

ci(sanitizers): build the sanitizer passes with line tables only (#3457) - #3460

Merged
vpacher merged 2 commits into
masterfrom
ci/3457-sanitize-line-tables
Nov 1, 2026
Merged

vpacher merged 2 commits into
masterfrom
ci/3457-sanitize-line-tables

Conversation

@vpacher

@vpacher vpacher commented Nov 1, 2026

Copy link
Copy Markdown
Member

Fixes #3457. Refs #3249.

What

The sanitizer passes built with the build type's -g (RelWithDebInfo for asan and tsan, Debug for valgrind), full DWARF, while their reports and triage only use file:line frames. configure_command() now sets CMAKE_C_FLAGS_<CONFIG> and CMAKE_CXX_FLAGS_<CONFIG> from BUILD_TYPE_FLAGS: CMake's own flags with -g1 in place of -g. CMake puts these after CMAKE_<LANG>_FLAGS, so -g1 in TOOL_FLAGS would lose to the build type's -g. The tool flags stay as they are.

Why

A cold asan build, 4 pinned cores as on the 4-vCPU runner, through zccache as in CI (master 3f39ef6):

Debug info Build zccache after the build Objects and PCHs in the tree
-g 1015 s 4.5 GB 1.88 GB
-g1 760 s 3.4 GB 1.33 GB

Reports keep their locations

Checked on a local -g1 build against the nightly's -g reports (master d2efb3a):

RED → GREEN

  • RED 13a1123: test_configure_builds_line_tables_only in ci/test_sanitize_harness.py fails for asan, tsan and valgrind (no -DCMAKE_C_FLAGS_<CONFIG> in the configure line).
  • GREEN d21228b: the harness tests pass (24); local gate passes all lanes (stamped).

This PR does not run the sanitizer passes in PR CI (sanitize.py is not a ratcheted compile input). The next nightly is the first run with -g1; a dispatch on a separate ref can measure it before.

🤖 Generated with Claude Code

vpacher and others added 2 commits November 1, 2026 23:07
…#3457)

The passes build with the build type's -g (RelWithDebInfo for asan and
tsan, Debug for valgrind), full DWARF, while their reports and triage
only use file:line frames. A cold asan build through zccache on 4
cores: 1015 s and a 4.5 GB compiler cache with -g, 760 s and 3.4 GB
with -g1.

The new test asks configure_command() for -g1 in the build type's own
flags (CMAKE_<LANG>_FLAGS_<CONFIG>), which CMake puts after
CMAKE_<LANG>_FLAGS, so it replaces the build type's -g.

Fails: test_configure_builds_line_tables_only (asan, tsan, valgrind:
no -DCMAKE_C_FLAGS_<CONFIG> in the configure line).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ly (#3457)

configure_command() sets CMAKE_C_FLAGS_<CONFIG> and CMAKE_CXX_FLAGS_<CONFIG>
for the tool's build type from BUILD_TYPE_FLAGS: CMake's own RelWithDebInfo
and Debug flags with -g1 in place of -g. The tool flags stay as they are.

Checked on a local -g1 build against the nightly's -g reports (master
d2efb3a): the asan leak reports of test_media_alpha_network have the
same 7 reports, the same OBS stacks and the same 105 frames (42 with
file:line, 33 inlined). The tsan races of test_view, test_audio_io,
test_audio_controls, test_task and test_async_delay_audio name the same
locations, with the same share of file:line frames; the races that
differ are the timing-dependent ones that come and go between runs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Local-Gate: v1 tree=865507d42af1f0ce4f60c71ccfd44fc408c333e1 secs=271 lanes=lint:run,rust-test:run,cross:run,tier2-linux:run,macos-native:n/a,windows-native:n/a
Ci-Attestation: {"at":1793571861,"gate":"rust/all/fmt","host":"linux-x86_64","key":"5ea68102821d11a25b563d206084d22025db47140f4a96b205f178a15d299e10","lane":"lint","parents":["13a1123230c7c0cb09cda619d8ac008f1605ea8c"],"secs":80,"stamp":"afead775a4a841a001dc9f36371e7b7d","tree":"865507d42af1f0ce4f60c71ccfd44fc408c333e1","v":1,"via":"run"}
Ci-Attestation: {"at":1793571861,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"5ea68102821d11a25b563d206084d22025db47140f4a96b205f178a15d299e10","lane":"lint","parents":["13a1123230c7c0cb09cda619d8ac008f1605ea8c"],"secs":80,"stamp":"ee90f8202e5022fce42440a521c2ce03","tree":"865507d42af1f0ce4f60c71ccfd44fc408c333e1","v":1,"via":"run"}
Ci-Attestation: {"at":1793571861,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"6064b3fd17d630294f096b93e21f8a544565f2e6f069fb40051908ec838d65de","lane":"rust-test","parents":["13a1123230c7c0cb09cda619d8ac008f1605ea8c"],"secs":84,"stamp":"99ea2fdc6bedcd1107b79db47c1bdafb","tree":"865507d42af1f0ce4f60c71ccfd44fc408c333e1","v":1,"via":"run"}
Ci-Attestation: {"at":1793571861,"gate":"rust/x86_64-pc-windows-msvc/clippy","host":"linux-x86_64","key":"23f1c2cca5f008889b46dc13396b73c8579e6a6df28447a8a319dd4c53ac2db7","lane":"cross","parents":["13a1123230c7c0cb09cda619d8ac008f1605ea8c"],"secs":55,"stamp":"56aec941f53b3af8d930da6eeff8c730","tree":"865507d42af1f0ce4f60c71ccfd44fc408c333e1","v":1,"via":"run"}
Ci-Attestation: {"at":1793571861,"gate":"rust/x86_64-pc-windows-msvc/dylint","host":"linux-x86_64","key":"23f1c2cca5f008889b46dc13396b73c8579e6a6df28447a8a319dd4c53ac2db7","lane":"cross","parents":["13a1123230c7c0cb09cda619d8ac008f1605ea8c"],"secs":55,"stamp":"0563d684cdc8fe655a2c319b0e8ed55f","tree":"865507d42af1f0ce4f60c71ccfd44fc408c333e1","v":1,"via":"run"}
Ci-Attestation: {"at":1793571861,"gate":"rust/aarch64-apple-darwin/clippy","host":"linux-x86_64","key":"23f1c2cca5f008889b46dc13396b73c8579e6a6df28447a8a319dd4c53ac2db7","lane":"cross","parents":["13a1123230c7c0cb09cda619d8ac008f1605ea8c"],"secs":55,"stamp":"52616034e6073a1eb61302102a349656","tree":"865507d42af1f0ce4f60c71ccfd44fc408c333e1","v":1,"via":"run"}
Ci-Attestation: {"at":1793571861,"gate":"rust/aarch64-apple-darwin/dylint","host":"linux-x86_64","key":"23f1c2cca5f008889b46dc13396b73c8579e6a6df28447a8a319dd4c53ac2db7","lane":"cross","parents":["13a1123230c7c0cb09cda619d8ac008f1605ea8c"],"secs":55,"stamp":"c338a386b6272b31abdf4e0ed1868293","tree":"865507d42af1f0ce4f60c71ccfd44fc408c333e1","v":1,"via":"run"}
Ci-Attestation: {"at":1793571861,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"55e635df86272cf1221e8ee26703eba3f4743c9ae53e1632e72ecb46a9dcec0a","lane":"tier2-linux","parents":["13a1123230c7c0cb09cda619d8ac008f1605ea8c"],"secs":271,"stamp":"7bf4f2e40ac4674811770d4a8e30b572","tree":"865507d42af1f0ce4f60c71ccfd44fc408c333e1","v":1,"via":"run"}
@vpacher
vpacher requested a review from zackees as a code owner November 1, 2026 22:26
@vpacher
vpacher enabled auto-merge November 1, 2026 22:26
@vpacher
vpacher added this pull request to the merge queue Nov 1, 2026
Merged via the queue into master with commit 7243a9f Nov 1, 2026
36 checks passed
@vpacher
vpacher deleted the ci/3457-sanitize-line-tables branch November 1, 2026 22:33
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.

ci(sanitizers): build with line tables only (-g1): the cold asan build is 25 % faster and its compiler cache 24 % smaller

1 participant