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

            Bug ID: 33154
           Summary: addr2line ignores subroutines with DW_AT_ranges of
                    form DW_FORM_rnglistx
           Product: binutils
           Version: 2.46 (HEAD)
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: binutils
          Assignee: unassigned at sourceware dot org
          Reporter: michal.chojnowski at scylladb dot com
  Target Milestone: ---

In dwarf 5, DW_AT_ranges might have form DW_FORM_rnglistx. But addr2line (bfd)
can't handle this form. (If it sees a non-integer form for DW_AT_ranges, it
ignores the entry. IIUC, this happens here, in the `is_int_form` call:
https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=bfd/dwarf2.c;h=a62c952374378a39c8d7896e0728ff9581ada349;hb=HEAD#l4172
)

This results in missing entries in the output of `addr2line`. In particular, we
have seen things like

```
func_a() at c.hh:123
```

being output instead of the expected

```
func_c() at c.hh:123
 (inlined by) func_b() at b.hh:456
 (inlined by) func_a() at a.hh:789
```

Unlike addr2line 2.46, llvm-addr2line 20.1.7 shows those inlined function
frames correctly.

We started seeing the problem right after upgrading our application from clang
19 to clang 20. If that's not just a coincidence, maybe something changed in
LLVM 20 which causes it to emit DW_FORM_rnglistx more often (or to emit it at
all).

I haven't attached a reproducer because I don't know how to nudge the compiler
to generate DW_FORM_rnglistx reliably, I don't know how to write a DWARF tests
sample manually, and I hope that the issue is clear enough from the
description. (A test isn't needed to prove that bfd just doesn't have any logic
to handle DW_FORM_rnglistx, right)?

But I could try finding some decently small C++ reproducer, (or link a big
application executable which exhibits the problem), if that's helpful.

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

Reply via email to