Giter Site home page Giter Site logo

deadlock's People

Contributors

linkdata avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

deadlock's Issues

removing goid as dependency

Hi , thanks for the revival :)

When compiling with garble im facing an issue with goid

# github.com/petermattis/goid
/tmp/garble-shared1926219085/EBih0wwzivaK/NOrHNRTEp.s:29: expected pseudo-register; found R14
asm: assembly of /tmp/garble-shared1926219085/EBih0wwzivaK/NOrHNRTEp.s failed

while it looks like a garble issue with build tags, after looking at goid, it looks like since go 1.8 only the slow version is used anyway.

so to fix this i added a goid.go file in deadlock with this code :

package deadlock

import (
        "bytes"
        "runtime"
        "strconv"
)


func ExtractGID(s []byte) int64 {
        s = s[len("goroutine "):]
        s = s[:bytes.IndexByte(s, ' ')]
        gid, _ := strconv.ParseInt(string(s), 10, 64)
        return gid
}

// Parse the goid from runtime.Stack() output. Slow, but it works.
func GetGID() int64 {
        var buf [64]byte
        return ExtractGID(buf[:runtime.Stack(buf[:], false)])
}

and replace the goid.xx function with those one. Like this all works for me and the garble compilation succeed.

Dunno if you would be interested to also add it to this fork.

Best Regards

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.