Giter VIP home page Giter VIP logo

Comments (10)

svalat avatar svalat commented on August 26, 2024

In case someone want to look :

//Gentoo now enable -fPIE by default on executable so we need to detect the case

from malt.

svalat avatar svalat commented on August 26, 2024

Seems to have improvement with -j .text on addr2line but that does not solve all.

from malt.

svalat avatar svalat commented on August 26, 2024

That should be due to KASLR, solution might be to inspirate from what is one in : https://github.com/torvalds/linux/blob/master/scripts/faddr2line

from malt.

svalat avatar svalat commented on August 26, 2024

Solution might be coming from here : https://jvns.ca/blog/2018/01/09/resolving-symbol-addresses/

At least in code on my exemple it works by doing this by hand :

addr2lineCmd << ' '  << (void*)(((size_t)it->first - (size_t)procMapEntry->lower) + (size_t)0x402270);

With 0x402270 coming from readelf -h simple-case-finstr-linked or objdump (Entry point address or vaddr).

from malt.

svalat avatar svalat commented on August 26, 2024

This should also fix on other distro which now also enable by default fPIE and ASLR

from malt.

svalat avatar svalat commented on August 26, 2024

Damn, still get issue on Gentoo, there is a gap with what happen on Centos/Redhat.

On Centos/Redhat, this is OK for the main binary:

addr2lineCmd << ' '  << (void*)(((size_t)it->first - (size_t)procMapEntry->lower));

On Gentoo I need:

addr2lineCmd << ' '  << (void*)(((size_t)it->first - (size_t)procMapEntry->lower + elfVaddr));

Need to find a way to automatically detect case or add an option for last resort.

Possibility:

  • OS version checking (not nice)
  • Test the two case and check which one return a valid line (also not nice, can return another location on big binaries).
  • really understand (would be nice).

from malt.

svalat avatar svalat commented on August 26, 2024

Also have issue on Ubuntu 19/04

from malt.

svalat avatar svalat commented on August 26, 2024

Other infos related : https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=860394

from malt.

svalat avatar svalat commented on August 26, 2024

One can temporarily solve the issue vy --no-pie the compilation of the executables to be profiled. But that's not a real solution for long term.

from malt.

svalat avatar svalat commented on August 26, 2024

Finally found a solution by looking here : https://stackoverflow.com/questions/55066749/how-to-find-load-relocation-for-a-pie-binary

from malt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.