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 runtime/14026] print_ubacktrace doesn't resolve the symbol name


http://sourceware.org/bugzilla/show_bug.cgi?id=14026

--- Comment #19 from Mark Wielaard <mjw at redhat dot com> 2012-05-06 19:38:42 UTC ---
I finally understand what is happening, though I still don't understand how it
can happen.

The real problem is that we enter the unwinder with PC 8074811. While the probe
point actually is 8074810. This is normally caused because when a breakpoint is
taken the x86 increases the PC by one before invoking the interrupt handler.
But in the uprobe handler we already take care of this:

  // Make it look like the IP is set as it would in the actual user
  // task when calling real probe handler. Reset IP regs on return, so
  // we don't confuse uprobes. PR10458
  s.op->newline() << "{";
  s.op->indent(1);
  s.op->newline() << "unsigned long uprobes_ip = REG_IP(c->uregs);";
  s.op->newline() << "SET_REG_IP(regs, inst->vaddr);";
  s.op->newline() << "(*sups->probe->ph) (c);";
  s.op->newline() << "SET_REG_IP(regs, uprobes_ip);";
  s.op->newline(-1) << "}";

In the case of GCC-4.4 the FDE has its first DW_CFA_advance_loc 1. So we think
we need to process the instructions between 8074810 and 8074811. While with
GCC-4.6 the FDE has its first DW_CFA_advance_loc 4, so the one-off in the PC
address doesn't matter and we don't process extra FDE instructions.

The question is why doesn't the above trick of adjusting the IP to compensate
for the breakpoint PC increase work?

To check whether this is the real issue, you can try this patch:

diff --git a/runtime/stack-dwarf.c b/runtime/stack-dwarf.c
index 9c55997..fbea35c 100644
--- a/runtime/stack-dwarf.c
+++ b/runtime/stack-dwarf.c
@@ -69,6 +69,7 @@ static void __stp_dwarf_stack_user_print(struct pt_regs
*regs, int verbose,
 {
        struct unwind_frame_info *info = &uwcontext->info;
        arch_unw_init_frame_info(info, regs, ! uregs_valid);
+       info->call_frame = 1; /* XXX Always assume PC is off by one. */

        while (levels) {
                int ret = unwind(uwcontext, 1);

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- 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]