The branch "master" has been updated in SBCL:
via c3af3cf3704ce01c71de96cc36c2798014fc9960 (commit)
from f60e9933a652a3b6ff5d3176f85a41833c1bc338 (commit)
- Log -----------------------------------------------------------------
commit c3af3cf3704ce01c71de96cc36c2798014fc9960
Author: Alastair Bridgewater <nyef@...>
Date: Mon Oct 24 14:30:32 2011 -0400
Fix x86oid OSX signal handling emulation assembly fragments.
* Both x86 and x86-64 signal_emulation_wrapper include a small
assembly fragment to simulate "sigreturn" by means of an invalid
instruction trap. This fragment has to load two different pointers
into specific registers before the trap, but historically just told
the compiler to load them into registers and then moved them into
the correct registers, leading to the possibility of clobbering one
of the values. Fixed, by informing the compiler to place them into
the correct registers to begin with.
---
NEWS | 2 ++
src/runtime/x86-64-darwin-os.c | 4 ++--
src/runtime/x86-darwin-os.c | 4 ++--
3 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/NEWS b/NEWS
index b141253..eaba678 100644
--- a/NEWS
+++ b/NEWS
@@ -12,6 +12,8 @@ changes relative to sbcl-1.0.52:
of multiple-valued places to be set to NIL, instead of signalling an
error (per a careful reading of CLHS 5.1.2.3).
* bug fix: floating-point traps now work on darwin/x86-64.
+ * bug fix: repair crash in x86oid darwin signal handling emulation
+ when built with certain compilers.
changes in sbcl-1.0.52 relative to sbcl-1.0.51:
* enhancement: ASDF has been updated to version 2.017.
diff --git a/src/runtime/x86-64-darwin-os.c b/src/runtime/x86-64-darwin-os.c
index 86d4687..1050ade 100644
--- a/src/runtime/x86-64-darwin-os.c
+++ b/src/runtime/x86-64-darwin-os.c
@@ -249,8 +249,8 @@ void signal_emulation_wrapper(x86_thread_state64_t *thread_state,
os_invalidate((os_vm_address_t)regs, sizeof(darwin_mcontext));
/* Trap to restore the signal context. */
- asm volatile ("mov %0, %%rax; mov %1, %%rbx; .quad 0xffffffffffff0b0f"
- : : "r" (thread_state), "r" (float_state));
+ asm volatile (".quad 0xffffffffffff0b0f"
+ : : "a" (thread_state), "b" (float_state));
}
#if defined DUMP_CONTEXT
diff --git a/src/runtime/x86-darwin-os.c b/src/runtime/x86-darwin-os.c
index debc8cf..f10d071 100644
--- a/src/runtime/x86-darwin-os.c
+++ b/src/runtime/x86-darwin-os.c
@@ -273,8 +273,8 @@ void signal_emulation_wrapper(x86_thread_state32_t *thread_state,
os_invalidate((os_vm_address_t)regs, sizeof(mcontext_t));
/* Trap to restore the signal context. */
- asm volatile ("movl %0, %%eax; movl %1, %%ebx; .long 0xffff0b0f"
- : : "r" (thread_state), "r" (float_state));
+ asm volatile (".long 0xffff0b0f"
+ : : "a" (thread_state), "b" (float_state));
}
/* Convenience wrapper for the above */
-----------------------------------------------------------------------
hooks/post-receive
--
SBCL
|