Add sanitizer support via score_cpp_policies#200
Conversation
License Check Results🚀 The license check job ran with the Bazel command: bazel run --lockfile_mode=error //:license-checkStatus: Click to expand output |
|
The created documentation from the pull request is available at: docu-html |
|
be aware there is also going work in that direction in score_cpp_policies repo |
9d8bad6 to
c564c1f
Compare
Should lifecycle continue with the self-contained sanitizer implementation in this PR as a short-term unblocker, planning a later migration to the shared score_cpp_policies module once its sanitizer structure stabilizes or do we want to pivot now and integrate directly with the centralized sanitizer infrastructure despite the potential dependency and release-readiness risks? |
|
My opinion: I would say we should bring in our thoughts into score_cpp_policies and not create silos. @NicolasFussberger @S-MOHAMD @pawelrutkaq any thoughts on this? |
c564c1f to
337377e
Compare
If we can bring in these changes into score_cpp_policies, I agree that this should be the preferred solution. I cannot judge how realistic this is. |
337377e to
a06a471
Compare
8535c00 to
b3d06a8
Compare
cc2c268 to
b92ef96
Compare
b92ef96 to
253a46c
Compare
2f9c3ce to
9f26999
Compare
617a7af to
d25d533
Compare
|
|
||
| - name: Configure kernel for TSan (ASLR breaks TSan shadow memory layout) | ||
| if: matrix.config == 'tsan' | ||
| run: sudo sysctl -w kernel.randomize_va_space=0 |
There was a problem hiding this comment.
What is the problem that shows up with ASLR?
Locally I am not encountering a problem with ASLR enabled.
There is also this ticket llvm/llvm-project#164989 which suggests
build and link our sanitizer tests with -no-pie
I am asking because I wonder if there is a security concern with disabling ASLR here.
Description
Integrates ASan, UBSan, LSan, and TSan using the centralized
score_cpp_policiesinfrastructure rather than a self-contained implementation, avoiding fragmentation across S-CORE modules.Changes
MODULE.bazelscore_cpp_policiesas adev_dependencyviagit_override(not yet in the bazel_registry)..bazelrc--build_tests_onlyto both sanitizer configs — without this,--test_tag_filtersonly gates test execution; Bazel's wildcard expansion would still attempt to build excluded targets (e.g. Rust binaries that cannot link under sanitizers), failing the build before any tests run.score_cpp_policies' runtime infrastructure (wrapper script, suppression files, env templates):--config=asan_ubsan_lsan— AddressSanitizer + UBSan + LeakSanitizer--config=tsan— ThreadSanitizer (separate run, incompatible with ASan)--config=asan/--config=ubsan/--config=lsan— convenience aliases-no-asan,-no-tsan, etc.) are baked into each config.github/workflows/sanitizers.yml//src/... //tests/...on every PR, merge group, and push tomain. The TSan job setskernel.randomize_va_space=0to satisfy TSan's shadow memory layout requirements in the GitHub Actions runner.src/health_monitoring_lib/BUILDtestsandloom_testsno-asan/no-tsan— Rust binaries incompatible with sanitizer linking.cpp_testsno-asan/no-tsan— links uninstrumented Rust code, producing false positives under both ASan and TSan.src/.../common/concurrency/BUILDmpmc_concurrent_queue_tsan_test, which had hardcoded-fsanitize=threadcopts/linkopts that would double-instrument the binary under--config=tsan. The regularmpmc_concurrent_queue_testnow covers TSan via the global config.mpmc_concurrent_queue_testno-asan— benign UBSan alignment false-positive on ASan's fake stack. Test remains active under TSan.src/.../process_state_client_lib/BUILDprocessstateclient_UTno-tsan— the IPC overflow path returns an incorrect error code under TSan's forced-O1build. Test remains active under ASan/UBSan/LSan.tests/utils/bazel/integration.bzlNotes
Each tag exclusion is scoped as narrowly as possible: tests are only skipped for the sanitizer(s) where the failure is a known false positive or environmental limitation. Re-enabling any of them is a matter of removing the relevant tag once the underlying issue is resolved upstream.
Running locally
ASan + UBSan + LSan
ThreadSanitizer
Closes #50