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 translator/25193] New: Incorrect reporting of line information for stap -v -L 'process("/usr/bin/ld.gold").statement("*@*:*")'


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

            Bug ID: 25193
           Summary: Incorrect reporting of line information for stap -v -L
                    'process("/usr/bin/ld.gold").statement("*@*:*")'
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: translator
          Assignee: systemtap at sourceware dot org
          Reporter: wcohen at redhat dot com
  Target Milestone: ---

The mechanism determining the line number from the debuginfo is getting the
line information incorrect.  This was observed on Fedora 30 with
binutils-2.31.1-29.fc30.x86_64:

stap -v -L 'process("/usr/bin/ld.gold").statement("*@*:*")'

Provides a huge number of statements at line 128 for different files.  It turns
out this is due to gcc c++ compiler inlining line 128 from
/usr/include/c++/9/ext/new_allocator.h in many different places.  The line 128
makes sense for the new_allocator.h head file but not for the other statement
probe points at the same instruction:

process("/usr/bin/ld.gold").statement("Abbrev_code@/usr/src/debug/binutils-2.31.1-29.fc30.x86_64/gold/dwarf_reader.h:128")
/* pc=.dynamic+0x189925 */ $this:struct Abbrev_code* const
process("/usr/bin/ld.gold").statement("_M_deallocate@/usr/include/c++/9/bits/stl_vector.h:128")
/* pc=.dynamic+0x189925 */ $this:struct
_Vector_base<gold::Dwarf_abbrev_table::Attribute,
std::allocator<gold::Dwarf_abbrev_table::Attribute> >* const $__n:size_t
$__p:pointer
process("/usr/bin/ld.gold").statement("deallocate@/usr/include/c++/9/bits/alloc_traits.h:128")
/* pc=.dynamic+0x189925 */ $__a:allocator_type& $__n:size_type $__p:pointer
process("/usr/bin/ld.gold").statement("deallocate@/usr/include/c++/9/ext/new_allocator.h:128")
/* pc=.dynamic+0x189925 */ $this:class
new_allocator<gold::Dwarf_abbrev_table::Attribute>* const $__p:pointer
process("/usr/bin/ld.gold").statement("do_get_abbrev@/usr/src/debug/binutils-2.31.1-29.fc30.x86_64/gold/dwarf_reader.cc:128")
/* pc=.dynamic+0x189925 */ $len:size_t $nextcode:uint64_t $this:class
Dwarf_abbrev_table* const $code:unsigned int
process("/usr/bin/ld.gold").statement("reserve@/usr/include/c++/9/bits/vector.tcc:128")
/* pc=.dynamic+0x189925 */ $__old_size:size_type const $__tmp:pointer
$__n:size_type $this:class vector<gold::Dwarf_abbrev_table::Attribute,
std::allocator<gold::Dwarf_abbrev_table::Attribute> >* const


According to "readelf --wide -wLK 
/usr/lib/debug/usr/bin/ld.gold-2.31.1-29.fc30.x86_64.debug" it maps to the
following:

/usr/include/c++/9/bits/alloc_traits.h:
alloc_traits.h                               469            0x189925

/usr/include/c++/9/ext/new_allocator.h:
new_allocator.h                              119            0x189925       1
new_allocator.h                              128            0x189925       2

It appears that stap is always using the last view's line number information
regardless of the view. 

fche suggested that the problem might be in tapsets.cxx:query_srcfile_line.

-- 
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]