Bug 217736 - addr2line incorrectly resolves filename/lineno/function
Summary: addr2line incorrectly resolves filename/lineno/function
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 11.0-RELEASE
Hardware: Any Any
: --- Affects Some People
Assignee: Ed Maste
URL:
Keywords:
Depends on:
Blocks: 231027
  Show dependency treegraph
 
Reported: 2017-03-13 08:54 UTC by Marat Radchenko
Modified: 2018-08-31 20:19 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marat Radchenko 2017-03-13 08:54:28 UTC
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):

  _Z20PlatformCrashHandleriP9siginfo_tPv
  /home/marat/production/ue4/Engine/Source/Runtime/Core/Private/Linux/LinuxPlatformCrashContext.cpp:595

Actual output:

  ??
  Runtime/Core/Public/Delegates/DelegateInstancesImpl.h:869

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):

https://sourceforge.net/p/elftoolchain/tickets/545/
https://sourceforge.net/p/elftoolchain/tickets/546/
Comment 1 Marat Radchenko 2017-03-13 20:06:58 UTC
Additional info on various addr2line implementations misbehaving on this testcase: https://github.com/gimli-rs/addr2line/issues/35#issue-213881844
Comment 2 Marat Radchenko 2017-03-17 20:25:48 UTC
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.
Comment 3 Marat Radchenko 2017-03-17 20:26:49 UTC
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.
Comment 4 Ed Maste freebsd_committer 2017-03-17 22:22:06 UTC
(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.