harness-writing

Create fuzzing harnesses with LLVMFuzzerTestOneInput and FuzzedDataProvider for C/C++, Rust, and Go.

Updated Jul 10, 2025
One-click install
npx skills add https://github.com/Superlend/superloop-core-contracts --skill harness-writing
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: harness-writing
Source: https://github.com/Superlend/superloop-core-contracts/tree/main/.cursor/skills/testing-handbook-skills/skills/harness-writing
Command: npx skills add https://github.com/Superlend/superloop-core-contracts --skill harness-writing

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill addresses the need for reliable, high-coverage fuzzing harnesses that can target code across multiple programming languages.

Core Features & Use Cases

  • Harness design patterns for C/C++, Rust, and Go to route fuzzed inputs to the SUT.
  • Structured input extraction using utilities like FuzzedDataProvider to produce typed data safely.
  • Determinism and isolation by resetting global state and mocking I/O to ensure reproducible results across iterations.
  • Use Case: When fuzzing a new library, create a minimal LLVMFuzzerTestOneInput harness that validates inputs and exercises core APIs.

Quick Start

Create a minimal harness with LLVMFuzzerTestOneInput, link with libFuzzer, and run with a small seed corpus to begin fuzzing.

Frequently Asked Questions about harness-writing

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

FAQPage Schema
How do I write a fuzzing harness that works with libFuzzer?

To write a fuzzing harness for libFuzzer, create a minimal LLVMFuzzerTestOneInput entry point that accepts fuzzed inputs, link it with the libFuzzer library, and execute the target with a small seed corpus to begin exercising code paths.

How do I use FuzzedDataProvider to generate structured inputs for fuzzing?

FuzzedDataProvider enables structured input extraction by safely consuming raw fuzzed data to produce typed values, allowing your fuzzing harness to route valid primitive data structures directly into the target APIs.

Can I build fuzzing harnesses for Go and Rust, or is it limited to C/C++?

You can build fuzzing harnesses across multiple languages including C/C++, Rust, and Go, applying specific harness design patterns to route fuzzed inputs and exercise core APIs for each language environment.

What is the best way to ensure determinism in a fuzzing harness?

To ensure determinism in a fuzzing harness, you must reset global state, mock non-deterministic I/O operations, and isolate the target code, which guarantees reproducible results across multiple fuzzing iterations.

Why does my fuzzing harness fail to reproduce crashes across different runs?

Fuzzing harnesses fail to reproduce crashes when non-deterministic I/O or persistent global state alters execution paths, requiring you to mock I/O and reset state to achieve deterministic, reproducible results.

When do I need to create a custom fuzzing harness instead of using default inputs?

You need a custom fuzzing harness when targeting a new library, enabling high-coverage workflows by creating minimal entry points that validate structured inputs and directly exercise core API functions.