public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: Torsten Polle <Torsten.Polle@gmx.de>
To: Mark Wielaard <mjw@redhat.com>
Cc: systemtap@sourceware.org
Subject: Re: Prelinking on ARM with Debug Link
Date: Mon, 11 Apr 2016 18:47:00 -0000	[thread overview]
Message-ID: <D9911106-AB0E-4947-ADC9-F8CFB8700226@gmx.de> (raw)
In-Reply-To: <1459979805.8147.274.camel@redhat.com>

Hi Mark,

> Am 06.04.2016 um 23:56 schrieb Mark Wielaard <mjw@redhat.com>:
> 
> On Wed, 2016-04-06 at 22:44 +0200, Torsten Polle wrote:
>>> Am 05.04.2016 um 15:44 schrieb Mark Wielaard <mjw@redhat.com>:
>>> runtime/unwind.c (adjustStartLoc):
>>> 
>>> if (is_ehframe)
>>>   return startLoc + vm_addr;
>>> else
>>>   return startLoc + vm_addr - s->sec_load_offset;
>> 
>> I had twiddled with the else branch in the past. I do not recall all
>> attempts. But I’m sure that I set sec_load_offset even to 0. The
>> result is that the probes are set at the wrong address in libc. To be
>> more concrete they are offset by -5184 compared to the original
>> address. Still I’ll check your patch and let you know the result.
> 
> This code is certainly confusing. And arm32 might have different
> defaults from all other architectures (which normally have .eh_frames
> instead of just .debug_frames, on arm32 unwinding is often done through
> EXIDX - exception index tables - instead, but stap doesn't support
> those). So it might indeed be that in your case the non-ehframe path is
> taken. But I believe that even in that sec_load_offset should be zero.

I’ve checked your patch. As a result the backtrace calculations break in my environment.

I’ve therefore instrumented adjustStartLoc() as follows:

  if (is_ehframe) {
    printk(KERN_ERR "eh: s=%lu, v=%lu, l=%lu\n", startLoc, vm_addr, s->sec_load_offset);
    return startLoc + vm_addr;
  }
  else {
    printk(KERN_ERR "no eh: s=%lu, v=%lu, l=%lu\n", startLoc, vm_addr, s->sec_load_offset);
    return startLoc + vm_addr - s->sec_load_offset;
  }

As a result I get the following output:

[ 1215.876537] no eh: s=297684, v=1307279360, l=4294962112
[ 1215.876542] no eh: s=297532, v=1307279360, l=4294962112
[ 1215.876546] no eh: s=297568, v=1307279360, l=4294962112
[ 1215.876551] no eh: s=297612, v=1307279360, l=4294962112
[ 1215.876555] no eh: s=297612, v=1307279360, l=4294962112
[ 1215.876560] no eh: s=297612, v=1307279360, l=4294962112

This means that the non-ehframe path is taken and that sec_load_offset is non-zero.

> So it might impact unwinding through user space shared libraries. But it
> should not impact setting probe points in shared libraries.
> 
> On my own setup (x86_64 native) the patch showed no regressions with
> make installcheck. I would be interesting to hear of any test results
> you get with my patch.
> 
> Thanks,
> 
> Mark

Regards,
Torsten

  reply	other threads:[~2016-04-11 18:47 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-01 19:29 Torsten Polle
2016-02-09 20:55 ` Torsten Polle
2016-02-10 16:17   ` Mark Wielaard
2016-02-10 20:12     ` Torsten Polle
2016-02-10 20:35       ` Mark Wielaard
2016-02-11 10:49         ` Aw: " Torsten Polle
2016-02-16 10:08           ` Mark Wielaard
2016-02-16 20:46             ` Torsten Polle
2016-02-18 16:21               ` Mark Wielaard
2016-02-22 21:45                 ` Torsten Polle
2016-02-23 16:46                   ` Mark Wielaard
2016-02-23 22:16                     ` Torsten Polle
2016-02-28 20:51                       ` Torsten Polle
2016-03-30 20:05                         ` Torsten Polle
2016-04-01 13:07                           ` Mark Wielaard
2016-04-01 21:19                             ` Torsten Polle
2016-04-05 13:44                               ` Mark Wielaard
2016-04-06 20:45                                 ` Torsten Polle
2016-04-06 21:56                                   ` Mark Wielaard
2016-04-11 18:47                                     ` Torsten Polle [this message]
2016-04-11 21:02                                       ` Mark Wielaard
2016-04-12 20:26                                         ` Torsten Polle
2016-04-13  9:25                                           ` Mark Wielaard
2016-04-13 14:36                                             ` Aw: " Torsten Polle
  -- strict thread matches above, loose matches on Subject: below --
2015-12-01  7:26 Torsten Polle
2015-11-25 20:52 Torsten Polle
2015-11-26 10:33 ` Mark Wielaard
2015-11-26 22:05   ` Torsten Polle
2015-11-27  8:05     ` Mark Wielaard
2015-11-27 12:57       ` Torsten Polle
2015-11-27 15:06         ` Mark Wielaard
2015-11-27 16:34           ` Mark Wielaard
2015-11-27 20:08             ` Torsten Polle
2015-11-27 20:01           ` Torsten Polle
2015-11-30 19:26             ` David Smith
2015-12-01 20:10               ` Torsten Polle
2015-12-10 19:00                 ` David Smith
2015-12-10 19:45                   ` Torsten Polle

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=D9911106-AB0E-4947-ADC9-F8CFB8700226@gmx.de \
    --to=torsten.polle@gmx.de \
    --cc=mjw@redhat.com \
    --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).