libfuzzer

Fuzz C/C++ code with LLVM's coverage-guided in-process fuzzer and Clang sanitizers.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Finding memory corruption, crashes, and undefined behavior in C/C++ code manually is slow and unreliable. This Skill guides you through setting up libFuzzer, LLVM's coverage-guided fuzzer, so you can automatically generate test inputs that explore code paths and surface bugs like buffer overflows and use-after-free errors. ## Core Features & Use Cases - Harness Writing Guidance: Provides patterns for writing LLVMFuzzerTestOneInput harnesses, including FuzzedDataProvider usage, interleaved fuzzing, and rules for deterministic, fast harnesses. - Compilation & Sanitizer Integration: Covers Clang flags like -fsanitize=fuzzer,address,undefined, static library builds, and CMake integration for instrumented fuzzing builds. - Campaign Management: Explains corpus creation and minimization, fuzzing dictionaries, multi-core options (-jobs/-workers/-fork), coverage analysis with llvm-cov, and troubleshooting common issues. - Use Case: You maintain a C++ library that parses PNG files. Use this Skill to write a fuzzing harness, compile it with AddressSanitizer, seed a corpus with sample PNGs, and run a campaign that discovers a heap-buffer-overflow before it ships. ## Quick Start Use the libfuzzer skill to write a fuzzing harness for my C++ parser function and show me how to compile and run it with AddressSanitizer.

Frequently Asked Questions about libfuzzer

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

FAQPage Schema
How do I fuzz C++ code with libFuzzer?▼

Write a harness defining LLVMFuzzerTestOneInput that passes fuzzer data to your target function, then compile with clang++ -fsanitize=fuzzer,address and run the binary against a corpus directory. The fuzzer mutates inputs to maximize code coverage and saves crashing inputs automatically.

libFuzzer vs AFL++ which fuzzer should I use?▼

libFuzzer is best for quick setup and single-core fuzzing of Clang-compilable C/C++ projects. AFL++ is better for serious multi-core fuzzing and diverse mutations. Harnesses written for libFuzzer are compatible with AFL++, so transitioning later is straightforward.

Does libFuzzer work on Windows and macOS?▼

libFuzzer works on macOS via Homebrew or Nix LLVM installs, and on Windows through Clang in Visual Studio. However, Linux provides the best support and performance, so fuzzing on a Linux x86_64 VM is recommended.

Why does AddressSanitizer cause out of memory errors during fuzzing?▼

ASan reserves roughly 20TB of virtual memory, which can trigger RSS limits. Disable the limit by running the fuzzer with -rss_limit_mb=0 or setting ASAN_OPTIONS=rss_limit_mb=0 before starting the campaign.

How do I continue fuzzing after libFuzzer finds a crash?▼

Run the fuzzer with -fork=1 -ignore_crashes=1 to continue the campaign after crashes are found. By default libFuzzer stops at the first crash, but these experimental flags let it keep exploring while saving each crash artifact.

When should I not use libFuzzer?▼

Avoid libFuzzer when you need serious multi-core fuzzing, hardware-based coverage, or when your project only compiles with GCC. In those cases use AFL++, Honggfuzz, or LibAFL instead.