Skip to content

fuzz: wasm_mutator_fuzz includes unnecessary internal headers #4866

@OwenSanzas

Description

@OwenSanzas

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:

#include "wasm_export.h"

Fix PR: #4865

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions