Summary
Add ThreadSanitizer (TSan) to the CI pipeline to catch data races and threading bugs automatically.
Background
During recent test fixes, TSan helped identify data races in TrackedString/TrackingCounter that weren't caught by regular tests or ASan. TSan is valuable for a threading-heavy library like ev_loop.
Proposed Implementation
Add a TSan configuration to the matrix include section in ci.yaml:
matrix:
# ... existing configuration ...
include:
# ... existing includes ...
# ThreadSanitizer build (Clang only, mutually exclusive with ASan/UBSan)
- os: ubuntu-latest
compiler: llvm-19.1.1
generator: "Ninja Multi-Config"
build_type: Debug
packaging_maintainer_mode: ON
enable_tsan: ON
Then conditionally pass the TSan flag in the CMake configure step:
-Dev_loop_ENABLE_SANITIZER_THREAD=${{ matrix.enable_tsan || 'OFF' }}
Notes
- TSan cannot run alongside ASan/UBSan (mutually exclusive)
- Use
PACKAGING_MAINTAINER_MODE=ON to disable other sanitizers by default
- Single configuration (Clang + Debug) is sufficient for TSan coverage
- Clang has better TSan support than GCC
Summary
Add ThreadSanitizer (TSan) to the CI pipeline to catch data races and threading bugs automatically.
Background
During recent test fixes, TSan helped identify data races in
TrackedString/TrackingCounterthat weren't caught by regular tests or ASan. TSan is valuable for a threading-heavy library like ev_loop.Proposed Implementation
Add a TSan configuration to the matrix
includesection inci.yaml:Then conditionally pass the TSan flag in the CMake configure step:
-Dev_loop_ENABLE_SANITIZER_THREAD=${{ matrix.enable_tsan || 'OFF' }}Notes
PACKAGING_MAINTAINER_MODE=ONto disable other sanitizers by default