Skip to content

Follow-up B: Add TSan + ASan CI matrix entries for SNMALLOC_PROFILE=ON - #28

Merged
jayakasadev merged 1 commit into
mainfrom
followup/b-tsan-asan-ci
Jun 11, 2026
Merged

jayakasadev merged 1 commit into
mainfrom
followup/b-tsan-asan-ci

Conversation

@jayakasadev

Copy link
Copy Markdown
Owner

Summary

Two new matrix entries in .github/workflows/main.yml mirroring the existing SNMALLOC_PROFILE=ON legs:

  • Profile + TSan (clang) — ubuntu-24.04 Debug, SNMALLOC_SANITIZER=thread, libc++ (libstdc++ on Ubuntu isn't TSan-instrumented — mirrors existing TSan+UBSan legs)
  • Profile + ASan (clang) — ubuntu-24.04 Debug, SNMALLOC_SANITIZER=address, default libstdc++

Both run ctest -R 'profile_' covering perf-profile_stress-{fast,check} + all func-profile_* tests.

Used the existing SNMALLOC_SANITIZER plumbing (CMakeLists.txt:73-75) — wires -fsanitize into BOTH compile and link lines + activates source-level TSan guards. Raw CMAKE_CXX_FLAGS would only flow to compile, silently failing to link the runtime.

Closes ClickUp ticket 86aj0h864.

Test plan

  • yaml.safe_load on the workflow file
  • Local ASan smoke: perf-profile_stress-fast ran 5.38s under ASan, no diagnostics
  • TSan local: not runnable on macOS arm64 (no TSan-instrumented libc++ in the toolchain) — relying on GitHub runner

If TSan surfaces a race on the runner, fix goes in a separate ticket per scope.

- Adds two ubuntu-24.04 clang Debug matrix legs to the existing
  ubuntu job in .github/workflows/main.yml so the heap-profiling
  code paths exercised by perf-profile_stress and the func-profile_*
  suite are run under ThreadSanitizer and AddressSanitizer.
- Both legs configure -DSNMALLOC_PROFILE=ON and the project's
  existing SNMALLOC_SANITIZER cmake option (=thread / =address)
  instead of raw CMAKE_CXX_FLAGS=-fsanitize=...; this is the
  idiomatic mechanism already used by the existing "TSan + UBSan"
  matrix entries (CMakeLists.txt:73-75, 580-606, 668-672) and
  correctly wires -fsanitize through to test-target compile and
  link lines plus the SNMALLOC_THREAD_SANITIZER_ENABLED define
  the codebase guards on.
- The TSan leg installs libc++-dev and uses -stdlib=libc++ to
  match the existing TSan + UBSan legs (libstdc++ on Ubuntu is
  not TSan-instrumented).  The ASan leg uses the default
  libstdc++ runtime, which is ASan-compatible.
- Both legs pass `-R profile_` via test-extra-args so ctest runs
  only the profile suite (perf-profile_stress-{fast,check} +
  func-profile_*).  This bounds sanitizer overhead within the
  CI time budget while still exercising the new snapshot-under-
  churn workload from PR #24.
- Local validation: configured + built + ran perf-profile_stress-fast
  on darwin-arm64 with -DSNMALLOC_SANITIZER=address; the fast
  variant ran ~5s under ASan with no diagnostics.  TSan was not
  validated locally because the macOS toolchain available here
  does not ship a TSan-instrumented libc++; relying on the
  GitHub ubuntu-24.04 runner for that leg as called out in the
  ticket.
@jayakasadev
jayakasadev merged commit 58f1f55 into main Jun 11, 2026
158 of 210 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant