arXiv:2610.23054cs.SEOct 2026

Manuscript Offprint

arXiv:2610.23054

Efficient Program Reduction for Library Fuzzing Harnesses

Haiying Li, Yunlong Lyu, Peng Chen, Hao Chen

HAIYING LI*, The University of Hong Kong, lihy2022@connect.hku.hk

YUNLONG LYU*, The University of Hong Kong, yunlong.lyu97@gmail.com

PENG CHEN, Independent Researcher, spinpx@gmail.com

HAO CHEN, The University of Hong Kong, chenho@hku.hk

Library fuzzing harnesses translate generated inputs into API calls. When a complex harness triggers a crash, developers must determine whether the cause is a library defect or invalid harness usage. A smaller reproducer can simplify this investigation, but obtaining one requires repeatedly building and executing modified harnesses and analyzing their crashes, making manual or even automatic minimization time-consuming. Moreover, data-dependent statements prevent the reducer to remove unnecessary code and the heavy stack trace symbolization in libraries also slows down the candidate execution. To address these challenges, we present HarnessMinimizer, a system for efficient minimization of C/C++ library fuzzing harnesses. Its optimized pipeline reuses header analysis and prepared libraries and runtimes to reduce the work required to build and execute each simplified harness during the reduction process. It records and replays input values so that unnecessary input operations can be removed without changing the values supplied to surviving calls. It also uses a fast method to check whether each simplified harness preserves the original crash, avoiding repeated stack trace symbolization. We evaluate HarnessMinimizer with four reduction engines on 200 crash cases from 21 open source libraries. Compared with the unoptimized pipeline, HarnessMinimizer achieves speedups of 3.46–4.51× in average total wall time. Average harness size decreases from 1,352 original tokens to 143–263 remaining tokens after minimization. In crash triage using a large language model, accuracy in identifying harness bugs increases from 28% with the original harnesses to 44–51% with the minimized harnesses, while accuracy for library bugs remains at 100%.

CCS Concepts: • Software and its engineering → Software maintenance tools; Software testing and debugging; • Security and privacy → Software security engineering.

Additional Key Words and Phrases: Program reduction, fuzzing harness minimization, crash triage

ACM Reference Format:

Haiying Li, Yunlong Lyu, Peng Chen, and Hao Chen. 2018. Efficient Program Reduction for Library Fuzzing Harnesses. In Proceedings of Make sure to enter the correct conference title from your rights confirmation email (Conference acronym 'XX). ACM, New York, NY, USA, 21 pages. https://doi.org/XXXXXXX.XXXXXXX

1 Introduction

Library fuzzing searches for bugs by repeatedly exercising library APIs with fuzzer-generated inputs. A fuzzing harness connects these inputs to the APIs by constructing arguments, initializing library state, invoking functions, and releasing resources [4, 24]. Developers can write harnesses manually or use tools to generate them. Recent systems use large language models (LLMs) to generate harnesses from library declarations, documentation, and calling relationships [15, 22, 23, 37],

∗^{*}Authors contributed equally.

Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from permissions@acm.org.

Conference acronym 'XX, Woodstock, NY

© 2018 Copyright held by the owner/author(s). Publication rights licensed to ACM.

ACM ISBN 978-1-4503-XXXX-X/2018/06

https://doi.org/XXXXXXX.XXXXXXX

Li et al.

132 extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { // ... input validation ... 137 FuzzedDataProvider fdp(data, size); // ... mode selection and layer counts ... 157 unsigned int base_width = fdp.ConsumeIntegralInRange<unsigned int>(64, 1920); // ... other input values and encoder configuration ... 237 err = vpx_codec_enc_init_ver(&encoder, encoder_iface, &cfg, flags, VPX_ENCODER_ABI_VERSION); // ... initialization checks, layer controls, and image allocation ... 356 int num_frames = fdp.ConsumeIntegralInRange<int>(2, 8); // ... frame duration ... 359 for (int frame_num = 0; frame_num < num_frames; ++frame_num) { // ... layer updates and frame construction ... 404 err = vpx_codec_encode(&encoder, &img, frame_num * frame_duration, frame_duration, frame_flags, VPX_DL_REALTIME); // ... output retrieval and further controls ... 423 } // ... encoder flushing ... 429 vpx_img_free(&img); 430 vpx_codec_destroy(&encoder); 432 return 0; 433 }

Fig. 1. Generated libvpx harness, abbreviated from 433 lines. Line numbers refer to the original source.

achieving significant improvement over OSS-Fuzz [30]. For example, PromptFuzz [23] utilize LLMs to generate harnesses with fuzzing feedback, achieving 61% more code coverage than OSS-Fuzz [30].

To increase coverage, a harness may support several testing modes, construct complex inputs, and exercise varied API combinations [9, 23]. This can require substantial source code to complete. Figure 1 shows an abbreviated example of a libvpx harness from our evaluation benchmark, whose 433 source lines cover encoder configuration, layer controls, frame construction, and encoding. On the one hand, the source files for existing fuzzing harnesses are lengthy: libxml2's fuzz/api.c, FFmpeg's tools/target_dec_fuzzer.c, and JPEG XL's tools/djxl_fuzzer.cc contain 3614, 656, and 613 lines, respectively [5, 7, 12]. On the other hand, harnesses generated by LLMs share the similar complexity: the 200 harnesses generated by PromptFuzz, PromeFuzz and FuzzAgent has an average length of 273 lines, as shown in Table 1. Such complexity is not merely an edge case and can substantially complicate the understanding of crashes exposed by a harness.

When crashes are discovered during library fuzzing, developers must then determine whether the crash comes from a library defect or invalid API usage in the harness. This crash triage depends on understanding the relevant calls and arguments to locate the root cause. However, recognizing such root causes in a large harness can be difficult because the relevant call and its arguments appear among many other API operations. Manually identify the root cause is time-consuming as it requires numerous attempts of simplification in the program code and checks for crash preservation [27][27]. Program reduction addresses this problem by eliminating code that is irrelevant to the failure, thereby isolating the calls and values necessary to reproduce and explain the crash [41][41]. It automates simplification by repeatedly modifying a program and retaining changes that preserve the behavior being investigated, which largerly reduces the manual effort required to isolate the root cause.

Many program reduction techniques have been developed and evaluated using test cases that trigger compiler bugs. C-Reduce combines transformations specialized for C/C++ [27], while Perses uses language grammars to avoid syntactically invalid candidates [32]. Vulcan introduces additional

Efficient Program Reduction for Library Fuzzing Harnesses Conference acronym 'XX, June 03–05, 2018, Woodstock, NY

transformations to expose further simplifications after a reducer reaches a local minimum [39]. WDD uses fragment sizes to guide partitioning and deletion decisions, improving reduction efficiency [44]. Their shared focus is on the reduction algorithm itself, improving its efficiency and effectiveness through the design of program transformations and search strategies.

However, directly applying existing program-reduction techniques to harness minimization is prohibitively inefficient. These techniques are largely designed for self-contained failure-inducing programs, such as compiler test cases, where each reduction query primarily transforms and tests a standalone source file. In contrast, reducing a fuzz harness requires repeatedly integrating the modified harness with the target library and its runtime environment, incurring substantial costs from compilation, linking, execution, and crash symbolization, which cannot be ignored. We identify three challenges that existing reduction engines do not address, which make harness minimization expensive and ineffective. First, each query repeats costly build and execution preparation, even though the library headers, target library, and supporting runtimes remain unchanged. Second, input-consumption dependencies constrain source deletion: removing one consumption operation can change the values supplied to surviving library calls even with the same crash input, forcing the reducer to retain otherwise irrelevant code. Third, symbolized crash comparison adds diagnostic overhead to each crashing query, as instruction addresses must be translated into function names and source locations to compare the crash location and calling context with those of the original execution. We elaborate on these three challenges in section 2.

We present HarnessMinimizer, a system for efficient automatic reduction of C/C++ library fuzzing harnesses. Its key observation is that reduction changes the harness while the library build, headers, and reference crash remain fixed. Building on existing reduction engines, HarnessMinimizer addresses the three challenges through a shared candidate testing pipeline. It reuses header analysis through precompilation and library code and initialization through a persistent runner, supporting both dynamic and static linking. Call-site replay preserves the recorded input values supplied to surviving operations, allowing the reducer to remove unnecessary consumption calls. A lightweight crash oracle combines diagnostic patterns with stable shared-library offsets, or stack depth as a coarser fallback, to filter candidates without repeated symbolization. After reduction, HarnessMinimizer embeds the surviving input values into the source and validates the resulting reproducer, exposing the relevant API calls and concrete arguments for debugging.

We evaluate HarnessMinimizer with four reduction engines—treereduce [3], Perses [32], WDD [44], and CDD [43]—on 200 crash cases from 21 open source libraries, comprising 100 library bugs and 100 harness bugs. Compared with the unoptimized pipeline for each engine, HarnessMinimizer achieves 3.46−4.51×3.46-4.51\times speedups in mean total wall-clock time. The original harnesses contain 1,352 source tokens on average; after reduction, the mean remaining size is 143–263 tokens across the four engines. In LLM-based crash triage, minimized harnesses improve accuracy in identifying harness bugs from 28% to 44–51%, while accuracy for library bugs remains at 100%.

This paper makes three contributions:

• A method tailored to library harness minimization. We design HarnessMinimizer to reuse stable build and execution preparation, preserve consumed input values across source deletions, and recognize reference crashes without repeated symbolization, addressing the costs and dependencies of reducing C/C++ library fuzzing harnesses.

• Demonstrated efficiency and crash triage benefits. Our evaluation on 200 crash cases from 21 libraries shows 3.46−4.51×3.46-4.51\times speedups in mean total wall time and a decrease in mean harness size from 1,352 to 143–263 tokens. The minimized harnesses improve LLM accuracy in identifying harness bugs from 28% to 44–51%.

Li et al.

Figure

Verdict guides the next candidate

Fig. 2. Challenges in existing harness minimization. Testing candidates repeats header processing, linking, runtime initialization, and symbolization, while deleting input operations can change the arguments passed to the library.

• Integration with multiple reduction engines. We provide adapters for treereduce, Perses, WDD, and CDD through a shared interestingness-test interface, allowing different reduction strategies to benefit from the same optimized harness testing pipeline.

References (16)