Way to reproduce:
1. fetch http://slonopotamus.org/libUE4Editor-Core.so (warning, 50MB)
2. addr2line -f -e libUE4Editor-Core.so +0x2c09b2
Expected output,given by addr2line from GNU binutils and gdb (and I in fact know that this is what I want to get):
I have already reported this to elftoolchain project, though am not sure whether I should (not) also report this to FreeBSD.
For the reference, elftoolchain bug reports (note that it crashes with -f, unlike FreeBSD addr2line):
Additional info on various addr2line implementations misbehaving on this testcase: https://github.com/gimli-rs/addr2line/issues/35#issue-213881844
I've sent a patch to elftoolchain that fixes filename/lineno resolving: https://sourceforge.net/p/elftoolchain/tickets/545/#6d97 although elftoolchain devs seem to be reacting kinda slowly.
Also, gimli (Rust addr2line implementation) was fixed and is now consistent with binutils and llvm-symbolizer. So it seems like my testcase is valid, it's addr2line implementations misbehaving.
(In reply to Marat Radchenko from comment #2)
Thank you for the patch - I've replied with a few comments over there. We should be able to get this into FreeBSD in the next few days.
A commit references this bug:
Date: Wed Feb 12 21:52:10 UTC 2020
New revision: 357844
addr2line: Handle DW_AT_ranges in compile units
Based on original submission by Marat Radchenko in ELF Tool Chain
ticket #545, rebased and updated by Tiger Gao.
Submitted by: Marat Radchenko <firstname.lastname@example.org>
Submitted by: Tiger Gao <email@example.com>
Reviewed by: markj
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D23501