From: Christophe Rhodes Date: Mon, 11 Jul 2005 10:31:37 +0000 (+0000) Subject: 0.9.2.36: X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=9f409e8f8b0a0530725a13805f2b1b3c121ad46a;p=sbcl.git 0.9.2.36: Fix for memory fault error in foreign.test.sh ... we need to be able to have two different linkage-table entries for "address of data" and "instructions to jump to address" (DATAP=NIL/T) ... use a cons as the hash key rather than just the name ... (this area is not my speciality, so this fix may be suboptimal. Adjust as necessary) --- diff --git a/NEWS b/NEWS index 3d4329f..356018a 100644 --- a/NEWS +++ b/NEWS @@ -18,6 +18,8 @@ changes in sbcl-0.9.3 relative to sbcl-0.9.2: * optimizations: LOGNOR on fixnums is improved in the MIPS backend. (Thanks to Thiemo Seufer) * bug fix: nested reader invokations work correctly + * bug fix: it is possible to have simultaneous references to foreign + code and foreign data with the same name. * threads ** added x86-64 support ** incompatible change: the threading api now works with thread diff --git a/src/code/foreign.lisp b/src/code/foreign.lisp index 247d09a..86b9752 100644 --- a/src/code/foreign.lisp +++ b/src/code/foreign.lisp @@ -121,12 +121,12 @@ if the symbol isn't found." (when (<= sb!vm:linkage-table-space-start addr sb!vm:linkage-table-space-end) - (maphash (lambda (name info) + (maphash (lambda (name-and-datap info) (let ((table-addr (linkage-info-address info))) (when (<= table-addr addr (+ table-addr sb!vm:linkage-table-entry-size)) - (return-from sap-foreign-symbol name)))) + (return-from sap-foreign-symbol (car name-and-datap))))) *linkage-info*)) #!+os-provides-dladdr (with-alien ((info (struct dl-info diff --git a/src/code/linkage-table.lisp b/src/code/linkage-table.lisp index cb56720..aebb35b 100644 --- a/src/code/linkage-table.lisp +++ b/src/code/linkage-table.lisp @@ -55,7 +55,7 @@ (hash-table-count *linkage-info*) name)) (write-linkage-table-entry table-address real-address datap) - (setf (gethash name *linkage-info*) + (setf (gethash (cons name datap) *linkage-info*) (make-linkage-info :address table-address :datap datap)))) ;;; Add a foreign linkage entry if none exists, return the address @@ -63,7 +63,7 @@ (defun ensure-foreign-symbol-linkage (name datap) (/show0 "ensure-foreign-symbol-linkage") (sb!thread:with-mutex (*foreign-lock*) - (let ((info (or (gethash name *linkage-info*) + (let ((info (or (gethash (cons name datap) *linkage-info*) (link-foreign-symbol name datap)))) (linkage-info-address info)))) @@ -71,9 +71,10 @@ ;;; shared libraries have been reopened, and after a previously loaded ;;; shared object is reloaded. (defun update-linkage-table () - ;; Doesn't take care of it's own locking -- callers are responsible - (maphash (lambda (name info) - (let* ((datap (linkage-info-datap info)) + ;; Doesn't take care of its own locking -- callers are responsible + (maphash (lambda (name-and-datap info) + (let* ((name (car name-and-datap)) + (datap (cdr name-and-datap)) (table-address (linkage-info-address info)) (real-address (ensure-dynamic-foreign-symbol-address name datap))) diff --git a/tests/foreign.test.sh b/tests/foreign.test.sh index b5176bd..edc251e 100644 --- a/tests/foreign.test.sh +++ b/tests/foreign.test.sh @@ -217,7 +217,7 @@ fi echo missing ok -rm $testfilestem.* +rm -f $testfilestem.* $testfilestem-* # success convention for script exit 104 diff --git a/version.lisp-expr b/version.lisp-expr index 170c71e..010c98d 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.2.35" +"0.9.2.36"