Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/napsy/findlock
Parses Go tracebacks and finds possible deadlocks
https://github.com/napsy/findlock
Last synced: 8 days ago
JSON representation
Parses Go tracebacks and finds possible deadlocks
- Host: GitHub
- URL: https://github.com/napsy/findlock
- Owner: napsy
- License: mit
- Created: 2019-05-22T05:58:21.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-07-11T17:04:06.000Z (over 4 years ago)
- Last Synced: 2024-06-20T15:54:16.166Z (5 months ago)
- Language: Go
- Size: 7.81 KB
- Stars: 26
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# findlock
Parses Go tracebacks and finds possible deadlocksThis works by checking how many locks have the same memory address. If there are multiple goroutines with the same lock but have the same stack trace, then only one entry is shown. The tool is not perfect but helped me to find locks where I would have over 10k goroutines.
Example usage:
```
$ ~/projects/findlock/findlock stack.txt
DETECTED 2 POSSIBLE DEADLOCK(S)
- 1 call(s) to Lock() for 0xc03d73ba84, 1 unique:
┌┤ sync.runtime_SemacquireMutex @ /usr/local/go/src/runtime/sema.go:71
├ 0: sync.runtime_SemacquireMutex @ /usr/local/go/src/runtime/sema.go:71
├ 1: sync.(*Mutex).lockSlow @ /usr/local/go/src/sync/mutex.go:138
├ 2: sync.(*Mutex).Lock @ /usr/local/go/src/sync/mutex.go:81
├ 3: main.clientDatabaseChange @ /tmp/projects/go/src/proj1/cmd/runner/database-changes.go:22
├ 4: main.refresh @ /tmp/projects/go/src/proj1/cmd/runner/sync.go:53
├ 5: proj1/pkg/db.(*PostgresDB).HandleChanges @ /tmp/projects/go/src/proj1/pkg/db/postgresql.go:271
└ 6: main.initOrDie.func2 @ /tmp/projects/go/src/proj1/cmd/runner/sync.go:111
- 1 call(s) to Lock() for 0xc0003b2028, 1 unique:
┌┤ sync.runtime_Semacquire @ /usr/local/go/src/runtime/sema.go:56
├ 0: sync.runtime_Semacquire @ /usr/local/go/src/runtime/sema.go:56
├ 1: sync.(*WaitGroup).Wait @ /usr/local/go/src/sync/waitgroup.go:130
├ 2: google.golang.org/grpc.(*Server).serveStreams @ /root/go/pkg/mod/google.golang.org/[email protected]/server.go:731
└ 3: google.golang.org/grpc.(*Server).handleRawConn.func1 @ /root/go/pkg/mod/google.golang.org/[email protected]/server.go:679```