{"id":13397012,"url":"https://github.com/maruel/panicparse","last_synced_at":"2025-05-13T20:05:52.578Z","repository":{"id":26710231,"uuid":"30167459","full_name":"maruel/panicparse","owner":"maruel","description":"Crash your app in style (Golang)","archived":false,"fork":false,"pushed_at":"2025-03-13T21:04:49.000Z","size":2605,"stargazers_count":3659,"open_issues_count":3,"forks_count":100,"subscribers_count":39,"default_branch":"main","last_synced_at":"2025-05-06T19:52:10.036Z","etag":null,"topics":["crash","go","panic","stack-traces"],"latest_commit_sha":null,"homepage":"https://maruel.ca","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/maruel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-02-02T02:14:41.000Z","updated_at":"2025-05-02T16:00:23.000Z","dependencies_parsed_at":"2022-07-12T05:18:34.272Z","dependency_job_id":"840c05bb-c062-4c3f-bdb5-67bf00d4f5bc","html_url":"https://github.com/maruel/panicparse","commit_stats":{"total_commits":384,"total_committers":16,"mean_commits":24.0,"dds":"0.21354166666666663","last_synced_commit":"a67acbb1be08722cbfb23fcfff41ed435b9fd329"},"previous_names":[],"tags_count":29,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maruel%2Fpanicparse","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maruel%2Fpanicparse/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maruel%2Fpanicparse/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maruel%2Fpanicparse/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maruel","download_url":"https://codeload.github.com/maruel/panicparse/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254020478,"owners_count":22000750,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["crash","go","panic","stack-traces"],"created_at":"2024-07-30T18:01:09.284Z","updated_at":"2025-05-13T20:05:52.553Z","avatar_url":"https://github.com/maruel.png","language":"Go","readme":"# panicparse\n\nParses panic stack traces, densifies and deduplicates goroutines with similar\nstack traces. Helps debugging crashes and deadlocks in heavily parallelized\nprocess.\n\n[![PkgGoDev](https://pkg.go.dev/badge/github.com/maruel/panicparse/v2/stack)](https://pkg.go.dev/github.com/maruel/panicparse/v2/stack)\n[![codecov](https://codecov.io/gh/maruel/panicparse/branch/main/graph/badge.svg?token=izj1cLjUi3)](https://codecov.io/gh/maruel/panicparse)\n[![go-recipes](https://raw.githubusercontent.com/nikolaydubina/go-recipes/main/badge.svg?raw=true)](https://github.com/nikolaydubina/go-recipes#-pretty-print-panic-messages)\n\n\npanicparse helps make sense of Go crash dumps:\n\n![Screencast](https://raw.githubusercontent.com/wiki/maruel/panicparse/parse.gif \"Screencast\")\n\n\n## Features\n\n   * Race detector support, e.g. it can parse output produced by `go test -race`\n   * HTML export.\n   * Easy to use as an [HTTP Handler\n     middleware](https://pkg.go.dev/github.com/maruel/panicparse/v2/stack#example-package-HttpHandlerMiddleware).\n   * High performance parsing.\n   * [HTTP web server](https://pkg.go.dev/github.com/maruel/panicparse/v2/stack/webstack#SnapshotHandler)\n     that serves a very tight and swell snapshot of your goroutines, much more\n     readable than [net/http/pprof](https://pkg.go.dev/net/http/pprof).\n   * \u0026gt;50% more compact output than original stack dump yet more readable.\n   * Deduplicates redundant goroutine stacks. Useful for large server crashes.\n   * Arguments as pointer IDs instead of raw pointer values.\n   * Pushes stdlib-only stacks at the bottom to help focus on important code.\n   * Parses the source files if available to augment the output.\n   * Works on any platform supported by Go, including Windows, macOS, linux.\n   * Full go module support.\n   * Requires \u003e=go1.17. Use v2.3.1 for older Go versions.\n\n\n## Installation\n\n    go install github.com/maruel/panicparse/v2/cmd/pp@latest\n\n\n## Usage\n\n### Piping a stack trace from another process\n\n#### TL;DR\n\n   * Ubuntu (bash v4 or zsh): `|\u0026`\n   * macOS, [install bash 4+](README.md#updating-bash-on-macos), then: `|\u0026`\n   * Windows _or_ macOS with stock bash v3: `2\u003e\u00261 |`\n   * [Fish](http://fishshell.com/) shell: `\u0026|`\n\n\n#### Longer version\n\n`pp` streams its stdin to stdout as long as it doesn't detect any panic.\n`panic()` and Go's native deadlock detector [print to\nstderr](https://golang.org/src/runtime/panic1.go) via the native [`print()`\nfunction](https://golang.org/pkg/builtin/#print).\n\n\n**Bash v4** or **zsh**: `|\u0026` tells the shell to redirect stderr to stdout,\nit's an alias for `2\u003e\u00261 |` ([bash\nv4](https://www.gnu.org/software/bash/manual/bash.html#Pipelines),\n[zsh](http://zsh.sourceforge.net/Doc/Release/Shell-Grammar.html#Simple-Commands-_0026-Pipelines)):\n\n    go test -v |\u0026pp\n\n\n**Windows or macOS native bash** [(which is\n3.2.57)](http://meta.ath0.com/2012/02/05/apples-great-gpl-purge/): They don't\nhave this shortcut, so use the long form:\n\n    go test -v 2\u003e\u00261 | pp\n\n\n**Fish**: `\u0026|` redirects stderr and stdout. It's an alias for `2\u003e\u00261 |`\n([fish piping](https://fishshell.com/docs/current/language.html#piping)):\n\n    go test -v \u0026| pp\n\n\n**PowerShell**: [It has broken `2\u003e\u00261` redirection](https://connect.microsoft.com/PowerShell/feedback/details/765551/in-powershell-v3-you-cant-redirect-stderr-to-stdout-without-generating-error-records). The workaround is to shell out to cmd.exe. :(\n\n\n### Investigate deadlock\n\nOn POSIX, use `Ctrl-\\` to send SIGQUIT to your process, `pp` will ignore\nthe signal and will parse the stack trace.\n\n\n### Parsing from a file\n\nTo dump to a file then parse, pass the file path of a stack trace\n\n    go test 2\u003e stack.txt\n    pp stack.txt\n\n\n## Tips\n\n### Disable inlining\n\nThe Go toolchain inlines functions when it can. This causes traces to be less\ninformative. Optimization also interfere with traces. You can use the following\nto help diagnosing issues:\n\n    go install -gcflags '-N -l' path/to/foo\n    foo |\u0026 pp\n\nor\n\n    go test -gcflags '-N -l' ./... |\u0026 pp\n\n\nRun `go tool compile -help` to get the full list of valid values for -gcflags.\n\n\n### GOTRACEBACK\n\nBy default, [`GOTRACEBACK`](https://golang.org/pkg/runtime/) defaults to\n`single`, which means that a panic will only return the current goroutine trace\nalone. To get all goroutines trace and not just the crashing one, set the\nenvironment variable:\n\n    export GOTRACEBACK=all\n\nor `set GOTRACEBACK=all` on Windows. Probably worth to put it in your `.bashrc`.\n\n\n### Updating bash on macOS\n\nInstall bash v4+ on macOS via [homebrew](http://brew.sh) or\n[macports](https://www.macports.org/). Your future self will appreciate having\ndone that.\n\n\n### If you have `/usr/bin/pp` installed\n\nIf you try `pp` for the first time and you get:\n\n    Creating tables and indexes...\n    Done.\n\nand/or\n\n    /usr/bin/pp5.18: No input files specified\n\nyou may be running the _Perl PAR Packager_ instead of panicparse.\n\nYou have two choices, either you put `$GOPATH/bin` at the beginning of `$PATH`\nor use long name `panicparse` with:\n\n    go install github.com/maruel/panicparse/v2@latest\n\nthen using `panicparse` instead of `pp`:\n\n    go test 2\u003e panicparse\n\nHint: You may also use shell aliases\n\n    alias gp=panicparse\n    go test 2\u003e gp\n\n    alias p=panicparse\n    go test 2\u003e p\n\n\n### webstack in action\n\nThe\n[webstack.SnapshotHandler](https://pkg.go.dev/github.com/maruel/panicparse/v2/stack/webstack#SnapshotHandler)\nhttp.Handler enables glancing at at a snapshot of your process trivially:\n\n![Screencast](https://raw.githubusercontent.com/wiki/maruel/panicparse/panicparse_webstack.gif \"Screencast\")\n\n\n## Authors\n\n`panicparse` was created with ❤️️ and passion by [Marc-Antoine\nRuel](https://github.com/maruel) and\n[friends](https://github.com/maruel/panicparse/graphs/contributors).\n","funding_links":[],"categories":["Go","Go Compile Helpers","Utilities","實用工具","Dynamic Analysis Tools","工具库","Utility","实用工具","工具库`可以提升效率的通用代码库和工具`","公用事业公司","Repositories"],"sub_categories":["Contents","Utility/Miscellaneous","高級控制台界面","HTTP Load testing","交流","查询语","HTTP Clients","Advanced Console UIs","\u003cspan id=\"高级控制台用户界面-advanced-console-uis\"\u003e高级控制台用户界面 Advanced Console UIs\u003c/span\u003e","实用程序/Miscellaneous","Fail injection","高级控制台界面"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaruel%2Fpanicparse","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaruel%2Fpanicparse","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaruel%2Fpanicparse/lists"}