Skip to content

Fix intermittent bus errors in portable pocketfft op on macOS#17378

Open
metascroy wants to merge 2 commits intomainfrom
metascroy-patch-7
Open

Fix intermittent bus errors in portable pocketfft op on macOS#17378
metascroy wants to merge 2 commits intomainfrom
metascroy-patch-7

Conversation

@metascroy
Copy link
Contributor

@metascroy metascroy commented Feb 11, 2026

This PR applies pocketfft patch for ASAN-compatible aligned_alloc on POSIX systems. The portable aligned_alloc in pocketfft stores metadata at ptr[-1], which conflicts with ASAN's heap redzone and causes intermittent bus errors. This patch uses posix_memalign instead, which is ASAN-compatible.

@pytorch-bot
Copy link

pytorch-bot bot commented Feb 11, 2026

🔗 Helpful Links

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

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

❌ 2 New Failures, 1 Unrelated Failure

As of commit 84e941d with merge base 2a12f1f (image):

NEW FAILURES - The following jobs have failed:

BROKEN TRUNK - The following job 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 Feb 11, 2026
@github-actions
Copy link

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.

@metascroy metascroy changed the title Fix intermittent bus errors in portable pocketfft op Fix intermittent bus errors in portable pocketfft op on macOS Feb 11, 2026
# portable aligned_alloc in pocketfft stores metadata at ptr[-1], which
# conflicts with ASAN's heap redzone and causes intermittent bus errors. This
# patch uses posix_memalign instead, which is ASAN-compatible.
set(POCKETFFT_DIR "${EXECUTORCH_ROOT}/third-party/pocketfft")
Copy link
Contributor

Choose a reason for hiding this comment

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

should we land this upstream instead of having this patch, changing code on the fly?
cc @mergennachin

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, let's try upstreaming to https://github.com/mreineck/pocketfft

Copy link
Contributor Author

@metascroy metascroy Feb 24, 2026

Choose a reason for hiding this comment

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

I've put up a PR here: mreineck/pocketfft#28, but should it not land in pocketfft for some reason, should we not patch in ET given we're distributing the buggy software?

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants