From 68b13d8fac5207d339de227871818203f4cab0ab Mon Sep 17 00:00:00 2001 From: William Harold Newman Date: Sun, 27 May 2001 15:20:15 +0000 Subject: [PATCH] 0.6.12.17: revised address map for OpenBSD (fixing memory corruption problem) --- src/compiler/x86/backend-parms.lisp | 6 +++++- src/compiler/x86/parms.lisp | 33 +++++++++++++++++++++++++-------- src/runtime/bsd-os.c | 4 ++++ version.lisp-expr | 2 +- 4 files changed, 35 insertions(+), 10 deletions(-) diff --git a/src/compiler/x86/backend-parms.lisp b/src/compiler/x86/backend-parms.lisp index a45206f..057a09c 100644 --- a/src/compiler/x86/backend-parms.lisp +++ b/src/compiler/x86/backend-parms.lisp @@ -37,8 +37,12 @@ ;;; 9 = deleted obsolete CONS-UNIQUE-TAG bytecode in sbcl-0.6.11.8 ;;; (somewhere in here also changes to AND and OR CTYPE layouts) ;;; 10 = new layout for CONDITION in sbcl-0.6.11.38 -;;; 11 = new helper functions for MAKE-LOAD-FORM (HASH-TABLE) in +;;; 11 = (a) new helper functions for MAKE-LOAD-FORM (HASH-TABLE) in ;;; sbcl-0.6.12.11 +;;; (b) new address space constants for OpenBSD in 0.6.12.17, +;;; doesn't need separate version from (a) because the OpenBSD +;;; port was broken from sometime before 0.6.12.11 until +;;; the address space was changed (setf *backend-register-save-penalty* 3) diff --git a/src/compiler/x86/parms.lisp b/src/compiler/x86/parms.lisp index e342bf8..8bbe40c 100644 --- a/src/compiler/x86/parms.lisp +++ b/src/compiler/x86/parms.lisp @@ -116,13 +116,25 @@ ;;; * On FreeBSD, ;;; ** The space 0x0E000000-0x10000000 is "Foreign segment". ;;; ** The space 0x20000000-0x30000000 is reserved for shared libs. -;;; And there have been a few changes since the fork: +;;; And there have been some changes since the fork from CMU CL: +;;; * The OpenBSD port is new since the fork. We started with +;;; the FreeBSD address map, which actually worked until the +;;; Alpha port patches, for reasons which in retrospect are rather +;;; mysterious. After the Alpha port patches were added, the +;;; OpenBSD port suffered memory corruption problems. While +;;; debugging those, it was discovered that src/runtime/trymap +;;; failed for the control stack region #x40000000-#x47fff000. +;;; After the control stack was moved upward out of this region +;;; (stealing some bytes from dynamic space) the problems went +;;; away. ;;; * The FreeBSD STATIC-SPACE-START value was bumped up from ;;; #x28000000 to #x30000000 when FreeBSD ld.so dynamic linking ;;; support was added for FreeBSD ca. 20000910. This was to keep from -;;; stomping on an address range that the dynamic libraries want to use. -;;; (They want to use this address range even if we try to reserve it -;;; with a call to validate() as the first operation in main().) +;;; stomping on an address range that the dynamic libraries want to +;;; use. (They want to use this address range even if we try to +;;; reserve it with a call to validate() as the first operation in +;;; main().) + #!+linux (progn @@ -155,10 +167,15 @@ (defconstant binding-stack-start #x38000000) (defconstant binding-stack-end #x3ffff000) - (defconstant control-stack-start #x40000000) - (defconstant control-stack-end #x47fff000) - - (defconstant dynamic-space-start #x48000000) + (defconstant control-stack-start + #+freebsd #x40000000 + #+openbsd #x48000000) + (defconstant control-stack-end + #+freebsd #x47fff000 + #+openbsd #x4ffff000) + (defconstant dynamic-space-start + #+freebsd #x48000000 + #+openbsd #x50000000) (defconstant dynamic-space-end #x88000000)) ;;; Given that NIL is the first thing allocated in static space, we diff --git a/src/runtime/bsd-os.c b/src/runtime/bsd-os.c index 4660240..eaf6e10 100644 --- a/src/runtime/bsd-os.c +++ b/src/runtime/bsd-os.c @@ -164,6 +164,10 @@ os_map(int fd, int offset, os_vm_address_t addr, os_vm_size_t len) return addr; } +/* FIXME: If this can be a no-op on BSD/x86, then it + * deserves a more precise name. + * + * (Perhaps os_prepare_data_area_to_be_executed()?) */ void os_flush_icache(os_vm_address_t address, os_vm_size_t length) { diff --git a/version.lisp-expr b/version.lisp-expr index aba2d4f..b6f75fb 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -15,4 +15,4 @@ ;;; versions, and a string like "0.6.5.12" is used for versions which ;;; aren't released but correspond only to CVS tags or snapshots. -"0.6.12.16" +"0.6.12.17" -- 1.7.10.4