Skip to content

[C++] Harden synthetic OOM tests for mimalloc#49282

Open
k8ika0s wants to merge 1 commit intoapache:mainfrom
k8ika0s:s390x-pr01-oom-tests
Open

[C++] Harden synthetic OOM tests for mimalloc#49282
k8ika0s wants to merge 1 commit intoapache:mainfrom
k8ika0s:s390x-pr01-oom-tests

Conversation

@k8ika0s
Copy link

@k8ika0s k8ika0s commented Feb 13, 2026

Closes #49280

Summary

This PR makes synthetic OOM unit tests allocator-stable when mimalloc is active.

It updates:

  • cpp/src/arrow/buffer_test.cc
  • cpp/src/arrow/memory_pool_test.h

Problem

These tests intentionally request extremely large allocations to force OutOfMemory.
Using near-max bounds can hit allocator-specific fatal behavior (especially with mimalloc)
before Arrow returns a normal OOM status, making tests environment-dependent.

What changed

  1. In ResizeOOM and TestOOM, detect mimalloc backend and GTEST_SKIP() synthetic OOM assertions.
  2. Clamp synthetic huge allocation upper bound to 1 << 48 (256 TB), which is still impossible in practice but avoids extreme allocator boundary paths.
  3. Keep existing alignment-overflow guard (-63) and ASSERT_RAISES(OutOfMemory, ...) logic for non-mimalloc backends.

Why this approach

  • Scope is intentionally minimal and test-only.
  • Preserves the goal of OOM-path coverage where behavior is reliable.
  • Removes allocator-fatal coupling from CI/unit-test expectations.

Risk / Compatibility

  • No runtime library behavior change.
  • No API/ABI impact.
  • Test behavior only.

@github-actions
Copy link

Thanks for opening a pull request!

If this is not a minor PR. Could you open an issue for this pull request on GitHub? https://github.com/apache/arrow/issues/new/choose

Opening GitHub issues ahead of time contributes to the Openness of the Apache Arrow project.

Then could you also rename the pull request title in the following format?

GH-${GITHUB_ISSUE_ID}: [${COMPONENT}] ${SUMMARY}

or

MINOR: [${COMPONENT}] ${SUMMARY}

See also:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[C++] Synthetic OOM tests are allocator-sensitive with mimalloc

1 participant