panicparse

command module
v0.0.0-...-b9b8c0f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 20, 2015 License: Apache-2.0 Imports: 3 Imported by: 0

README

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

Documentation

Overview

panicparse: analyzes stack dump of Go processes and simplifies it.

It is mostly useful on servers will large number of identical goroutines, making the crash dump harder to read than strictly necesary.

Colors:

  • Magenta: first goroutine to be listed.
  • Yellow: main package.
  • Green: standard library.
  • Red: other packages.

Bright colors are used for exported symbols.

Directories

Path Synopsis
Godeps
_workspace/src/github.com/mgutz/ansi
Package ansi is a small, fast library to create ANSI colored strings and codes.
Package ansi is a small, fast library to create ANSI colored strings and codes.
cmd
pp
panicparse: analyzes stack dump of Go processes and simplifies it.
panicparse: analyzes stack dump of Go processes and simplifies it.
panicparse: analyzes stack dump of Go processes and simplifies it.
panicparse: analyzes stack dump of Go processes and simplifies it.
Package stack analyzes stack dump of Go processes and simplifies it.
Package stack analyzes stack dump of Go processes and simplifies it.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL