sanitizers (google/sanitizers)
Searching Database…
12.5K ·GitHub
What is this?
A family of runtime checkers that catch memory errors and data races in C and C++ code: AddressSanitizer, MemorySanitizer, ThreadSanitizer, LeakSanitizer and more. This repo is their archived documentation hub.
Is it a tool I install from here, or part of my compiler?
Part of your compiler: the core code resides in the LLVM repository (Clang) and GCC ships its own port, so you get the sanitizers through toolchains like Clang, GCC, Xcode or Visual Studio.
So how do I start using the sanitizers on my own code?
Not via this repo — it is kept only for archival purposes: historical documentation, bugfixes and helper code. You build your program with a compiler that includes the sanitizer you need.
Is this project still actively maintained?
No — the repository has been archived and is no longer actively maintained, and new bug reports should not be filed here.
What kinds of bugs can these tools actually catch?
AddressSanitizer detects addressability issues, LeakSanitizer finds memory leaks, ThreadSanitizer spots data races and deadlocks in C++ and Go, MemorySanitizer catches use of uninitialized memory, and UBSan flags undefined behavior.
What is HWASAN?
Hardware-assisted AddressSanitizer — a newer variant of AddressSanitizer that relies on hardware support and consumes much less memory than the classic version.
Are there sanitizers for the Linux kernel itself?
Yes — KASAN, KMSAN and KCSAN bring AddressSanitizer-, MemorySanitizer- and ConcurrencySanitizer-style checking to the kernel, and their documentation is also archived here.
If I hit a sanitizer bug, where do I report it?
Not here: runtime and instrumentation bugs go to the LLVM Bug Tracker, GCC-port issues to GCC Bugzilla, kernel-sanitizer issues to kernel channels, and Xcode, Visual Studio or Android NDK problems to those vendors' trackers.
What are similar projects?
darwin-xnu, porffor, scriptc, bpftrace, CalcKernel, llvm-project, coreclr, emscripten