public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: "mjw at redhat dot com" <sourceware-bugzilla@sourceware.org>
To: systemtap@sourceware.org
Subject: [Bug runtime/14026] print_ubacktrace doesn't resolve the symbol name
Date: Sun, 06 May 2012 19:39:00 -0000	[thread overview]
Message-ID: <bug-14026-6586-MMzehuUnLA@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-14026-6586@http.sourceware.org/bugzilla/>

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.

  parent reply	other threads:[~2012-05-06 19:39 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-27 10:00 [Bug runtime/14026] New: " adrian.m.negreanu at intel dot com
2012-04-27 10:02 ` [Bug runtime/14026] " adrian.m.negreanu at intel dot com
2012-04-27 10:03 ` adrian.m.negreanu at intel dot com
2012-04-27 13:51 ` adrian.m.negreanu at intel dot com
2012-04-27 13:57 ` mjw at redhat dot com
2012-04-27 15:23 ` adrian.m.negreanu at intel dot com
2012-04-27 15:39 ` adrian.m.negreanu at intel dot com
2012-05-02 13:22 ` adrian.m.negreanu at intel dot com
2012-05-02 14:06 ` mjw at redhat dot com
2012-05-02 14:30 ` adrian.m.negreanu at intel dot com
2012-05-02 14:33 ` adrian.m.negreanu at intel dot com
2012-05-02 14:44 ` adrian.m.negreanu at intel dot com
2012-05-02 14:49 ` mjw at redhat dot com
2012-05-02 15:34 ` mjw at redhat dot com
2012-05-02 15:38 ` mjw at redhat dot com
2012-05-02 19:56 ` mjw at redhat dot com
2012-05-03  9:55 ` mjw at redhat dot com
2012-05-04 13:11 ` adrian.m.negreanu at intel dot com
2012-05-04 13:51 ` adrian.m.negreanu at intel dot com
2012-05-06 12:43 ` mjw at redhat dot com
2012-05-06 12:44 ` mjw at redhat dot com
2012-05-06 12:45 ` mjw at redhat dot com
2012-05-06 12:46 ` mjw at redhat dot com
2012-05-06 12:47 ` mjw at redhat dot com
2012-05-06 12:47 ` mjw at redhat dot com
2012-05-06 12:48 ` mjw at redhat dot com
2012-05-06 13:09 ` mjw at redhat dot com
2012-05-06 19:39 ` mjw at redhat dot com [this message]
2012-05-06 21:16 ` fche at redhat dot com
2012-05-06 21:31 ` fche at redhat dot com
2012-05-07  8:43 ` mjw at redhat dot com
2012-05-07 13:45 ` [Bug runtime/14026] inode based uprobes " mjw at redhat dot com
2012-07-19 14:53 ` fche at redhat dot com
2012-07-23  5:57   ` Srikar Dronamraju
2012-07-23  8:26     ` Mark Wielaard
2012-07-23  9:35       ` Srikar Dronamraju
2012-07-19 20:56 ` [Bug runtime/14026] inode-uprobes should compute proper SET_REG_IP before probe invocation fche at redhat dot com
2012-07-26 22:09 ` fche at redhat dot com
2012-08-14 21:55 ` dsmith at redhat dot com
2012-08-14 22:10 ` dsmith at redhat dot com
2012-08-14 22:20 ` mjw at redhat dot com
2012-08-14 22:28 ` mjw at redhat dot com
2012-08-15 14:09 ` dsmith at redhat dot com
2012-08-15 14:14 ` dsmith at redhat dot com
2012-08-15 14:25 ` mjw at redhat dot com
2012-08-15 15:12 ` dsmith at redhat dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-14026-6586-MMzehuUnLA@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=systemtap@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).