[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug default/25058] New: abigail does not recognize



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

            Bug ID: 25058
           Summary: abigail does not recognize
           Product: libabigail
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: default
          Assignee: dodji at redhat dot com
          Reporter: simark at simark dot ca
                CC: libabigail at sourceware dot org
  Target Milestone: ---

When running abidiff on the provided libraries:

  abidiff liblttng-ctl2.10.so liblttng-ctl.so

some functions, like lttng_destruction_handle_wait_for_completion are
supposedly not referenced by the debug info, when in fact they are.  More
precisely, this is unexpected:

  3 Added function symbols not referenced by debug info:

     lttng_destruction_handle_wait_for_completion
     lttng_session_descriptor_destroy
     lttng_userspace_probe_location_destroy

It is correct that the function symbols are added in the new version of the
library, but it is incorrect that they are not referenced by debug info.

I traced down the problem to the fact that these functions' DIEs use
DW_AT_ranges to describe multiple PC ranges instead of DW_AT_low_pc to describe
a single range.  For example:

  0x0001bb61:   DW_TAG_subprogram
                  DW_AT_external  (true)
                  DW_AT_name     
("lttng_destruction_handle_wait_for_completion")
                  DW_AT_decl_file
("/tmp/tools-master/src/lttng-tools/src/lib/lttng-ctl/destruction-handle.c")
                  DW_AT_decl_line (237)
                  DW_AT_decl_column       (0x01)
                  DW_AT_prototyped        (true)
                  DW_AT_type      (0x0001a018
"lttng_destruction_handle_status")
                  DW_AT_ranges    (0x00002420
                     [0x0000000000018f20, 0x000000000001942d)
                     [0x0000000000011400, 0x000000000001140a))
                  DW_AT_frame_base        (DW_OP_call_frame_cfa)
                  DW_AT_GNU_all_call_sites        (true)
                  DW_AT_sibling   (0x0001c28e)

This makes abigail::dwarf_reader::read_context::get_function_address fail to
find the function address.  This makes build_function_decl fail to find the
corresponding ELF symbol, therefore not set the `is_in_public_symbol_table`
property of the function_decl.  This makes
corpus::exported_decls_builder::maybe_add_fn_to_exported_fns not add that
function to the functions described by debug info.

We would probably not see this if we built the binaries with -O0 (or at least
with -fno-reorder-blocks-and-partition), but it's still probably a bug that
abigail doesn't understand DW_AT_ranges.

-- 
You are receiving this mail because:
You are on the CC list for the bug.