Menu

#545 addr2line incorrectly resolves filename/lineno

RELEASE_1_0
new
nobody
None
2020-02-12
2017-03-10
No

Binary file: http://slonopotamus.org/libUE4Editor-Core.so (warning, 50MB)

GNU binutils gives correct result:

$ addr2line -e libUE4Editor-Core.so +0x2c09b2
/home/marat/production/ue4/Engine/Source/Runtime/Core/Private/Linux/LinuxPlatformCrashContext.cpp:595

elftoolchain gives incorrect result:

$ elftoolchain-0.7.1/addr2line/addr2line -e /home/marat/production/ue4/Engine/Binaries/Linux/libUE4Editor-Core.so +0x2c09b2
Runtime/Core/Public/Delegates/DelegateInstancesImpl.h:869

Discussion

  • Marat Radchenko

    Marat Radchenko - 2017-03-10

    Err, I cannot edit ticket for some reason =/ Title should say "filename/lineno"

     
  • Marat Radchenko

    Marat Radchenko - 2017-03-16

    See attached patch. It fixes filename/lineno resolving for my testcase. I am not sure it doesn't break anything since my DWARF experience is just several days.

     
  • Ed Maste

    Ed Maste - 2017-03-17
    • summary: addr2line incorrectly resolves filename/address --> addr2line incorrectly resolves filename/lineno
     
  • Ed Maste

    Ed Maste - 2017-03-17

    Thank you for the patch Marat. There's a minor issue with an unused variable warning when I built, but it addresses the issue and looks reasonable.

    I think we will want to implement some caching / improved lookup; so I'm not sure about getting rid of the culist.

    We should explicitly check that dwr_type is DW_RANGES_ENTRY in the fallthrough case.

    Also I think we should refactor the address range lookup logic into a separate function because translate() is getting rather long. If you'd like to have a go at that I'll review a new patch. (Otherwise I'll take care of it and commit.)

     
  • Marat Radchenko

    Marat Radchenko - 2017-03-17

    WRT culist - I removed it because otherwise code would become even more compicated (I'm jumping out of ranges loop currently). Looking at other addr2line implementations, culist shouldn't be needed, all data about address is supposed to be in a single compile unit. Unused variable - will fixed that tomorrow. WRT refactoring - I'll try to extract range search function so it is reused for compilation units and functions.

     
  • Marat Radchenko

    Marat Radchenko - 2017-03-19

    See new attached patch. I introduced a separate function that performs range checking, although didn't use it in function name resolving yet, it will be part of ticket #546.

     

    Last edit: Marat Radchenko 2017-03-19
  • Marat Radchenko

    Marat Radchenko - 2017-03-21

    Nooo, my fix is wrong. I haven't noticed that function names resolving uses "cu", now it is completely broken. Working on new iteration.

     
    • Ed Maste

      Ed Maste - 2017-08-23

      Any update on the new iteration?

       
      • Marat Radchenko

        Marat Radchenko - 2017-08-26

        Whoops, this somehow completely fell off from my todo-list. Will work on it this weekend.

         
  • Marat Radchenko

    Marat Radchenko - 2017-08-27

    Attached updated patch.

    Note that it does not neither fix bug #546 nor bug #552

     
  • Ed Maste

    Ed Maste - 2020-02-12

    Finally committed to FreeBSD, will be upstreamed soon.

    Author: emaste
    Date: Wed Feb 12 21:52:10 UTC 2020
    New revision: 357844
    URL: https://svnweb.freebsd.org/changeset/base/357844
    
     

Log in to post a comment.

MongoDB Logo MongoDB