I'm seeing this when running a Unity3D game (Anima: Gate of Memories) under strace, and this is a crash that only started a couple of weeks ago.
mmap(NULL, 4096, PROT_READ, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f54c437f000
mmap(NULL, 4096, PROT_READ, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f54c437e000
mprotect(0x7f54c437e000, 4096, PROT_NONE) = 0
mmap(NULL, 65536, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS|MAP_32BIT, -1, 0) = -1 ENOMEM (Cannot allocate memory)
openat(AT_FDCWD, "/dev/zero", O_RDONLY) = 4
mmap(NULL, 65536, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS|MAP_32BIT, 4, 0) = -1 ENOMEM (Cannot allocate memory)
close(4) = 0
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x5} ---
There's a regression reported on the LKML "mmap with MAP_32BIT randomly fails since 6.1", which had fixes in Debian's linux-image-6.1.0-9-amd64 (based on Linux 6.1.27). I'm running linux-image-6.1.0-9-amd64, and wondering if the fix added new regressions. Planning to test next time it's a good time to reboot.
Edit: I downgraded, and can't reproduce when using 6.1.0-8-amd64 (based on 6.1.25).
Debian already has a fix that'll be in the first point release of Bookworm, but so far they only knew of "a handful of edge-cases", which only affected developers, not the general use case of games.
https://bugs.debian.org/1036755