aboutsummaryrefslogtreecommitdiffstats
path: root/vm_dump.c
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-08-29 18:43:17 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-08-29 18:43:17 +0000
commitc0c9035cc2f683c69791885a4343d30905e61c1d (patch)
treea6af49ad8ece2437901e19d81f0e3d4e9ffcc064 /vm_dump.c
parentf42ea7da37baf86f8db1e9ae1a47d522a20fd6cd (diff)
downloadruby-c0c9035cc2f683c69791885a4343d30905e61c1d.tar.gz
* vm_dump.c (backtrace): use rip in the saved context for the case
the SIGSEGV is received when the process is in userland. Note that ip in the stack should be used if the signal is received when it is in kernel (when it is calling syscall) [Bug #12711] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56030 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_dump.c')
-rw-r--r--vm_dump.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/vm_dump.c b/vm_dump.c
index c0f0685f0b..f8cde6d595 100644
--- a/vm_dump.c
+++ b/vm_dump.c
@@ -470,6 +470,9 @@ darwin_sigtramp:
unw_set_reg(&cursor, UNW_X86_64_R14, uctx->uc_mcontext->__ss.__r14);
unw_set_reg(&cursor, UNW_X86_64_R15, uctx->uc_mcontext->__ss.__r15);
ip = *(unw_word_t*)uctx->uc_mcontext->__ss.__rsp;
+ if (!ip) { /* signal received in syscall */
+ ip = uctx->uc_mcontext->__ss.__rip;
+ }
unw_set_reg(&cursor, UNW_REG_IP, ip);
trace[n++] = (void *)uctx->uc_mcontext->__ss.__rip;
trace[n++] = (void *)ip;