Skip to content

rshmelev/panicparse

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

panicparse

Parses panic stack traces, densifies and deduplicates goroutines with similar stack traces. Helps debugging crashes and deadlocks in heavily parallelized process.

GoDoc Build Status

Features

  • 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.

Screenshot

Converts this hard to read stack dump into something nicer:

Screenshot

Installation

go get github.com/maruel/panicparse/cmd/pp

Usage

Piping a stack trace from another process

Run test and prints a concise stack trace upon deadlock in bash

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.

On Windows, use:

go test -v 2>&1 | pp

Investigate deadlock

On POSIX, use Ctrl-\ to send SIGQUIT to your process, pp will ignore the signal and will parse the stack trace.

Parsing from a file

To dump to a file then parse, pass the file path of a stack trace

go test 2> stack.txt
pp stack.txt

If you have /usr/bin/pp installed

You may have the Perl PAR Packager installed. Use long name panicparse then;

go get github.com/maruel/panicparse

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%