address-sanitizer

Instrument C/C++ code with AddressSanitizer to detect memory errors during fuzzing.

6.5k|561|Updated Jan 14, 2026
One-click install
npx skills add https://github.com/trailofbits/skills --skill address-sanitizer-trailofbits
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: address-sanitizer
Source: https://github.com/trailofbits/skills/tree/main/plugins/testing-handbook-skills/skills/address-sanitizer
Command: npx skills add https://github.com/trailofbits/skills --skill address-sanitizer-trailofbits

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

AddressSanitizer detects memory safety errors such as buffer overflows and use-after-free during fuzzing by instrumenting code at compile time.

Core Features & Use Cases

  • Instrumentation: inserts runtime checks to detect invalid memory operations.
  • Shadow memory model: tracks memory usage and detects invalid accesses.
  • Use cases: fuzzing C/C++ code, debugging memory corruption in libraries, validating native code safety during tests.

Quick Start

Compile the target with AddressSanitizer flags and run the fuzz harness to start detecting memory errors.

Frequently Asked Questions about address-sanitizer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I detect buffer overflows and use-after-free errors during C++ fuzzing?

To detect buffer overflows and use-after-free errors during C++ fuzzing, compile your code with AddressSanitizer using the -fsanitize=address flag to enable compile-time instrumentation and runtime memory checks.

Does AddressSanitizer work with clang and GCC for native code memory checks?

Yes, AddressSanitizer works with both clang and GCC on supported platforms. You must enable compile-time instrumentation and runtime support by passing the -fsanitize=address flag during your build process.

How do I instrument a fuzz harness to catch memory corruption in native libraries?

Instrument a fuzz harness by compiling the target C/C++ code with the -fsanitize=address flag, which inserts runtime checks to detect invalid memory operations like buffer overflows and use-after-free during fuzzing execution.

What is the shadow memory model used for memory safety checks in AddressSanitizer?

The shadow memory model tracks application memory usage by mapping each memory region to a shadow state, enabling the runtime to detect invalid memory accesses and memory corruption during native code execution.

What are the limitations of using AddressSanitizer for fuzzing workflows?

AddressSanitizer requires compile-time instrumentation, meaning it cannot detect errors in uninstrumented binaries or system libraries, and it introduces runtime overhead and increased memory usage due to shadow memory tracking.

When do I need AddressSanitizer for validating native code safety?

You need AddressSanitizer when validating native code safety during tests or fuzzing workflows to actively catch memory corruption issues like buffer overflows and use-after-free in C/C++ libraries that might otherwise go undetected.