Combine Go Stacks

Paste Go stack traces in text format, and get a report with the same traces combined. This is useful for figuring out what a big program was doing when it crashed. See my blog post for details. The code powering this is panicparse, which is a great tool!

NOTE: PanicParse currently breaks with the new Go 1.17 stack trace format. Use Hacky Parser instead.

To get stacks, send SIGQUIT to the process, but it will kill the process. You can also use the pprof handler: curl http://localhost:12345/debug/pprof/goroutine?debug=2

Alternative file upload:

Example Input

goroutine 182 [semacquire]:
main.b2(0xc000192068)
  /Users/ej/combinestacks/stackdemo/stackdemo.go:86 +0x66
main.b1(0xc000192068)
  /Users/ej/combinestacks/stackdemo/stackdemo.go:82 +0x2b
created by main.main
  /Users/ej/combinestacks/stackdemo/stackdemo.go:41 +0x367

goroutine 182 [semacquire]:
main.b2(0xc000192068)
  /Users/ej/combinestacks/stackdemo/stackdemo.go:86 +0x66
main.b1(0xc000192068)
  /Users/ej/combinestacks/stackdemo/stackdemo.go:82 +0x2b
created by main.main
  /Users/ej/combinestacks/stackdemo/stackdemo.go:41 +0x367

Example Output

Found 2 total goroutines

2 goroutines; example goroutine=182; state=[semacquire]
main.b2(0xc000192068)
	/Users/ej/combinestacks/stackdemo/stackdemo.go:86
main.b1(0xc000192068)
	/Users/ej/combinestacks/stackdemo/stackdemo.go:82
created by main.main
	/Users/ej/combinestacks/stackdemo/stackdemo.go:41