Skip to content
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

Tests fail on aarch64 with "Cannot allocate memory" #44

Open
jpalus opened this issue Nov 20, 2022 · 2 comments
Open

Tests fail on aarch64 with "Cannot allocate memory" #44

jpalus opened this issue Nov 20, 2022 · 2 comments

Comments

@jpalus
Copy link

jpalus commented Nov 20, 2022

Nearly all of criterion tests fail on aarch64 with:

criterion: Could not initialize inheritable arena: Cannot allocate memory

That's because BoxFort assumes minimal address space for 64-bit hosts of 48-bit:

BoxFort/src/arena.c

Lines 56 to 61 in a26074c

#elif BXF_BITS == 64
/* On Linux it seems that you cannot map > 48-bit addresses */
static void *mmap_base = (void *) 0x200000000000;
static void *mmap_max = (void *) 0x7f0000000000;
static intptr_t mmap_off = (intptr_t) 1 << 24;
static intptr_t mmap_off_mask = 0x3fffff;

While on aarch64 it is possible to to have 39-bit address space see https://www.kernel.org/doc/Documentation/arm64/memory.rst

@Sakura286
Copy link
Contributor

Similar on riscv64. context.c test failed due to invalid memory address allocation of mmap in arena.c.

39 bit address space sv39 are widely used on riscv64 too.
https://docs.kernel.org/riscv/vm-layout.html

@Sakura286
Copy link
Contributor

@jpalus I am trying to fix this. Could you find the way to know which memory-layout is used, such as cat /proc/cpuinfo? I haven't got an AArch64 machine.

Sakura286 added a commit to Sakura286/BoxFort that referenced this issue Aug 11, 2023
Fixed 'context.c' test failure on riscv64. See issue Snaipe#44.

Only riscv64 arch is affected in this commit, but you can modify
memory_addr_bits variable to support other memory schemes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants