[clang] [compiler-rt] [llvm] [TySan] A Type Sanitizer (Runtime Library) (PR #76261)

Mingjie Xu via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 9 17:17:36 PST 2025


Enna1 wrote:

> @fhahn can TySan be made to trap when it detects a problem? I tried `-fsanitize-trap=type` but got:
> 
> `clang++: error: unsupported argument 'type' to option '-fsanitize-trap='`
> 
> `-fsanitize-trap=all` does not seem to result in TySan trapping, only logging...

`-fsanitize-trap` only supports UBSan and CFI, see https://github.com/llvm/llvm-project/blob/main/clang/lib/Driver/SanitizerArgs.cpp#L66.

If we want TySan to stop and abort when it detects first type-based aliasing violation, I would suggest implement `halt_on_error` support for TySan and default `halt_on_error`  to false. For reference, TSan defaults `halt_on_error`  to false, see https://github.com/llvm/llvm-project/blob/main/compiler-rt/lib/tsan/rtl/tsan_flags.inc#L45.

https://github.com/llvm/llvm-project/pull/76261


More information about the llvm-commits mailing list