Fixing sigsegv on Mach x86_64 - possibly a hack; I'm not sure why the

address returned doesn't have that bit set already.
This commit is contained in:
asvitkine
2010-07-27 22:52:33 +00:00
parent e03ad25362
commit 853db27159
2 changed files with 5 additions and 3 deletions

View File

@@ -472,10 +472,8 @@ AC_CHECK_FILE([/dev/ptc],
have_dev_ptc=1
]
)
dnl (end of code from openssh-3.2.2p1 configure.ac)
dnl Check for systems where POSIX-style non-blocking I/O (O_NONBLOCK)
dnl doesn't work or is unimplemented. On these systems (mostly older
dnl ones), use the old BSD-style FIONBIO approach instead. [tcl.m4]
@@ -982,6 +980,9 @@ AC_CACHE_CHECK([whether your system supports Mach exceptions],
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_TRY_RUN([
#define HAVE_UNISTD_H 1
#define HAVE_MACH_VM 1
#define HAVE_MACH_TASK_SELF 1
#define HAVE_MACH_EXCEPTIONS 1
#define CONFIGURE_TEST_SIGSEGV_RECOVERY
#include "vm_alloc.cpp"

View File

@@ -89,6 +89,7 @@ extern "C" {
#define SIGSEGV_FAULT_INSTRUCTION SIP->thr_state.MACH_FIELD_NAME(eip)
#define SIGSEGV_SKIP_INSTRUCTION ix86_skip_instruction
#define SIGSEGV_REGISTER_FILE ((SIGSEGV_REGISTER_TYPE *)&SIP->thr_state.MACH_FIELD_NAME(eax)) /* EAX is the first GPR we consider */
#define SIGSEGV_FAULT_ADDRESS_FAST code[1]
#endif
#ifdef __x86_64__
#if __DARWIN_UNIX03 && defined _STRUCT_X86_THREAD_STATE64
@@ -104,8 +105,8 @@ extern "C" {
#define SIGSEGV_FAULT_INSTRUCTION SIP->thr_state.MACH_FIELD_NAME(rip)
#define SIGSEGV_SKIP_INSTRUCTION ix86_skip_instruction
#define SIGSEGV_REGISTER_FILE ((SIGSEGV_REGISTER_TYPE *)&SIP->thr_state.MACH_FIELD_NAME(rax)) /* RAX is the first GPR we consider */
#define SIGSEGV_FAULT_ADDRESS_FAST (((uint64_t)code[1])|0x100000000)
#endif
#define SIGSEGV_FAULT_ADDRESS_FAST code[1]
#define SIGSEGV_FAULT_INSTRUCTION_FAST SIGSEGV_INVALID_ADDRESS
#define SIGSEGV_FAULT_HANDLER_ARGLIST mach_port_t thread, mach_exception_data_t code
#define SIGSEGV_FAULT_HANDLER_ARGS thread, code