Parses panic stack traces, densifies and deduplicates goroutines with similar stack traces. Helps debugging crashes and deadlocks in heavily parallelized process.
(Source)
-
50% more compact output than original stack dump yet more readable.
- Exported symbols are bold, private symbols are darker.
- Stdlib is green, main is yellow, rest is red.
- Deduplicate redundant goroutine stacks. Useful for large server crashes.
- Arguments as pointer IDs instead of raw pointer values.
- Pushes stdlib-only stacks at the bottom to help focus on important code.
- Usable as a library!
- Works on Windows.
go get github.com/maruel/panicparse/cmd/pp
- Ubuntu:
|&
- OSX, install bash 4+ then:
|&
- Windows or OSX with bash v3:
2>&1 |
Run test and prints a concise stack trace upon deadlock in bash v4:
go test -v |&pp
|&
tells bash to redirect stderr to stdout,
it's an alias for 2>&1 |
.
panic() and Go's native deadlock detector always print to stderr.
pp
streams its stdin to stdout as long as it doesn't detect any panic.
On Windows or OSX native bash (which is 3.2.57), use:
go test -v 2>&1 | pp
On POSIX, use Ctrl-\
to send SIGQUIT to your process, pp
will ignore
the signal and will parse the stack trace.
To dump to a file then parse, pass the file path of a stack trace
go test 2> stack.txt
pp stack.txt
You may have the Perl PAR Packager installed. Use long name panicparse
then;
go get github.com/maruel/panicparse
(Source)