public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: "wcohen at redhat dot com" <sourceware-bugzilla@sourceware.org>
To: systemtap@sourceware.org
Subject: [Bug translator/25193] Incorrect reporting of line information for stap -v -L 'process("/usr/bin/ld.gold").statement("*@*:*")'
Date: Tue, 12 May 2020 18:18:23 +0000	[thread overview]
Message-ID: <bug-25193-6586-dUf29WFXrm@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-25193-6586@http.sourceware.org/bugzilla/>

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

--- Comment #1 from William Cohen <wcohen at redhat dot com> ---
Created attachment 12526
  --> https://sourceware.org/bugzilla/attachment.cgi?id=12526&action=edit
Much smaller reproduer example with multiple line views for the same
instruction

multiple_views.cc is a much smaller reproducer which systemtap generates very
odd list of probe points for individual instructions.

$ rpm -q gcc systemtap elfutils
gcc-10.1.1-1.fc32.x86_64
systemtap-4.3-1.202005111542.fc32.x86_64
elfutils-0.179-2.fc32pr25549.x86_64
$ g++ -g -O2 -o multiple_views multiple_views.cc
$stap -v -L 'process("./multiple_views").statement("*@*:*")' >&
multiple_views.stap_out
$ cat multiple_views.stap_out |grep -o -e 'pc=.absolute+0x[[:alnum:]]\+' |sort
|uniq -c |sort -nr|more
     14 pc=.absolute+0x10ef
      7 pc=.absolute+0x10e6
      7 pc=.absolute+0x10dd
      5 pc=.absolute+0x10d8
      5 pc=.absolute+0x10c1
      5 pc=.absolute+0x10b8
      4 pc=.absolute+0x10fd
      3 pc=.absolute+0x10cf
      2 pc=.absolute+0x10f3
      2 pc=.absolute+0x10e1
      2 pc=.absolute+0x10b0
      1 pc=.absolute+0x1105
      1 pc=.absolute+0x10c0

There are a lot of probes (14) on 0x10ef.  Look at the "readelf
--debug-dump=decodedline multiple_views" for the 0x10ef instruction there are 6
views:

/usr/include/c++/10/bits/basic_string.h:
basic_string.h                               214            0x4010dd           
   x
basic_string.h                               182            0x4010dd       1   
   x
basic_string.h                               187            0x4010dd       2
basic_string.h                              6463            0x4010e1        
basic_string.h                               183            0x4010e6        
basic_string.h                               183            0x4010ef        
basic_string.h                               186            0x4010ef       1   
   x
basic_string.h                               186            0x4010ef       2

/usr/include/c++/10/bits/char_traits.h:
char_traits.h                                321            0x4010ef       3   
   x
char_traits.h                                322            0x4010ef       4   
   x
char_traits.h                                322            0x4010ef       5
char_traits.h                                322            0x4010f3        

Sorting by line number makes it a bit more obvious that systemtap is getting
something wrong as it is very unlikely that multiple files would end up having
the same line number for the same instruction:

$ grep 0x10ef multiple_views.stap_out |sort -t: -k2n
process("/home/wcohen/multiple_views").statement("assign@/usr/include/c++/10/bits/char_traits.h:186")
/* pc=.absolute+0x10ef */ $__c1:char_type&
process("/home/wcohen/multiple_views").statement("basic_string@/usr/include/c++/10/bits/basic_string.h:186")
/* pc=.absolute+0x10ef */ $__s:char const* $this:class basic_string<char,
std::char_traits<char>, std::allocator<char> >* const
process("/home/wcohen/multiple_views").statement("main@/home/wcohen/multiple_views.cc:186")
/* pc=.absolute+0x10ef */ $argc:int $argv:char** $a:string
process("/home/wcohen/multiple_views").statement("_M_construct_aux<char
const*>@/usr/include/c++/10/bits/basic_string.h:186") /* pc=.absolute+0x10ef */
$__end:char const* $__beg:char const* $this:class basic_string<char,
std::char_traits<char>, std::allocator<char> >* const
process("/home/wcohen/multiple_views").statement("_M_construct<char
const*>@/usr/include/c++/10/bits/basic_string.h:186") /* pc=.absolute+0x10ef */
$__end:char const* $__beg:char const* $this:class basic_string<char,
std::char_traits<char>, std::allocator<char> >* const
process("/home/wcohen/multiple_views").statement("_M_construct<char
const*>@/usr/include/c++/10/bits/basic_string.tcc:186") /* pc=.absolute+0x10ef
*/ $__dnew:size_type $__end:char const* $__beg:char const* $this:class
basic_string<char, std::char_traits<char>, std::allocator<char> >* const
process("/home/wcohen/multiple_views").statement("_M_set_length@/usr/include/c++/10/bits/basic_string.h:186")
/* pc=.absolute+0x10ef */ $__n:size_type $this:class basic_string<char,
std::char_traits<char>, std::allocator<char> >* const
process("/home/wcohen/multiple_views").statement("assign@/usr/include/c++/10/bits/char_traits.h:322")
/* pc=.absolute+0x10ef */ $__c1:char_type&
process("/home/wcohen/multiple_views").statement("basic_string@/usr/include/c++/10/bits/basic_string.h:322")
/* pc=.absolute+0x10ef */ $__s:char const* $this:class basic_string<char,
std::char_traits<char>, std::allocator<char> >* const
process("/home/wcohen/multiple_views").statement("main@/home/wcohen/multiple_views.cc:322")
/* pc=.absolute+0x10ef */ $argc:int $argv:char** $a:string
process("/home/wcohen/multiple_views").statement("_M_construct_aux<char
const*>@/usr/include/c++/10/bits/basic_string.h:322") /* pc=.absolute+0x10ef */
$__end:char const* $__beg:char const* $this:class basic_string<char,
std::char_traits<char>, std::allocator<char> >* const
process("/home/wcohen/multiple_views").statement("_M_construct<char
const*>@/usr/include/c++/10/bits/basic_string.h:322") /* pc=.absolute+0x10ef */
$__end:char const* $__beg:char const* $this:class basic_string<char,
std::char_traits<char>, std::allocator<char> >* const
process("/home/wcohen/multiple_views").statement("_M_construct<char
const*>@/usr/include/c++/10/bits/basic_string.tcc:322") /* pc=.absolute+0x10ef
*/ $__dnew:size_type $__end:char const* $__beg:char const* $this:class
basic_string<char, std::char_traits<char>, std::allocator<char> >* const
process("/home/wcohen/multiple_views").statement("_M_set_length@/usr/include/c++/10/bits/basic_string.h:322")
/* pc=.absolute+0x10ef */ $__n:size_type $this:class basic_string<char,
std::char_traits<char>, std::allocator<char> >* const

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

  reply	other threads:[~2020-05-12 18:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-14 21:36 [Bug translator/25193] New: " wcohen at redhat dot com
2020-05-12 18:18 ` wcohen at redhat dot com [this message]
2020-05-12 18:54 ` [Bug translator/25193] " wcohen at redhat dot com
2020-05-15 18:32 ` wcohen at redhat dot com
2020-05-18 18:08 ` wcohen at redhat dot com
2020-06-03 14:42 ` wcohen 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-25193-6586-dUf29WFXrm@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).