coverage-analysis

Measures code coverage of fuzzing corpora using LLVM, GCC, and cargo-fuzz instrumentation.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Fuzzing campaigns often plateau without revealing which code paths are actually exercised, leaving harness weaknesses and magic value blockers invisible. This Skill provides a repeatable workflow to instrument builds, execute corpora, and generate coverage reports that expose untested code. ## Core Features & Use Cases - Multi-toolchain instrumentation: Build coverage binaries with LLVM (-fprofile-instr-generate -fcoverage-mapping), GCC (-ftest-coverage -fprofile-arcs), or Rust's cargo +nightly fuzz coverage. - Report generation: Produce text and HTML reports with llvm-cov, gcovr, and llvm-profdata, filtering out harness code to focus on the system under test. - Blocker identification: Detect magic value checks, dead code, and coverage regressions, then feed findings into dictionaries or seed inputs. - Use Case: After a libFuzzer campaign stalls, build a coverage-instrumented binary, run it against the corpus, and generate an HTML report revealing an ELF magic-number check that needs a dictionary entry. ## Quick Start Ask the AI to generate an LLVM coverage report for your fuzzing corpus by building an instrumented binary and running llvm-cov against the collected profile data.

Frequently Asked Questions about coverage-analysis

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

FAQPage Schema
How do I generate a code coverage report for a fuzzing corpus?

Build your target with coverage instrumentation flags such as -fprofile-instr-generate -fcoverage-mapping for Clang, execute the corpus through a runtime that calls your harness, then merge the profile with llvm-profdata and render it with llvm-cov report or llvm-cov show.

How to measure fuzzing coverage in Rust with cargo-fuzz?

Install the nightly toolchain with llvm-tools-preview, then run cargo +nightly fuzz coverage <target>. Generate HTML output with cargo cov, llvm-cov show, and rustfilt for demangled function names, filtering by source files like src/lib.rs.

Should I use fuzzer-reported coverage or llvm-cov for comparisons?

Use dedicated tools like llvm-cov or gcovr for reproducible measurements. Different fuzzers calculate internal coverage differently, so fuzzer-reported numbers are not comparable across tools or campaigns.

Why does coverage generation fail when my corpus contains crashing inputs?

A crashing input terminates the process before profile data is written. Fix the crashes first, or fork a child process per input so the parent survives and continues collecting coverage from the remaining corpus files.

Can I mix GCC and LLVM coverage instrumentation in one build?

No, LLVM and GCC coverage formats are incompatible and cause parsing failures. Rebuild everything with a single toolchain, using either -fprofile-instr-generate with llvm-cov or -ftest-coverage with gcovr.

When should I skip coverage analysis during fuzzing?

Skip it when the campaign is actively finding crashes, when coverage infrastructure is not set up, or when the codebase is so large that full reports are impractical. The fuzzer's internal metrics may suffice in those cases.