linkdata / deadlock Goto Github PK
View Code? Open in Web Editor NEWDeadlock detection for Go
License: MIT License
Deadlock detection for Go
License: MIT License
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.