diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-09-30 15:58:12 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-09-30 15:58:12 +0000 |
commit | 768cdfb2a3d4406db53e950b13134d4b6d70ca80 (patch) | |
tree | 88b49eae2198c20a297ed77bb9dbec6e220e55c0 | |
parent | 16310405170cf26f2412622ee7978e8d5a05d61b (diff) |
merge revision(s) 56030,56035: [Backport #12711]
* 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/branches/ruby_2_2@56308 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | version.h | 2 | ||||
-rw-r--r-- | vm_dump.c | 10 |
3 files changed, 15 insertions, 4 deletions
@@ -1,3 +1,10 @@ +Sat Oct 1 00:57:54 2016 NARUSE, Yui <naruse@ruby-lang.org> + + * 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] + Sat Oct 1 00:56:19 2016 Aaron Patterson <tenderlove@ruby-lang.org> * lib/uri/generic.rb (def check_password): don't include bad password @@ -1,6 +1,6 @@ #define RUBY_VERSION "2.2.6" #define RUBY_RELEASE_DATE "2016-10-01" -#define RUBY_PATCHLEVEL 377 +#define RUBY_PATCHLEVEL 378 #define RUBY_RELEASE_YEAR 2016 #define RUBY_RELEASE_MONTH 10 @@ -487,10 +487,14 @@ darwin_sigtramp: unw_set_reg(&cursor, UNW_X86_64_R13, uctx->uc_mcontext->__ss.__r13); 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; - unw_set_reg(&cursor, UNW_REG_IP, ip); - trace[n++] = (void *)uctx->uc_mcontext->__ss.__rip; + ip = uctx->uc_mcontext->__ss.__rip; + if (((char*)ip)[-2] == 0x0f && ((char*)ip)[-1] == 5) { + /* signal received in syscall */ + trace[n++] = (void *)ip; + ip = *(unw_word_t*)uctx->uc_mcontext->__ss.__rsp; + } trace[n++] = (void *)ip; + unw_set_reg(&cursor, UNW_REG_IP, ip); } while (unw_step(&cursor) > 0) { unw_get_reg(&cursor, UNW_REG_IP, &ip); |