Skip to content

GH-54903: [C++][OSS-Fuzz fuzzing] Add new fuzzer targets arrow compute process - #54904

Open
arthurscchan wants to merge 1 commit into
apache:mainfrom
arthurscchan:fuzz/compute-fuzz-target
Open

arthurscchan wants to merge 1 commit into
apache:mainfrom
arthurscchan:fuzz/compute-fuzz-target

Conversation

@arthurscchan

@arthurscchan arthurscchan commented Oct 21, 2026 •

Copy link
Copy Markdown

Rationale for this change

This PR creates a new OSS-Fuzz fuzzer with corpora and dictionary targets for the Arrow compute function layer. The compute kernels (arithmetic, vector and aggregate functions) currently have no dedicated fuzz target, so their behaviour on unusual but valid inputs is only exercised indirectly. This is the 2nd PR aiming to improve the overall fuzzing coverage and effectiveness of the arrow project, mentioned in #54903.

This change is coordinated with the OSS-Fuzz side in google/oss-fuzz#16330.

What changes are included in this PR?

  • cpp/src/arrow/compute/fuzz.cc (new): the fuzz target. Each input is parsed as an Arrow IPC stream, and each decoded record batch is validated. A small 8-byte packed header (marker byte) selects which compute function to evaluate on the decoded batches — unary scalar functions (abs, negate, floor, ceil, sqrt), vector functions (unique, value_counts, dictionary_encode), aggregate functions (sum, mean, min_max, approximate_median, count) and binary scalar functions (add, subtract, multiply, divide, power, max, min) — together with an argument mode (first column only, column plus scalar, or two columns). Kernels are allowed to reject inputs with a non-OK status; crashes and memory errors are the interesting findings. Inputs without the marker byte are treated as plain IPC streams and only validated, which keeps the existing IPC corpus useful and continues to fuzz the IPC reader itself.
  • cpp/src/arrow/compute/CMakeLists.txt: registers the fuzz target and the corpus generator executable.
  • cpp/src/arrow/compute/generate_fuzz_corpus.cc (new): generates seed corpus files - small valid IPC streams (int64/float64 batches with nulls and negatives, UTF-8 string batches including empty and non-ASCII values, small int batches), each prefixed with the fuzz header so the seeds reach the kernels directly.
  • cpp/build-support/fuzzing/generate_corpuses.sh: adds the compute corpus section.
  • cpp/build-support/fuzzing/dicts/arrow-compute-fuzz.dict (new): dictionary of Arrow IPC stream framing tokens (stream magic and common flatbuffer scaffolding) to help the fuzzing engine construct well-formed IPC streams that reach the kernels.

Are these changes tested?

Yes on OSS-Fuzz side.

Are there any user-facing changes?

No.

Was AI used for this PR?

In accordance to the AI generation guidelines, please disclose below whether and how AI was used in this PR.

PR code and description written by:

  • Human
  • AI

Reviewed before submission by:

  • Human
  • AI
  • Not reviewed

Code and description were drafted with the help of an AI coding agent, then reviewed, revised and validated by the author before submission.

Signed-off-by: Arthur Chan <arthur.chan@adalogics.com>
@arthurscchan arthurscchan changed the title GH-54903: [OSS-Fuzz fuzzing] Add new fuzzer targets arrow compute process GH-54903: [C++][OSS-Fuzz fuzzing] Add new fuzzer targets arrow compute process Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants