Skip to content

Remove low-signal FileDataLoader allocation-failure tests#20469

Merged
meta-codesync[bot] merged 1 commit into
pytorch:mainfrom
metascroy:export-D109506462
Jun 24, 2026
Merged

Remove low-signal FileDataLoader allocation-failure tests#20469
meta-codesync[bot] merged 1 commit into
pytorch:mainfrom
metascroy:export-D109506462

Conversation

@metascroy

Copy link
Copy Markdown
Contributor

Summary:
D109072812 added two allocation-failure unit tests to
file_data_loader_test.cpp -- AllocationFailureDuringLoadReturnsError and
AllocationFailureDuringFromReturnsError -- driven by a strong global
replacement of operator new(size_t, std::align_val_t, const std::nothrow_t&)
that returns nullptr on demand.

That override broke the fbcode build (see T276843331): fbcode test binaries link
jemalloc, which provides its own strong definition of the same operator-new
symbol, so the second strong definition produces an ld.lld: error: duplicate symbol link failure (it likewise clashes with the ASAN allocator runtime). The
original diff only validated the xplat/Apple target, where libc++ provides the
operator-new family as weak symbols, so the breakage was not caught.

These tests are also low signal: they only exercise the pre-existing
nullptr -> Error::MemoryAllocationFailed guard, and because they replace the
allocator wholesale they never actually exercise the production fix from
D109072812 (switching et_aligned_alloc to the nothrow operator new).
Covering that trivial guard is not worth a permanent global-operator-new
override and its cross-platform build fragility.

This change removes both tests and the operator-new override, reverting only the
test-file additions from D109072812. The production fix from that diff -- using
the nothrow operator new in et_aligned_alloc -- is retained. Applied to both
the fbcode and xplat mirror copies of file_data_loader_test.cpp.

Differential Revision: D109506462

Summary:
D109072812 added two allocation-failure unit tests to
`file_data_loader_test.cpp` -- `AllocationFailureDuringLoadReturnsError` and
`AllocationFailureDuringFromReturnsError` -- driven by a strong global
replacement of `operator new(size_t, std::align_val_t, const std::nothrow_t&)`
that returns nullptr on demand.

That override broke the fbcode build (see T276843331): fbcode test binaries link
jemalloc, which provides its own strong definition of the same operator-new
symbol, so the second strong definition produces an `ld.lld: error: duplicate
symbol` link failure (it likewise clashes with the ASAN allocator runtime). The
original diff only validated the xplat/Apple target, where libc++ provides the
operator-new family as weak symbols, so the breakage was not caught.

These tests are also low signal: they only exercise the pre-existing
`nullptr -> Error::MemoryAllocationFailed` guard, and because they replace the
allocator wholesale they never actually exercise the production fix from
D109072812 (switching `et_aligned_alloc` to the nothrow `operator new`).
Covering that trivial guard is not worth a permanent global-operator-new
override and its cross-platform build fragility.

This change removes both tests and the operator-new override, reverting only the
test-file additions from D109072812. The production fix from that diff -- using
the nothrow `operator new` in `et_aligned_alloc` -- is retained. Applied to both
the fbcode and xplat mirror copies of `file_data_loader_test.cpp`.

Differential Revision: D109506462
@metascroy metascroy requested a review from JacobSzwejbka as a code owner June 24, 2026 00:05
@pytorch-bot

pytorch-bot Bot commented Jun 24, 2026

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/20469

Note: Links to docs will display an error until the docs builds have been completed.

❗ 1 Active SEVs

There are 1 currently active SEVs. If your PR is affected, please view them below:

❌ 3 New Failures, 3 Unrelated Failures

As of commit 4619249 with merge base aada6d7 (image):

NEW FAILURES - The following jobs have failed:

BROKEN TRUNK - The following jobs failed but were present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jun 24, 2026
@meta-codesync

meta-codesync Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

@metascroy has exported this pull request. If you are a Meta employee, you can view the originating Diff in D109506462.

@github-actions

Copy link
Copy Markdown

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

@meta-codesync meta-codesync Bot merged commit df975db into pytorch:main Jun 24, 2026
187 of 198 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants