Closed SchrodingerZhu closed 1 week ago
strace can show similar like the following
mprotect(0xffaf10631000, 274877911040, PROT_READ) = -1 EINVAL (Invalid argument)
madvise(0xffaf10631000, 274877911040, MADV_DONTDUMP) = -1 EINVAL (Invalid argument)
mprotect(0xffaf10631000, 4096, PROT_READ|PROT_WRITE) = -1 EINVAL (Invalid argument)
madvise(0xffaf10631000, 4096, MADV_DODUMP) = -1 EINVAL (Invalid argument)
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_ACCERR, si_addr=0xffaf10631dc0} ---
+++ killed by SIGSEGV (core dumped) +++
Asahi Linux utilizes 16k aligned pages.
Looks like we need some more #ifdef
in:
https://github.com/microsoft/snmalloc/blob/835ab5186325736ff5aa8ef53728970d1d74c3bc/src/snmalloc/pal/pal_linux.h#L32-L33
How could we detect this configuration? Perhaps, we should be using
sys_conf(_SC_PAGE_SIZE)
to detect the pagesize properly.
It seems this can be done by macros. https://www.man7.org/linux/man-pages/man3/sysconf.3.html
We could change the Posix Pal to:
#ifdef PAGESIZE
static constexpr size_t page_size = PAGESIZE;
#else
static constexpr size_t page_size = Aal::smallest_page_size;
#endif
FYI, I have a bit set of changes in flight, so can fix after those. Or please feel free to raise a PR.
Tried this in #664.
@SchrodingerZhu with the CMake configuration is this fixed? Should we do more to fix this?