[LLVMbugs] [Bug 18790] New: DWARF debug info has overlapping, invalid line information

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Feb 10 02:46:47 PST 2014


http://llvm.org/bugs/show_bug.cgi?id=18790

            Bug ID: 18790
           Summary: DWARF debug info has overlapping, invalid line
                    information
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: FreeBSD
            Status: NEW
          Severity: normal
          Priority: P
         Component: Common Code Generator Code
          Assignee: unassignedbugs at nondot.org
          Reporter: yuri at tsoft.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 12038
  --> http://llvm.org/bugs/attachment.cgi?id=12038&action=edit
testcase

I am attaching the testcase which generates wrong debug line information in
elf.

Sources: h.bc and x.bc

Script to run (also included in the testcase):
llvm-link h.bc x.bc > all.bc
llc -filetype=obj all.bc
objdump -D all.o > all.asm
dwarfdump all.o > all.dwarf

Description:
ELF all.o in its .text segment has 2 areas with line information:
0x10-0x1a with the source file z/a.xxx (10 bytes)
0x40-0x41 with the source file z/b.xxx (1 byte)

all.dwarf shows this line information:
<pc>        [row,col] NS BB ET PE EB IS= DI= uri: "filepath"
0x00000010  [ 651, 0] NS uri: "z/a.xxx"
0x00000010  [ 652, 5] NS PE
0x00000018  [ 654, 0] NS
0x00000041  [ 654, 0] NS ET

<pc>        [row,col] NS BB ET PE EB IS= DI= uri: "filepath"
0x00000040  [   2, 0] NS uri: "z/b.xxx"
0x00000040  [   3, 0] NS PE
0x00000041  [   3, 0] NS ET

The z/a.xxx section above ends at the wrong offset 0x41, and overlaps the
second section, which according to the DWARF info also ends at 0x41

As a result, 'addr2line -e all.o 0x40' command returns wrong line
'z/a.xxx:654', and it should return 'z/b.xxx:3'.

I also traced this in debugger in addr2line. If in debugger to set 'found=0'
after the line dwarf2.c:3660, it will find the correct line z/b.xxx:3 for
offset 0x40. The first cycle erroneously finds the line in z/a.xxx due to this
overlap.


rev.200186

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140210/df14f781/attachment.html>


More information about the llvm-bugs mailing list