From 03363f0145ab5e88a17a4b881068dc921f7d122f Mon Sep 17 00:00:00 2001 From: Juho Snellman Date: Thu, 1 Jun 2006 11:12:38 +0000 Subject: [PATCH] 0.9.13.18: Give a better diagnostic for the commo x86-64 "mprotect: Unable to allocate memory" error, as suggested by Max Mikhanosha on sbcl-devel. --- src/runtime/linux-os.c | 10 +++++++++- version.lisp-expr | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/runtime/linux-os.c b/src/runtime/linux-os.c index 345ff48..026923a 100644 --- a/src/runtime/linux-os.c +++ b/src/runtime/linux-os.c @@ -36,6 +36,7 @@ #include "genesis/fdefn.h" #include #include +#include #include #include @@ -284,7 +285,14 @@ void os_protect(os_vm_address_t address, os_vm_size_t length, os_vm_prot_t prot) { if (mprotect(address, length, prot) == -1) { - perror("mprotect"); + if (errno == ENOMEM) { + lose("An mprotect call failed with ENOMEM. This probably means that the maximum amount\n" + "of separate memory mappings was exceeded. To fix the problem, either increase\n" + "the maximum with e.g. 'echo 262144 > /proc/sys/vm/max_map_count' or recompile\n" + "SBCL with a larger value for GENCGC-PAGE-SIZE in 'src/target/parms.lisp'."); + } else { + perror("mprotect"); + } } } diff --git a/version.lisp-expr b/version.lisp-expr index cf0ff84..3a0bb87 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -17,4 +17,4 @@ ;;; checkins which aren't released. (And occasionally for internal ;;; versions, especially for internal versions off the main CVS ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"0.9.13.17" +"0.9.13.18" -- 1.7.10.4