From 65aa68a4f6a671db80596f136dec549322b28ddd Mon Sep 17 00:00:00 2001 From: Alastair Bridgewater Date: Wed, 30 Nov 2011 11:41:55 -0500 Subject: [PATCH] Improved undefined-function backtrace on non-x86oids. * Instead of "bogus stack frame", present undefined function frames as "undefined function". * Implement this by checking specifically for the undefined function trampoline function object (which otherwise fails pointer validation) in MAKE-LISP-OBJ, and allowing the existing logic to do what it was always supposed to do. * Tested on PPC only, but should work on the other affected targets. --- NEWS | 2 ++ src/code/debug-int.lisp | 9 +++++++++ tests/debug.impure.lisp | 8 +------- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/NEWS b/NEWS index 8156f78..7e22e95 100644 --- a/NEWS +++ b/NEWS @@ -53,6 +53,8 @@ changes relative to sbcl-1.0.54: * bug fix: non-toplevel DEFSTRUCT signaled a style warning for unknown type. * bug fix: redefining a function whose previous definition contained an unknown type no longer causes a style-warning. (lp#806243) + * bug fix: undefined functions now appear in backtraces as ("undefined + function") instead of ("bogus stack frame") on non-x86oids. changes in sbcl-1.0.54 relative to sbcl-1.0.53: * minor incompatible changes: diff --git a/src/code/debug-int.lisp b/src/code/debug-int.lisp index 592c75f..df06188 100644 --- a/src/code/debug-int.lisp +++ b/src/code/debug-int.lisp @@ -2005,6 +2005,15 @@ register." (= (logand val #xff) sb!vm:character-widetag)) ; char tag ;; unbound marker (= val sb!vm:unbound-marker-widetag) + ;; undefined_tramp doesn't validate properly as a pointer, and + ;; the actual value can vary by backend (x86oids need not + ;; apply) + #!+(or alpha hppa mips ppc) + (= val (+ (- (foreign-symbol-address "undefined_tramp") + (* sb!vm:n-word-bytes sb!vm:simple-fun-code-offset)) + sb!vm:fun-pointer-lowtag)) + #!+sparc + (= val (foreign-symbol-address "undefined_tramp")) ;; pointer (not (zerop (valid-lisp-pointer-p (int-sap val))))) (values (%make-lisp-obj val) t) diff --git a/tests/debug.impure.lisp b/tests/debug.impure.lisp index b72317b..08bbca3 100644 --- a/tests/debug.impure.lisp +++ b/tests/debug.impure.lisp @@ -160,13 +160,7 @@ ;; bug 353: This test fails at least most of the time for x86/linux ;; ca. 0.8.20.16. -- WHN - (with-test (:name (:undefined-function :bug-353) - ;; This used to have fewer :fails-on features pre-0.9.16.38, - ;; but it turns out that the bug was just being masked by - ;; the presence of the IR1 stepper instrumentation (and - ;; is thus again failing now that the instrumentation is - ;; no more). - :fails-on '(or :alpha :mips :ppc)) + (with-test (:name (:undefined-function :bug-353)) (assert (verify-backtrace (lambda () (test #'not-optimized)) (list *undefined-function-frame* -- 1.7.10.4