Summary
The fuzz harness tests/fuzz/wasm-mutator-fuzz/wasm-mutator/wasm_mutator_fuzz.cc includes two internal headers that are not needed:
wasm_runtime_common.h (core/iwasm/common/) — internal runtime implementation header
bh_read_file.h (core/shared/utils/uncommon/) — internal utility header whose functions are never called in this fuzzer
All runtime APIs actually used by the harness (wasm_runtime_init, wasm_runtime_load, wasm_runtime_instantiate, wasm_runtime_call_wasm_a, wasm_runtime_get_export_count, wasm_runtime_get_export_type, wasm_func_type_get_param_count, wasm_func_type_get_param_valkind, etc.) are declared in the public wasm_export.h header.
Verification
Built and tested a fixed version (only including wasm_export.h) in OSS-Fuzz for all three build targets (classic-interp, fast-interp, llvm-jit):
- Build: compiles successfully for all 3 targets
- Coverage: identical across all metrics (regions 3.91%, functions 5.65%, lines 4.19%, branches 3.33%)
Suggested Fix
Replace:
#include "wasm_runtime_common.h"
#include "wasm_export.h"
#include "bh_read_file.h"
With:
Fix PR: #4865
Summary
The fuzz harness
tests/fuzz/wasm-mutator-fuzz/wasm-mutator/wasm_mutator_fuzz.ccincludes two internal headers that are not needed:wasm_runtime_common.h(core/iwasm/common/) — internal runtime implementation headerbh_read_file.h(core/shared/utils/uncommon/) — internal utility header whose functions are never called in this fuzzerAll runtime APIs actually used by the harness (
wasm_runtime_init,wasm_runtime_load,wasm_runtime_instantiate,wasm_runtime_call_wasm_a,wasm_runtime_get_export_count,wasm_runtime_get_export_type,wasm_func_type_get_param_count,wasm_func_type_get_param_valkind, etc.) are declared in the publicwasm_export.hheader.Verification
Built and tested a fixed version (only including
wasm_export.h) in OSS-Fuzz for all three build targets (classic-interp, fast-interp, llvm-jit):Suggested Fix
Replace:
With:
Fix PR: #4865