1.0.35.5: Fix backtrace from internal-error on x86-64 OS X.
authorAlastair Bridgewater <lisphacker@users.sourceforge.net>
Sat, 6 Feb 2010 05:03:13 +0000 (05:03 +0000)
committerAlastair Bridgewater <lisphacker@users.sourceforge.net>
Sat, 6 Feb 2010 05:03:13 +0000 (05:03 +0000)
  * Backtraces from internal-error traps were truncated before reaching
the erring stack frame due to an invalid frame pointer value being set
up in the mach exception handler.  Fixed.

NEWS
src/runtime/x86-64-darwin-os.c
version.lisp-expr

diff --git a/NEWS b/NEWS
index 2d0b819..93bc496 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,8 @@ changes relative to sbcl-1.0.35:
   * bug fix: a deadline handler was run without interrupts enabled for a
     deadline signaled within SB-THREAD:CONDITION-WAIT. That could result
     in infinitely spinning, non-killable threads.
+  * bug fix: backtrace from internal-errors on x86-64 os x was truncated
+    before reaching the erring stack frame.
 
 changes in sbcl-1.0.35 relative to sbcl-1.0.34:
   * optimization: ROUND with a single single-float or double-float argument
index ed8abbb..00da75f 100644 (file)
@@ -119,8 +119,18 @@ void align_context_stack(x86_thread_state64_t *context)
  * the old ESP value and other register state when activated.  The
  * first part of this is the recovery trampoline, which loads ESP from
  * EBP, pops EBP, and returns. */
-asm(".globl _stack_allocation_recover; .align 4; _stack_allocation_recover: mov %rbp, %rsp; pop %rsi; pop %rdi; pop \
-%rdx; pop %rcx; pop %r8; pop %r9; pop %rbp; ret;");
+asm(".globl _stack_allocation_recover; \
+    .align 4; \
+ _stack_allocation_recover: \
+    lea -48(%rbp), %rsp; \
+    pop %rsi; \
+    pop %rdi; \
+    pop %rdx; \
+    pop %rcx; \
+    pop %r8; \
+    pop %r9; \
+    pop %rbp; \
+    ret;");
 
 void open_stack_allocation(x86_thread_state64_t *context)
 {
@@ -128,6 +138,7 @@ void open_stack_allocation(x86_thread_state64_t *context)
 
     push_context(context->rip, context);
     push_context(context->rbp, context);
+    context->rbp = context->rsp;
 
     push_context(context->r9, context);
     push_context(context->r8, context);
@@ -136,7 +147,6 @@ void open_stack_allocation(x86_thread_state64_t *context)
     push_context(context->rsi, context);
     push_context(context->rdi, context);
 
-    context->rbp = context->rsp;
     context->rip = (u64) stack_allocation_recover;
 
     align_context_stack(context);
index 605938e..c36d9fe 100644 (file)
@@ -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".)
-"1.0.35.4"
+"1.0.35.5"