From: Alastair Bridgewater Date: Sat, 6 Feb 2010 05:03:13 +0000 (+0000) Subject: 1.0.35.5: Fix backtrace from internal-error on x86-64 OS X. X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=37052332dbc13d1b59c9ab1f2597e0106745b635;p=sbcl.git 1.0.35.5: Fix backtrace from internal-error on x86-64 OS X. * 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. --- diff --git a/NEWS b/NEWS index 2d0b819..93bc496 100644 --- 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 diff --git a/src/runtime/x86-64-darwin-os.c b/src/runtime/x86-64-darwin-os.c index ed8abbb..00da75f 100644 --- a/src/runtime/x86-64-darwin-os.c +++ b/src/runtime/x86-64-darwin-os.c @@ -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); diff --git a/version.lisp-expr b/version.lisp-expr index 605938e..c36d9fe 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".) -"1.0.35.4" +"1.0.35.5"