home / skills / plurigrid / asi / address-sanitizer
This skill helps you detect memory safety bugs in C/C++ by using AddressSanitizer to identify use-after-free, overflow, and leaks.
npx playbooks add skill plurigrid/asi --skill address-sanitizerReview the files below or copy the command above to add this skill to your agents.
---
name: address-sanitizer
description: Use AddressSanitizer to detect memory safety bugs in C/C++ programs. Identifies use-after-free, buffer overflow, memory leaks, and other memory errors.
category: testing-handbook-skills
author: Trail of Bits
source: trailofbits/skills
license: AGPL-3.0
trit: -1
trit_label: MINUS
verified: true
featured: false
---
# Address Sanitizer Skill
**Trit**: -1 (MINUS)
**Category**: testing-handbook-skills
**Author**: Trail of Bits
**Source**: trailofbits/skills
**License**: AGPL-3.0
## Description
Use AddressSanitizer to detect memory safety bugs in C/C++ programs. Identifies use-after-free, buffer overflow, memory leaks, and other memory errors.
## When to Use
This is a Trail of Bits security skill. Refer to the original repository for detailed usage guidelines and examples.
See: https://github.com/trailofbits/skills
## Related Skills
- audit-context-building
- codeql
- semgrep
- variant-analysis
## SDF Interleaving
This skill connects to **Software Design for Flexibility** (Hanson & Sussman, 2021):
### Primary Chapter: 5. Evaluation
**Concepts**: eval, apply, interpreter, environment
### GF(3) Balanced Triad
```
address-sanitizer (○) + SDF.Ch5 (−) + [balancer] (+) = 0
```
**Skill Trit**: 0 (ERGODIC - coordination)
### Connection Pattern
Evaluation interprets expressions. This skill processes or generates evaluable forms.
This skill integrates AddressSanitizer to detect memory-safety bugs in C and C++ programs. It helps find use-after-free, heap and stack buffer overflows, uninitialized memory reads, and memory leaks during testing. The skill is intended for developers and testers aiming to harden native code with fast, compiler-assisted instrumentation.
The skill compiles programs or test harnesses with AddressSanitizer-enabled compiler flags (e.g., -fsanitize=address) and runs the instrumented binaries under typical test inputs or fuzzers. At runtime, the sanitizer intercepts memory accesses and allocation calls to detect violations and emits detailed diagnostics and stack traces. Outputs include error reports, source locations, and suggested fix points to speed triage and remediation.
Will AddressSanitizer work on all platforms?
AddressSanitizer supports major platforms and compilers (Clang, GCC) but has platform-specific limitations; check your toolchain docs for full compatibility.
Does using AddressSanitizer change program behavior?
Yes. Instrumentation alters memory layout and increases resource usage, so reproduce bugs under sanitizer builds rather than assuming identical behavior to production.