explaingit

google/sanitizers

12,373CAudience · developerComplexity · 4/5Setup · hard

TLDR

An archived Google repository that documented a family of bug-finding tools for C and C++ programs, the tools themselves have moved into the LLVM compiler project and are no longer maintained here.

Mindmap

mindmap
  root((sanitizers))
    Tools covered
      AddressSanitizer
      MemorySanitizer
      ThreadSanitizer
      LeakSanitizer
    Bugs each finds
      Memory access errors
      Uninitialized variables
      Race conditions
      Memory leaks
    Status
      Archived repo
      Moved to LLVM
    Bug reporting
      LLVM issue tracker
      GCC bugzilla
      Android tracker
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Learn what AddressSanitizer, MemorySanitizer, ThreadSanitizer, and LeakSanitizer do and which class of bugs each tool finds.

USE CASE 2

Find where to report sanitizer bugs today, LLVM issue tracker for runtime issues, GCC bugzilla for the GCC port, or platform-specific trackers.

Tech stack

CC++LLVMClangGCC

Getting it running

Difficulty · hard Time to first run · 1h+

Repository is archived, tools now live in LLVM/Clang, you need to build or install a Clang/GCC toolchain to use them.

License not specified in the explanation, check the repository directly before using in a project.

In plain English

This repository was a Google-maintained home for a family of code analysis tools called sanitizers, used to find bugs in C and C++ programs. The tools work by monitoring a running program and flagging certain categories of problems that are otherwise very hard to find through normal testing. AddressSanitizer detects memory access errors such as reading memory that has already been freed. MemorySanitizer catches code that uses variables before giving them a value. ThreadSanitizer finds race conditions, which are bugs that occur when multiple threads of execution access shared data in an unsafe order. LeakSanitizer identifies memory that was allocated but never released. This repository has been archived and is no longer actively maintained. The actual sanitizer code has moved into the LLVM compiler project, which is the main open source compiler infrastructure used to build tools like Clang. The archived repository is preserved for historical documentation and reference but is not the right place to report new bugs. The README lists where to report bugs depending on the context: LLVM's issue tracker for sanitizer runtime problems, GCC's bug system for the GCC compiler port, Apple and Microsoft channels for their respective compilers, and Android's issue tracker for Android-related problems. Kernel variants of these tools, used for finding bugs in the Linux operating system kernel itself, are documented separately.

Copy-paste prompts

Prompt 1
I want to use AddressSanitizer to find memory bugs in my C++ program. Where does the tool live now that this repo is archived, and how do I enable it when compiling with Clang?
Prompt 2
Explain the difference between AddressSanitizer, MemorySanitizer, ThreadSanitizer, and LeakSanitizer, what kind of bug does each one catch and when should I reach for each?
Prompt 3
I found a bug in the sanitizer runtime when using Clang on Linux. Where should I file the issue now that the google/sanitizers repo is archived?
Prompt 4
How do I run ThreadSanitizer on a multithreaded C++ program to detect race conditions? Show me the compile flags and how to read the output report.
Open on GitHub → Explain another repo

← google on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.