-
-
Notifications
You must be signed in to change notification settings - Fork 815
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Binary releases of fd crash on Asahi Linux because of jemalloc using 8kb page sizes #1085
Comments
Regarding 1, Asahi/m1 isn't the only way to run linux on aarch64, so disabling jemalloc entirely for the build seems a little extreme. I don't know enough about this to know if there are downsides to 2. Another option is to build a separate artifact for linux aarch64 without jemalloc and recommend that if you are using asahi. |
I think we can configure jemalloc to support 64K pages. I don't have an easy way to test it though |
As I understand it, a jemalloc compiled to use 64K pages supports 8K, 16K, and 64K-aligned processors at runtime (all of which are possibilities on AArch64) . Moving the default page size to 64k (or 16k) is probably the best approach. It would keep jemalloc working in the default-compiled binaries. Increasing the compile-time default is the approach used to fix this problem in most projects:
Some projects (chromium, libunwind) switched to runtime detection. jemalloc upstream doesn't currently support that, so we can . Changing the compile-time default to 64k can be done by overriding the EDIT: I'm not sure how we would set this variable using Maybe we should fix the default upstream? |
We could just set |
I can confirm that setting It would be great to have the change implemented here so Asahi Linux and other affected
If that's all it would take to fix this, I would be willing to open a pull request. |
@montchr that would be great. |
Would this change be as small as setting a flag in the build step to change the page size? |
I was about to make a new issue here, but I think I'm seeing the same thing on a system I'm on? I'm not on Asahi Linux, but Rocky Linux:
This is on an NVIDIA Grace-Grace node which (I think) uses 64K pages per this documentation. (I have no idea how I'd check this locally...but I'm guessing the integrator used the recommended settings for the most part.) And when I grab the aarch64 binary and try it out:
I'd gladly do more checking or testing if asked...but page sizes and all are a bit beyond my ken. :) |
cross doesn't pass all environment variables through into the build container, so JEMALLOC_SYS_WITH_LG_PAGE=16 wasn't being picked up from the host. Instead, set it explicitly in Cross.toml. Link: https://github.com/cross-rs/cross/wiki/Configuration
cross doesn't pass all environment variables through into the build container, so JEMALLOC_SYS_WITH_LG_PAGE=16 wasn't being picked up from the host. Instead, set it explicitly in Cross.toml. Link: https://github.com/cross-rs/cross/wiki/Configuration
Binary releases crash because they don't support 16kb-aligned pages.
I get the following error with the latest binary releases (both from github releases, and the Arch Linux ARM repos):
Building from source fixes the issue (apparently jemalloc has internal logic to detect page size?)
M1 Macs use 16KB pages by default at a hardware level, so this is a common problem with Ashai Linux.
There are two simple fixes that occur to me:
The second one will probably have to be filled in the upstream jemallactor project (in fact that could be a more appropriate to file this issue....)
The text was updated successfully, but these errors were encountered: