Описание тега sanitizer
Sanitizers are a compiler feature supported by Clang and GCC for instrumenting programs to do dynamic analysis and catch many classes of bugs at runtime.
Sanitizers are a compiler feature supported by Clang and GCC for instrumenting programs to do dynamic analysis. There are sanitizers to detect many issues, including many C and C++ "undefined behaviors", signed integer arithmetic overflow, memory allocation errors, use of uninitialized memory, and data races between threads.
These checks can be enabled at compile time using the -fsanitize=
option (for example, -fsanitize=address
).
The following sanitizers are supported:
- AddressSanitizer (ASAN) (since Clang 3.2, GCC 4.8) /questions/tagged/address-sanitizer
- LeakSanitizer (LSan) (since Clang 3.4, GCC 4.9) /questions/tagged/leak-sanitizer
- ThreadSanitizer (TSan) (since Clang 3.2, GCC 4.8) /questions/tagged/thread-sanitizer
- Undefined Behavior Sanitizer (ubsan) (since Clang??, GCC 4.9) ubsan
- MemorySanitizer (since Clang 3.3)
More information on the sanitizers development can be found at http://compiler-rt.llvm.org/.
The current list of supported options can be found in the compiler documentation: