This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tapsets/20982] New: function::stack doesn't descend if _stack_raw() fails


https://sourceware.org/bugzilla/show_bug.cgi?id=20982

            Bug ID: 20982
           Summary: function::stack doesn't descend if _stack_raw() fails
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: tapsets
          Assignee: systemtap at sourceware dot org
          Reporter: bcodding at redhat dot com
  Target Milestone: ---

On 4.8.13-100.fc23.x86_64, it seems vmlinux is missing unwind data.  If so, the
stack() function ought to fall back to using backtrace(), but this
functionality has been broken since commit 700d493 "PR14900: fix collisions
between context tapset locals and user globals"

Note in the following output's last line, the return value of stack(0) and
stack(N) will always be equal:

# stap -DDEBUG_UNWIND=3 -e 'probe kernel.function("get_seconds") {
printf("stack 0 is %p, stack 1 is %p\n", stack(0), stack(1)); exit() }'
_stp_stack_unwind_one_kernel:272: STARTING kernel unwind
0xffffffff83116840 _stp_stack_unwind_one_kernel:307: CONTINUING kernel unwind
to depth 1
unwind:1478: pc=ffffffff83116840, ffffffff83116840
unwind:1521: trying debug_frame
set_no_state_rule:249: reg=10, where=1
_stp_search_unwind_hdr:775: binary search for ffffffff83116840
adjustStartLoc:725: adjustStartLoc=ffffffff814449b0, ptrType=DW_EH_PE_absptr,
m=/usr/lib/debug/lib/modules/4.8.13-100.fc23.x86_64/vmlinux, s=_stext eh=0
adjustStartLoc:725: adjustStartLoc=ffffffff81648d80, ptrType=DW_EH_PE_absptr,
m=/usr/lib/debug/lib/modules/4.8.13-100.fc23.x86_64/vmlinux, s=_stext eh=0
adjustStartLoc:725: adjustStartLoc=ffffffff81769ee0, ptrType=DW_EH_PE_absptr,
m=/usr/lib/debug/lib/modules/4.8.13-100.fc23.x86_64/vmlinux, s=_stext eh=0
adjustStartLoc:725: adjustStartLoc=ffffffff81f8a969, ptrType=DW_EH_PE_absptr,
m=/usr/lib/debug/lib/modules/4.8.13-100.fc23.x86_64/vmlinux, s=_stext eh=0
adjustStartLoc:725: adjustStartLoc=ffffffff81fbfb32, ptrType=DW_EH_PE_absptr,
m=/usr/lib/debug/lib/modules/4.8.13-100.fc23.x86_64/vmlinux, s=_stext eh=0
adjustStartLoc:725: adjustStartLoc=ffffffff81fda19a, ptrType=DW_EH_PE_absptr,
m=/usr/lib/debug/lib/modules/4.8.13-100.fc23.x86_64/vmlinux, s=_stext eh=0
adjustStartLoc:725: adjustStartLoc=ffffffff81fe6cc8, ptrType=DW_EH_PE_absptr,
m=/usr/lib/debug/lib/modules/4.8.13-100.fc23.x86_64/vmlinux, s=_stext eh=0
adjustStartLoc:725: adjustStartLoc=ffffffff820f2f33, ptrType=DW_EH_PE_absptr,
m=/usr/lib/debug/lib/modules/4.8.13-100.fc23.x86_64/vmlinux, s=_stext eh=0
adjustStartLoc:725: adjustStartLoc=ffffffff820f3765, ptrType=DW_EH_PE_absptr,
m=/usr/lib/debug/lib/modules/4.8.13-100.fc23.x86_64/vmlinux, s=_stext eh=0
adjustStartLoc:725: adjustStartLoc=ffffffff820f3db9, ptrType=DW_EH_PE_absptr,
m=/usr/lib/debug/lib/modules/4.8.13-100.fc23.x86_64/vmlinux, s=_stext eh=0
adjustStartLoc:725: adjustStartLoc=ffffffff820f4214, ptrType=DW_EH_PE_absptr,
m=/usr/lib/debug/lib/modules/4.8.13-100.fc23.x86_64/vmlinux, s=_stext eh=0
adjustStartLoc:725: adjustStartLoc=ffffffff820f42e4, ptrType=DW_EH_PE_absptr,
m=/usr/lib/debug/lib/modules/4.8.13-100.fc23.x86_64/vmlinux, s=_stext eh=0
adjustStartLoc:725: adjustStartLoc=ffffffff820f4389, ptrType=DW_EH_PE_absptr,
m=/usr/lib/debug/lib/modules/4.8.13-100.fc23.x86_64/vmlinux, s=_stext eh=0
adjustStartLoc:725: adjustStartLoc=ffffffff820f43b9, ptrType=DW_EH_PE_absptr,
m=/usr/lib/debug/lib/modules/4.8.13-100.fc23.x86_64/vmlinux, s=_stext eh=0
adjustStartLoc:725: adjustStartLoc=ffffffff820f43e1, ptrType=DW_EH_PE_absptr,
m=/usr/lib/debug/lib/modules/4.8.13-100.fc23.x86_64/vmlinux, s=_stext eh=0
adjustStartLoc:725: adjustStartLoc=ffffffff820f445a, ptrType=DW_EH_PE_absptr,
m=/usr/lib/debug/lib/modules/4.8.13-100.fc23.x86_64/vmlinux, s=_stext eh=0
adjustStartLoc:725: adjustStartLoc=ffffffff820f445a, ptrType=DW_EH_PE_absptr,
m=/usr/lib/debug/lib/modules/4.8.13-100.fc23.x86_64/vmlinux, s=_stext eh=0
_stp_search_unwind_hdr:840: fde off=1f1b50
_stp_search_unwind_hdr:850: returning fde=ffffffffc0b3eaf0
startLoc=ffffffff820f445a
unwind_frame:1194: /usr/lib/debug/lib/modules/4.8.13-100.fc23.x86_64/vmlinux:
fde=ffffffffc0b3eaf0
unwind_frame:1199: /usr/lib/debug/lib/modules/4.8.13-100.fc23.x86_64/vmlinux:
cie=ffffffffc0b3e9d8
parse_fde_cie:142: codeAlign=1, dataAlign=fffffffffffffff8
parse_fde_cie:156: map retAddrReg value 16 to reg_info idx 16
parse_fde_cie:220: startLoc: ffffffff820f445a, locrange: 34
adjustStartLoc:725: adjustStartLoc=ffffffff820f445a, ptrType=DW_EH_PE_absptr,
m=/usr/lib/debug/lib/modules/4.8.13-100.fc23.x86_64/vmlinux, s=_stext eh=0
unwind_frame:1214: startLoc: ffffffff820f445a, endLoc: ffffffff820f448e
unwind_frame:1216: pc (ffffffff83116840) > endLoc(ffffffff820f448e)
unwind:1525: debug_frame failed: 1, trying eh_frame
unwind_frame:1178: Module
/usr/lib/debug/lib/modules/4.8.13-100.fc23.x86_64/vmlinux: no unwind frame data
unwind:1533: unwinding failed: -5
_stp_stack_unwind_one_kernel:325: ret=-5 PC=ffffffff83116840
SP=ffff9e1479eafdb0
stack 0 is 0xffffffff83116840, stack 1 is 0xffffffff83116840

The following hack (fix?) resolves the problem for me:
diff --git a/tapset/linux/context-symbols.stp
b/tapset/linux/context-symbols.stp
index 0585ca3..e710209 100644
--- a/tapset/linux/context-symbols.stp
+++ b/tapset/linux/context-symbols.stp
@@ -34,13 +34,13 @@ function stack:long (n:long) {
          if (__r != 0) return __r

          /* fallback: parse backtrace() to go deeper in the stack */
-         __b = backtrace (); __orig_n = __n;
+         __b = backtrace (); __orig_n = n;
          __sym = tokenize (__b, " ");
          if (__sym == "") @__context_unwind_error(__orig_n);
-         while (__n > 0) {
+         while (n > 0) {
                __sym = tokenize ("", " ");
                if (__sym == "") @__context_unwind_error(__orig_n);
-               __n--;
+               n--;
          }
          return strtol(__sym, 16)
 }

-- 
You are receiving this mail because:
You are the assignee for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]