[YAP 6.2.2][Prolog] "mmap" error during compilation on Ubuntu 20.04


I have a problem with compiling YAP Prolog 6.2.2 on Ubuntu 20.04. As usual, following the README, I browse into the YAP folder and give the command ./configure which is successful. Next, I give the command make but it gives me this error:

% YAP OOOPS: mmap could not map at 0x10000000, got 0xffffffffffffffff.

   Exiting ....
make: *** [Makefile:534: startup.yss] Error 1

I have already installed the libraries suggested in the README file (gmp and readline), but I can't figure out what the problem is. This same procedure works perfectly on Ubuntu 18.04LTS and Ubuntu 19.10.


1 Answer


I ran into the same problem today and decided to debug the problem. I found the cause of this problem and a hackish fix. Unfortunately the build fails later with a related problem that I have not managed to figure out.

The issue is that attempts to use /dev/zero to map executable memory using mmap. In Ubuntu 20.04 /dev is mounted with the noexec flag however. I patched the code to use anonymous memory instead, but as I said above it then just fails (by hanging) at a later point during the build. The hung process is attempting to allocate more memory repeatedly via mmap, but this is failing with ENOMEM.

If I find a proper solution I will upload a patch for all these issues somewhere and link it here.

answered on Stack Overflow Jan 20, 2021 by Vorpal

User contributions licensed under CC BY-SA 3.0