Coder Social home page Coder Social logo

Slice out of range error about gore HOT 4 CLOSED

goretk avatar goretk commented on July 17, 2024
Slice out of range error

from gore.

Comments (4)

TcM1911 avatar TcM1911 commented on July 17, 2024 1

Nice find. I raised #11. I'll see if I can get it fixed ASAP.

from gore.

TcM1911 avatar TcM1911 commented on July 17, 2024

@capnspacehook, this is a known issue. This caused when incorrect compiler version is detected for the binary.

github.com/goretk/gore.getLegacyTypes(0xc0000c6540, 0x56cec0, 0xc00000e040, 0xa, 0xffffffffffffffff, 0x8)
        github.com/goretk/gore/type.go:107 +0x235

is logic for parsing versions prior to 1.7. Since the data structures in these versions are very different this can happen.

When analysing the library with the library this usually happens because the markers for different versions are included in the library.... If you know the version, you can force the assumed version by for example calling file.SetGoVersion("go1.13") after opening the file.

Until a better way for determining the version, this is the current solution.

With the release 1.13, a functionality for extracting the version was added but it only works for 1.13 and later stripped binaries:

[gore]$ file testdata/gold/gold-linux-amd64-1.13
testdata/gold/gold-linux-amd64-1.13: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, Go BuildID=YWmIDeHrc37MnKyHo53S/hGdyCvxmA0ZSwHA56vwG/cthDW6MiJGhvIw_Mk5x0/egx2QKll4Xf19HLolX0e, stripped
[gore]$ go version testdata/gold/gold-linux-amd64-1.13
testdata/gold/gold-linux-amd64-1.13: go1.13
[gore]$ file testdata/gold/gold-linux-amd64-1.12.0
testdata/gold/gold-linux-amd64-1.12.0: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, Go BuildID=W11rzA8dxCieF64mk9rO/wmqBULPx6tMOdPbSBabM/X40xrZ4nVRHkrWOKbwZw/JpQDPeWBsrG9Rn_jzf3s, stripped
[gore]$ go version testdata/gold/gold-linux-amd64-1.12.0
testdata/gold/gold-linux-amd64-1.12.0: go version not found

from gore.

capnspacehook avatar capnspacehook commented on July 17, 2024

Ok that makes sense, thanks. I will try explicitly setting the Go version. I know some other binaries I tested threw a different error, I think related to the fact that the buildID wasn't compiled in the with the flag -ldflags "buildid=" . I will do some more testing and update the issue.

from gore.

capnspacehook avatar capnspacehook commented on July 17, 2024

Thanks for the quick fix! Tested the upgraded redress and the issue is fixed!

from gore.

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.