Improved undefined-function backtrace on non-x86oids.
authorAlastair Bridgewater <nyef@arisu.lisphacker.com>
Wed, 30 Nov 2011 16:41:55 +0000 (11:41 -0500)
committerAlastair Bridgewater <nyef@arisu.lisphacker.com>
Mon, 5 Dec 2011 22:56:24 +0000 (17:56 -0500)
  * 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
src/code/debug-int.lisp
tests/debug.impure.lisp

diff --git a/NEWS b/NEWS
index 8156f78..7e22e95 100644 (file)
--- 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:
index 592c75f..df06188 100644 (file)
@@ -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)
index b72317b..08bbca3 100644 (file)
 
   ;; 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*