ruby-changes:43957
From: naruse <ko1@a...>
Date: Tue, 30 Aug 2016 03:43:23 +0900 (JST)
Subject: [ruby-changes:43957] naruse:r56030 (trunk): * vm_dump.c (backtrace): use rip in the saved context for the case
naruse 2016-08-30 03:43:17 +0900 (Tue, 30 Aug 2016) New Revision: 56030 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=56030 Log: * 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] Modified files: trunk/ChangeLog trunk/vm_dump.c Index: ChangeLog =================================================================== --- ChangeLog (revision 56029) +++ ChangeLog (revision 56030) @@ -1,3 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Tue Aug 30 03:38:35 2016 NARUSE, Yui <naruse@r...> + + * 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 Aug 27 10:26:14 2016 Nobuyoshi Nakada <nobu@r...> * array.c (rb_ary_concat_multi): take multiple arguments. based Index: vm_dump.c =================================================================== --- vm_dump.c (revision 56029) +++ vm_dump.c (revision 56030) @@ -470,6 +470,9 @@ darwin_sigtramp: https://github.com/ruby/ruby/blob/trunk/vm_dump.c#L470 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; -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/