GithubHelp home page GithubHelp logo

Comments (6)

philipc avatar philipc commented on June 18, 2024

Couldn't download the file (I've requested access), but I guess we'll need to handle overlapping ranges in a manner similar to #163

from addr2line.

mstange avatar mstange commented on June 18, 2024

Sorry, I've updated the sharing settings (got confused by new UI).

from addr2line.

philipc avatar philipc commented on June 18, 2024

That file contains a lot of functions that are at the same address:

0003c91f T _Unwind_Complete
0003c91f t _ZN15google_breakpad11StackwalkerD2Ev
0003c91f t _ZN15google_breakpad13CFIRuleParser7HandlerD2Ev
0003c91f t _ZN15google_breakpad13ModuleFactoryD2Ev
0003c91f t _ZN15google_breakpad14ExploitabilityD2Ev
0003c91f t _ZN15google_breakpad14MinidumpModule18SetShrinkDownDeltaEy
0003c91f t _ZN15google_breakpad14MinidumpObjectD2Ev
0003c91f t _ZN15google_breakpad22MinidumpUnloadedModule18SetShrinkDownDeltaEy
0003c91f t _ZN17SharedLibraryInfo10InitializeEv
0003c91f t _ZN19MappableExtractFile8finalizeEv
0003c91f t _ZN19ReplaceMallocBridge25DisablePHCOnCurrentThreadEv
0003c91f t _ZN19ReplaceMallocBridge26ReenablePHCOnCurrentThreadEv

etc.

It's fine if I change the assert to this:

        debug_assert!(addresses
            .windows(2)
            .all(|w| w[0].range.end <= w[1].range.begin || w[0].range == w[1].range));

but I think we probably should delete the assert, because it could still trigger for other unlikelier cases. Not sure if we should be trying to handle function ranges that are overlapping but not equal. Can you think of any situation in which that might occur?

from addr2line.

mstange avatar mstange commented on June 18, 2024

Interesting. Thanks for looking into this!

The contents of that function (which for me is at 3c91e rather than 3c91f, for some reason) is just a single instruction: bx lr. According to the internet, this means "Return, and possibly mode switch, depending on the value in the lr register". So it seems like it's basically an empty function. And looking up some of its names in the source, many of them seem to be empty virtual destructors, for example virtual ~MinidumpObject() {}. Since the method is virtual, there needs to be an address for it that can be put in a vtable, so my guess is that this function is just "the empty function" that you can take the address of.

Requiring ranges to be equal if they overlap sounds fine to me, until we see counter-examples. But the bad cases should report an error rather than panicking. Having a library panic on bad input, even if it only happens in debug builds, is quite disruptive.

from addr2line.

philipc avatar philipc commented on June 18, 2024

I'm not sure that we should even return an error for bad cases, since they won't prevent symbolication of the non-overlapping functions. Currently this crate only returns errors for parsing errors, rather than semantic errors too. e.g. if a range has low_pc > high_pc then we ignore it.

from addr2line.

mstange avatar mstange commented on June 18, 2024

Oh I see, that sounds good too. Thanks for the fix!

from addr2line.

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.