Skip to content

Commit

Permalink
merge revision(s) 56030,56035: [Backport #12711]
Browse files Browse the repository at this point in the history
	* 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_3@56257 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
nagachika committed Sep 26, 2016
1 parent ded336e commit 6ccadba
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
7 changes: 7 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
Mon Sep 26 23:10:43 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]

Mon Sep 26 20:23:32 2016 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>

* gems/bundled_gems: update minitest to 5.8.5.
Expand Down
2 changes: 1 addition & 1 deletion version.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#define RUBY_VERSION "2.3.2"
#define RUBY_RELEASE_DATE "2016-09-26"
#define RUBY_PATCHLEVEL 189
#define RUBY_PATCHLEVEL 190

#define RUBY_RELEASE_YEAR 2016
#define RUBY_RELEASE_MONTH 9
Expand Down
10 changes: 7 additions & 3 deletions vm_dump.c
Original file line number Diff line number Diff line change
Expand Up @@ -482,10 +482,14 @@ backtrace(void **trace, int size)
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);
Expand Down

0 comments on commit 6ccadba

Please sign in to comment.