-
Notifications
You must be signed in to change notification settings - Fork 491
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
Is it possible to detect kAddressBits
at runtime?
#82
Comments
It would be possible to make Other than reading |
maybe the following does help: openjdk/jdk#40 I think this is how the folks ad openjdk are handling it by trial and error. |
+1 after struggling with a mysterious SIGABRT for a whole day and finally finding this issue. As a low-level library, tcmalloc may be depended by projects whose developers even don't know its existence. If detect the correct value of |
As checking for the kernel build config in |
kAddressBits may be too large when CONFIG_PGTABLE_LEVELS=3 (#82). PiperOrigin-RevId: 511575218 Change-Id: I5001342968266b73fcbfdd7b65884cda3488dde7
Code that detects the address space size.. https://github.com/ptitSeb/box64/blob/e42001b2bc030f93bdba582bf12d6eac63fae345/src/custommem.c#L1444 |
As noted in #33 page tables on Aarch64 can have either 3 or 4 levels. tcmalloc assumes 4 levels for Aarch64 (kAddressBits = 48), but for example RaspberryOS for Aarch64 runs on a kernel with
CONFIG_PGTABLE_LEVELS=3
. As result all programs using tcmalloc fail without patching it to set kAddressBits = 39.Is it possible to detect
kAddressBits
at runtime?The text was updated successfully, but these errors were encountered: