bug-binutils
[Top][All Lists]
Advanced

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

[Bug binutils/21958] New: addr2line incorrectly handles non-increasing s


From: philipjcraig at gmail dot com
Subject: [Bug binutils/21958] New: addr2line incorrectly handles non-increasing sequences in line table
Date: Wed, 16 Aug 2017 06:11:02 +0000

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

            Bug ID: 21958
           Summary: addr2line incorrectly handles non-increasing sequences
                    in line table
           Product: binutils
           Version: 2.30 (HEAD)
            Status: UNCONFIRMED
          Severity: minor
          Priority: P2
         Component: binutils
          Assignee: unassigned at sourceware dot org
          Reporter: philipjcraig at gmail dot com
  Target Milestone: ---

The attached 'helloworld' file was compiled with rustc 1.18.

Running addr2line gives the following ouput:

    $ echo 0x0002f5e0 | addr2line -e helloworld 
    /checkout/src/liballoc_jemalloc/../jemalloc/src/prof.c:2093

The expected output is:

    /checkout/src/liballoc_jemalloc/../jemalloc/src/prof.c:1906

The problem is that the line table for prof.c has badly formed entries. Here's
some of them:

  [0x0003215b]  Extended opcode 2: set Address to 0x0
  [0x00032166]  Advance Line by 2082 to 2083
  [0x00032169]  Copy
  [0x0003216a]  Advance PC by 0 to 0x0
  [0x0003216c]  Extended opcode 1: End of Sequence

  [0x0003216f]  Extended opcode 2: set Address to 0x0
  [0x0003217a]  Advance Line by 2092 to 2093
  [0x0003217d]  Copy
  [0x0003217e]  Advance PC by 0 to 0x0
  [0x00032180]  Extended opcode 1: End of Sequence

  [0x00032183]  Extended opcode 2: set Address to 0x2f5f0
  [0x0003218e]  Advance Line by 2118 to 2119
  [0x00032191]  Copy

It appears that add_line_info() in bfd/dwarf2.c ends up creating a sequence
containing the addresses 0 and 0x2f5f0, so if an address matches the address
ranges for the prof.c unit, but is less than 0x2f5f0, then the line entry for
address 0 line 2093 will be matched.

I think the cause of the problem is that add_line_info() does not correctly
handle the end_sequence flag when adding info to the middle of a sequence.

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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]