address-sanitizer

Detects memory errors in C/C++ code during fuzzing using AddressSanitizer instrumentation.

Updated Mar 22, 2026
One-click install
npx skills add https://github.com/TECH-HY/SKILLS --skill address-sanitizer-tech-hy
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: address-sanitizer
Source: https://github.com/TECH-HY/SKILLS/tree/main/skills/address-sanitizer
Command: npx skills add https://github.com/TECH-HY/SKILLS --skill address-sanitizer-tech-hy

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Memory corruption bugs like buffer overflows and use-after-free errors often go undetected during testing and fuzzing, leading to security vulnerabilities and crashes that are hard to diagnose without proper instrumentation. ## Core Features & Use Cases - Compile-Time Instrumentation: Guides enabling ASan with -fsanitize=address in Clang/GCC to detect buffer overflows, use-after-free, double-free, and memory leaks at runtime. - Fuzzer Integration: Provides tool-specific setup for libFuzzer, AFL++, cargo-fuzz, and honggfuzz, including required memory limit adjustments like -rss_limit_mb=0 and -m none. - Use Case: When fuzzing a C++ parsing library with libFuzzer, compile with -fsanitize=fuzzer,address and run with ASan options configured to catch heap-buffer-overflow reports with full stack traces. ## Quick Start Compile my fuzz target with AddressSanitizer enabled and show me how to configure the runtime options for a fuzzing session.

Frequently Asked Questions about address-sanitizer

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

FAQPage Schema
How do I enable AddressSanitizer when fuzzing C++ code?

Compile and link with the -fsanitize=address flag using Clang or GCC, adding -g for detailed stack traces. For libFuzzer, combine it as -fsanitize=fuzzer,address and run with -rss_limit_mb=0 to allow ASan's virtual memory usage.

How to use AddressSanitizer with AFL++ fuzzing?

Set the AFL_USE_ASAN=1 environment variable when compiling with afl-clang-fast++, which automatically adds the proper instrumentation flags. Then run afl-fuzz with -m none to disable the memory limit that would otherwise kill ASan-instrumented processes.

Does AddressSanitizer work on Windows and macOS?

ASan has full support and best performance on Linux. macOS has limited support with some features unavailable, while Windows support is experimental and not recommended for production fuzzing workflows.

Why does my fuzzer kill the ASan-instrumented process immediately?

ASan requires approximately 20TB of virtual memory for its shadow memory mapping, which exceeds default fuzzer memory limits. Disable the limits using -rss_limit_mb=0 for libFuzzer or -m none for AFL++.

Should I use AddressSanitizer in production builds?

No, ASan should only be used during testing and fuzzing. It introduces a 2-4x performance slowdown and can actually reduce security in production by exposing additional attack surface through its runtime instrumentation.

Can AddressSanitizer be combined with other sanitizers?

Yes, ASan can be combined with UndefinedBehaviorSanitizer using -fsanitize=address,undefined for comprehensive detection of both memory errors and undefined behavior. This combination is commonly used in fuzzing setups.