You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add comprehensive ThreadSanitizer output validation to prevent silent
test failures. TSAN tests now explicitly check for data races and fail
immediately with diagnostic output instead of masking errors.
Implementation:
- Capture TSAN stderr/stdout to log files for analysis
- Pattern match race indicators: "ThreadSanitizer: data race",
"ThreadSanitizer: race on", "WARNING: ThreadSanitizer:"
- Exit with status 1 immediately upon race detection
- Display race context (10 lines) for debugging
- Progress indicators for 3-tier validation (Interpreter, JIT-T1, JIT-T2)
Platform-Specific Handling:
- Linux (x64/ARM64): Use setarch -R for ASLR mitigation (already gated
in Makefile with ifeq ($(UNAME_S),Linux))
- macOS: NO setarch (not available), rely on MAP_FIXED allocations at
0x150000000000; gracefully handle SIP restrictions by distinguishing
MAP_FAILED errors from actual race conditions
Race Detection Patterns:
ThreadSanitizer: data race # Standard race report
ThreadSanitizer: race on # Race on specific object
WARNING: ThreadSanitizer: # General TSAN warnings
Error Handling (macOS):
MAP_FAILED # mmap failure
unexpected memory mapping # TSAN shadow conflict
FATAL: ThreadSanitizer # Initialization failure
→ Skip test with warning (SIP restriction)
→ Still fail hard on actual races
Benefits:
- Immediate failure on race detection (fail-fast principle)
- Clear diagnostic output in CI logs with race location/context
- Platform-aware: Linux uses setarch -R, macOS handles SIP gracefully
- No silent failures: Previously masked errors now cause test failure
- Debugging support: Log files preserved for post-mortem analysis
Validates race condition fixes from:
- 2a2a5c4: TSAN with FULL4G and T2C support
- f1b685e: ARM64 TSAN support and JIT cache coherency
- 669efc1: Build system regressions (setarch gating, TSAN compatibility)
0 commit comments