Skip to content

GH-49837: [C++][Parquet] Avoid unbounded temporary std::vector in DELTA_(LENGTH_)BYTE_ARRAY decoder#49838

Open
pitrou wants to merge 1 commit intoapache:mainfrom
pitrou:gh49837-delta-byte-array-std-vector
Open

GH-49837: [C++][Parquet] Avoid unbounded temporary std::vector in DELTA_(LENGTH_)BYTE_ARRAY decoder#49838
pitrou wants to merge 1 commit intoapache:mainfrom
pitrou:gh49837-delta-byte-array-std-vector

Conversation

@pitrou
Copy link
Copy Markdown
Member

@pitrou pitrou commented Apr 22, 2026

Rationale for this change

DeltaLengthByteArrayDecoder::DecodeArrow and DeltaByteArrayDecoder::DecodeArrow both allocate a temporary std::vector for the entire range of decoded values.
This generates out-of-memory failures in the Parquet encoding fuzzer as this unbounded allocation bypasses the custom fuzzing memory pool.

This issue was found by OSS-Fuzz: https://oss-fuzz.com/testcase-detail/6634166832922624

What changes are included in this PR?

Use the given MemoryPool to allocate a temporary buffer, so that potential memory limits are applied.

Are these changes tested?

Yes, using existing tests.

Are there any user-facing changes?

No.

@pitrou
Copy link
Copy Markdown
Member Author

pitrou commented Apr 22, 2026

@github-actions crossbow submit -g cpp

@github-actions
Copy link
Copy Markdown

Revision: 39fc02f

Submitted crossbow builds: ursacomputing/crossbow @ actions-2ca183efe9

Task Status
example-cpp-minimal-build-static GitHub Actions
example-cpp-minimal-build-static-system-dependency GitHub Actions
example-cpp-tutorial GitHub Actions
test-build-cpp-fuzz GitHub Actions
test-conda-cpp GitHub Actions
test-conda-cpp-valgrind GitHub Actions
test-debian-13-cpp-amd64 GitHub Actions
test-debian-13-cpp-i386 GitHub Actions
test-debian-experimental-cpp-gcc-15 GitHub Actions
test-fedora-42-cpp GitHub Actions
test-ubuntu-22.04-cpp GitHub Actions
test-ubuntu-22.04-cpp-20 GitHub Actions
test-ubuntu-22.04-cpp-bundled GitHub Actions
test-ubuntu-22.04-cpp-emscripten GitHub Actions
test-ubuntu-22.04-cpp-no-threading GitHub Actions
test-ubuntu-24.04-cpp GitHub Actions
test-ubuntu-24.04-cpp-bundled-offline GitHub Actions
test-ubuntu-24.04-cpp-gcc-13-bundled GitHub Actions
test-ubuntu-24.04-cpp-gcc-14 GitHub Actions
test-ubuntu-24.04-cpp-minimal-with-formats GitHub Actions
test-ubuntu-24.04-cpp-thread-sanitizer GitHub Actions

@pitrou pitrou force-pushed the gh49837-delta-byte-array-std-vector branch from 39fc02f to 14d3f53 Compare April 22, 2026 15:13
@pitrou
Copy link
Copy Markdown
Member Author

pitrou commented Apr 22, 2026

@github-actions crossbow submit -g cpp

@github-actions
Copy link
Copy Markdown

Revision: 14d3f53

Submitted crossbow builds: ursacomputing/crossbow @ actions-3c858e4ad0

Task Status
example-cpp-minimal-build-static GitHub Actions
example-cpp-minimal-build-static-system-dependency GitHub Actions
example-cpp-tutorial GitHub Actions
test-build-cpp-fuzz GitHub Actions
test-conda-cpp GitHub Actions
test-conda-cpp-valgrind GitHub Actions
test-debian-13-cpp-amd64 GitHub Actions
test-debian-13-cpp-i386 GitHub Actions
test-debian-experimental-cpp-gcc-15 GitHub Actions
test-fedora-42-cpp GitHub Actions
test-ubuntu-22.04-cpp GitHub Actions
test-ubuntu-22.04-cpp-20 GitHub Actions
test-ubuntu-22.04-cpp-bundled GitHub Actions
test-ubuntu-22.04-cpp-emscripten GitHub Actions
test-ubuntu-22.04-cpp-no-threading GitHub Actions
test-ubuntu-24.04-cpp GitHub Actions
test-ubuntu-24.04-cpp-bundled-offline GitHub Actions
test-ubuntu-24.04-cpp-gcc-13-bundled GitHub Actions
test-ubuntu-24.04-cpp-gcc-14 GitHub Actions
test-ubuntu-24.04-cpp-minimal-with-formats GitHub Actions
test-ubuntu-24.04-cpp-thread-sanitizer GitHub Actions

@pitrou pitrou marked this pull request as ready for review April 22, 2026 16:02
@pitrou pitrou requested a review from wgtmac as a code owner April 22, 2026 16:02
Comment on lines +96 to +98
#ifndef ARROW_ENABLE_THREADING
GTEST_SKIP() << "Test requires threading support";
#endif
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a quick fix for an unrelated CI regression.

@github-actions github-actions Bot added awaiting committer review Awaiting committer review and removed awaiting review Awaiting review labels Apr 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.

1 participant