Skip to content

Conversation

cyb70289
Copy link
Contributor

@cyb70289 cyb70289 commented Oct 9, 2025

Rationale for this change

Mimalloc default generates LSE atomic instructions only work on armv8.1. This causes illegal instruction on armv8.0 platforms like Raspberry4. This PR sets mimalloc build flag -DMI_NO_OPT_ARCH=ON to disable LSE instruction.
Please note even with flag set, compiler and libc will replace the atmoic call with an ifunc that matches hardware best at runtime. That means LSE is used only if the running platform supports it.

What changes are included in this PR?

Force mimalloc build flag -DMI_NO_OPT_ARCH=ON.

Are these changes tested?

Manually tested.

Are there any user-facing changes?

No.

This PR contains a "Critical Fix".
Fixes crashes on Armv8.0 platform.

Copy link

github-actions bot commented Oct 9, 2025

⚠️ GitHub issue #47229 has been automatically assigned in GitHub to PR creator.

@pitrou
Copy link
Member

pitrou commented Oct 9, 2025

Can you check if this patch is still necessary if we apply #47589 ?

@github-actions github-actions bot added awaiting committer review Awaiting committer review and removed awaiting review Awaiting review labels Oct 9, 2025
@cyb70289
Copy link
Contributor Author

cyb70289 commented Oct 9, 2025

Can you check if this patch is still necessary if we apply #47589 ?

Looks necessary for mimalloc 3.1.5. The default setting is still armv8.1-a unless this option is set.
https://github.com/microsoft/mimalloc/blob/v3.1.5/CMakeLists.txt#L153

…ble binary

Mimalloc default generates LSE atomic instructions only work on armv8.1.
This causes illegal instruction on armv8.0 platforms like Raspberry4.
This PR sets mimalloc build flag -DMI_NO_OPT_ARCH=ON to disable LSE
instruction.
Please note even with flag set, compiler and libc will replace the
atmoic call with an ifunc that matches hardware best at runtime. That
means LSE is used only if the running platform supports it.
@pitrou
Copy link
Member

pitrou commented Oct 9, 2025

@github-actions crossbow submit -g cpp

@pitrou
Copy link
Member

pitrou commented Oct 9, 2025

@github-actions crossbow submit wheelcp313*

Copy link

github-actions bot commented Oct 9, 2025

Revision: ff8e8c3

Submitted crossbow builds: ursacomputing/crossbow @ actions-7e9ea384fd

Task Status
wheel-macos-monterey-cp313-cp313-amd64 GitHub Actions
wheel-macos-monterey-cp313-cp313-arm64 GitHub Actions
wheel-macos-monterey-cp313-cp313t-amd64 GitHub Actions
wheel-macos-monterey-cp313-cp313t-arm64 GitHub Actions
wheel-manylinux-2-28-cp313-cp313-amd64 GitHub Actions
wheel-manylinux-2-28-cp313-cp313-arm64 GitHub Actions
wheel-manylinux-2-28-cp313-cp313t-amd64 GitHub Actions
wheel-manylinux-2-28-cp313-cp313t-arm64 GitHub Actions
wheel-musllinux-1-2-cp313-cp313-amd64 GitHub Actions
wheel-musllinux-1-2-cp313-cp313-arm64 GitHub Actions
wheel-musllinux-1-2-cp313-cp313t-amd64 GitHub Actions
wheel-musllinux-1-2-cp313-cp313t-arm64 GitHub Actions
wheel-windows-cp313-cp313-amd64 GitHub Actions
wheel-windows-cp313-cp313t-amd64 GitHub Actions

Copy link

github-actions bot commented Oct 9, 2025

Revision: ff8e8c3

Submitted crossbow builds: ursacomputing/crossbow @ actions-a989831826

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-cuda-cpp-ubuntu-22.04-cuda-11.7.1 GitHub Actions
test-debian-12-cpp-amd64 GitHub Actions
test-debian-12-cpp-i386 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 added the CI: Extra: C++ Run extra C++ CI label Oct 9, 2025
Copy link
Member

@kou kou left a comment

Choose a reason for hiding this comment

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

+1

@github-actions github-actions bot added awaiting merge Awaiting merge and removed awaiting committer review Awaiting committer review labels Oct 9, 2025
@pitrou pitrou merged commit 8496d4e into apache:main Oct 9, 2025
48 checks passed
@pitrou pitrou removed the awaiting merge Awaiting merge label Oct 9, 2025
raulcd pushed a commit that referenced this pull request Oct 9, 2025
### Rationale for this change
Mimalloc default generates LSE atomic instructions only work on armv8.1. This causes illegal instruction on armv8.0 platforms like Raspberry4. This PR sets mimalloc build flag -DMI_NO_OPT_ARCH=ON to disable LSE instruction.
Please note even with flag set, compiler and libc will replace the atmoic call with an ifunc that matches hardware best at runtime. That means LSE is used only if the running platform supports it.

### What changes are included in this PR?
Force mimalloc build flag -DMI_NO_OPT_ARCH=ON.

### Are these changes tested?
Manually tested.

### Are there any user-facing changes?
No.

**This PR contains a "Critical Fix".**
Fixes crashes on Armv8.0 platform.
* GitHub Issue: #47229

Lead-authored-by: Yibo Cai <[email protected]>
Co-authored-by: Antoine Pitrou <[email protected]>
Signed-off-by: Antoine Pitrou <[email protected]>
Copy link

After merging your PR, Conbench analyzed the 3 benchmarking runs that have been run so far on merge-commit 8496d4e.

There were no benchmark performance regressions. 🎉

The full Conbench report has more details.

zanmato1984 pushed a commit to zanmato1984/arrow that referenced this pull request Oct 15, 2025
…pache#47766)

### Rationale for this change
Mimalloc default generates LSE atomic instructions only work on armv8.1. This causes illegal instruction on armv8.0 platforms like Raspberry4. This PR sets mimalloc build flag -DMI_NO_OPT_ARCH=ON to disable LSE instruction.
Please note even with flag set, compiler and libc will replace the atmoic call with an ifunc that matches hardware best at runtime. That means LSE is used only if the running platform supports it.

### What changes are included in this PR?
Force mimalloc build flag -DMI_NO_OPT_ARCH=ON.

### Are these changes tested?
Manually tested.

### Are there any user-facing changes?
No.

**This PR contains a "Critical Fix".**
Fixes crashes on Armv8.0 platform.
* GitHub Issue: apache#47229

Lead-authored-by: Yibo Cai <[email protected]>
Co-authored-by: Antoine Pitrou <[email protected]>
Signed-off-by: Antoine Pitrou <[email protected]>
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.

3 participants