llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

Port TSAN wiki to clang docs

Open ccotter opened this issue 9 months ago • 2 comments

https://github.com/google/sanitizers/wiki/ has many useful docs on TSAN. The most popular google search result for TSAN_OPTIONS is https://github.com/google/sanitizers/wiki/ThreadSanitizerFlags (although this page specifically has not been updated since 2015; is it up to date?).

Should we port these over into clang's docs (clang/docs/ThreadSanitizer.rst or another page in this directory)? Note: TSAN is not clang specific since it's supported in GCC, and the same wiki also has great docs on ASAN which is also supported by GCC.

ccotter avatar Feb 15 '26 06:02 ccotter

I think it's possible, but google/sanitizers description of TSAN isn't entirely consistent with the current LLVM.

For example, regarding ShadowState, google/sanitizers describes it as 64-bit in ThreadSanitizerAlgorithm, but LLVM currently uses 32-bit.

struct Parts {
  u8 access_;
  Sid sid_;
  u16 epoch_ : kEpochBits;
  u16 is_read_ : 1;
  u16 is_atomic_ : 1;
};

suoyuan666 avatar Mar 11 '26 06:03 suoyuan666

https://github.com/google/sanitizers/wiki/ThreadSanitizerAlgorithm mentions "we provide a high-level description of ThreadSanitizer (version 2) algorithm". LLVM uses TSan v3; there isn't much public documentation besides https://groups.google.com/g/thread-sanitizer/c/Gxnhk4l9TN8.

thurstond avatar Mar 24 '26 23:03 thurstond