This may happen e.g. if PaX MPROTECT feature is enabled.
* os_dep.c [!OS2 && !PCR && !AMIGA && !USE_WINALLOC && !MACOS
&& !DOS4GW && !NONSTOP && !SN_TARGET_PSP2 && !RTEMS && !__CC_ARM
&& MMAP_SUPPORTED] (GC_unix_mmap_get_mem): Treat result==MAP_FAILED as
unlikely; if the first mmap call returns MAP_FAILED then ABORT with the
appropriate message if GC_pages_executable (and errno is EACCES).
GC_MMAP_FLAGS | OPT_MAP_ANON, zero_fd, 0/* offset */);
# undef IGNORE_PAGES_EXECUTABLE
- if (result == MAP_FAILED) return(0);
+ if (EXPECT(MAP_FAILED == result, FALSE)) {
+ if (HEAP_START == last_addr && GC_pages_executable && EACCES == errno)
+ ABORT("Cannot allocate executable pages");
+ return NULL;
+ }
last_addr = (ptr_t)(((word)result + bytes + GC_page_size - 1)
& ~(GC_page_size - 1));
# if !defined(LINUX)