common-lispsbcl

Sbcl memory allocation issue during compilation


Fairly new to common lisp. I'm trying to compile a program with (sb-ext:save-lisp-and-die "my-app.exe" :toplevel #'my-app:main)

I'm working on a 64-bit ubuntu 22.04.4 linux machine and compiling with SBCL 2.1.11.debian.

When trying to compile I keep getting the error message below. As far as I understand this means that sbcl requests a particiular memory mapping but my os maps it to a different location. It does create an exe file, but this is just an empty file of 0 bytes.

[undoing binding stack and other enclosing state... done]
mmap: wanted 53575680 bytes at 0x1000000000, actually mapped at 0x7c21bea00000
Dump of /proc/self/maps:
50000000-50100000 rwxp 00000000 00:00 0 
50100000-50108000 rwxp 00008000 08:03 10494419                           /usr/lib/sbcl/sbcl.core
50108000-50200000 rwxp 00000000 00:00 0 
50200000-50242000 rwxp 01840000 08:03 10494419                           /usr/lib/sbcl/sbcl.core
50242000-503c8000 rwxp 01882000 08:03 10494419                           /usr/lib/sbcl/sbcl.core
503c8000-52a00000 rwxp 00000000 00:00 0 
52a00000-53450000 rwxp 01a08000 08:03 10494419                           /usr/lib/sbcl/sbcl.core
53450000-5ac00000 rwxp 00000000 00:00 0 
1003318000-1040000000 rwxp 00000000 00:00 0 
589ef8d35000-589ef8d45000 r--p 00000000 08:03 10494116                   /usr/bin/sbcl
589ef8d45000-589ef8d79000 r-xp 00010000 08:03 10494116                   /usr/bin/sbcl
589ef8d79000-589ef8d87000 r--p 00044000 08:03 10494116                   /usr/bin/sbcl
589ef8d87000-589ef8d89000 r--p 00052000 08:03 10494116                   /usr/bin/sbcl
589ef8d89000-589ef8d8b000 rw-p 00054000 08:03 10494116                   /usr/bin/sbcl
589ef8d8b000-589ef8d92000 rw-p 00000000 00:00 0 
589ef9ea7000-589ef9f1a000 rw-p 00000000 00:00 0                          [heap]
7c21bea00000-7c21c1d18000 rwxp 00000000 00:00 0 
7c21c1d48000-7c21c1e00000 rw-p 00000000 00:00 0 
7c21c1e00000-7c21c1e08000 ---p 00000000 00:00 0 
7c21c1e08000-7c21c1e10000 r--p 00000000 00:00 0 
7c21c1e10000-7c21c20f0000 rwxp 00000000 00:00 0 
7c21c20f0000-7c21c2110000 ---p 00000000 00:00 0 
7c21c2110000-7c21c2251000 rwxp 00000000 00:00 0 
7c21c2302000-7c21c2352000 rw-p 00000000 00:00 0 
7c21c235d000-7c21c2400000 rw-p 00000000 00:00 0 
7c21c2400000-7c21c2428000 r--p 00000000 08:03 10487796                   /usr/lib/x86_64-linux-gnu/libc.so.6
7c21c2428000-7c21c25bd000 r-xp 00028000 08:03 10487796                   /usr/lib/x86_64-linux-gnu/libc.so.6
7c21c25bd000-7c21c2615000 r--p 001bd000 08:03 10487796                   /usr/lib/x86_64-linux-gnu/libc.so.6
7c21c2615000-7c21c2616000 ---p 00215000 08:03 10487796                   /usr/lib/x86_64-linux-gnu/libc.so.6
7c21c2616000-7c21c261a000 r--p 00215000 08:03 10487796                   /usr/lib/x86_64-linux-gnu/libc.so.6
7c21c261a000-7c21c261c000 rw-p 00219000 08:03 10487796                   /usr/lib/x86_64-linux-gnu/libc.so.6
7c21c261c000-7c21c2629000 rw-p 00000000 00:00 0 
7c21c2632000-7c21c263d000 rw-p 00000000 00:00 0 
7c21c2646000-7c21c2649000 rw-p 00000000 00:00 0 
7c21c2649000-7c21c2657000 r--p 00000000 08:03 10487802                   /usr/lib/x86_64-linux-gnu/libm.so.6
7c21c2657000-7c21c26d3000 r-xp 0000e000 08:03 10487802                   /usr/lib/x86_64-linux-gnu/libm.so.6
7c21c26d3000-7c21c272e000 r--p 0008a000 08:03 10487802                   /usr/lib/x86_64-linux-gnu/libm.so.6
7c21c272e000-7c21c272f000 r--p 000e4000 08:03 10487802                   /usr/lib/x86_64-linux-gnu/libm.so.6
7c21c272f000-7c21c2730000 rw-p 000e5000 08:03 10487802                   /usr/lib/x86_64-linux-gnu/libm.so.6
7c21c2730000-7c21c2732000 r--p 00000000 08:03 10485950                   /usr/lib/x86_64-linux-gnu/libz.so.1.2.11
7c21c2732000-7c21c2743000 r-xp 00002000 08:03 10485950                   /usr/lib/x86_64-linux-gnu/libz.so.1.2.11
7c21c2743000-7c21c2749000 r--p 00013000 08:03 10485950                   /usr/lib/x86_64-linux-gnu/libz.so.1.2.11
7c21c2749000-7c21c274a000 ---p 00019000 08:03 10485950                   /usr/lib/x86_64-linux-gnu/libz.so.1.2.11
7c21c274a000-7c21c274b000 r--p 00019000 08:03 10485950                   /usr/lib/x86_64-linux-gnu/libz.so.1.2.11
7c21c274b000-7c21c274c000 rw-p 0001a000 08:03 10485950                   /usr/lib/x86_64-linux-gnu/libz.so.1.2.11
7c21c274e000-7c21c2750000 rw-p 00000000 00:00 0 
7c21c2751000-7c21c275b000 rw-p 00000000 00:00 0 
7c21c275c000-7c21c275f000 rw-p 00000000 00:00 0 
7c21c275f000-7c21c2761000 r--p 00000000 08:03 10487183                   /usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2
7c21c2761000-7c21c278b000 r-xp 00002000 08:03 10487183                   /usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2
7c21c278b000-7c21c2796000 r--p 0002c000 08:03 10487183                   /usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2
7c21c2796000-7c21c2797000 ---p 00000000 00:00 0 
7c21c2797000-7c21c2799000 r--p 00037000 08:03 10487183                   /usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2
7c21c2799000-7c21c279b000 rw-p 00039000 08:03 10487183                   /usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2
7ffde58b0000-7ffde58d2000 rw-p 00000000 00:00 0                          [stack]
7ffde59a0000-7ffde59a4000 r--p 00000000 00:00 0                          [vvar]
7ffde59a4000-7ffde59a6000 r-xp 00000000 00:00 0                          [vdso]
ffffffffff600000-ffffffffff601000 --xp 00000000 00:00 0                  [vsyscall]
fatal error encountered in SBCL pid 24569 tid 24569:
remap_free_pages: page moved, 0x1000000000 ==> (nil)

I have no idea where to even start debugging / solving this. I have succesfully compiled before but as this is a while ago, I couldn't say exactly what changed. I tried making sure no other processes in the background were hogging memory whilst compiling. I also tried uninstalling and reinstalling sbcl, but this did not solve the problem.


Solution

  • Ok, this was solved by updating my sbcl version to 2.4.8