Skip to content

Instantly share code, notes, and snippets.

@pcolazurdo
Created April 10, 2022 09:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pcolazurdo/bb26dfe3f5e8a186dd4367401f94bb85 to your computer and use it in GitHub Desktop.
Save pcolazurdo/bb26dfe3f5e8a186dd4367401f94bb85 to your computer and use it in GitHub Desktop.
How to analyse GOLANG Panic results
# Assumes you are capturing the output of your golang app panic into /tmp/crash
# Reason of the panic
head -3 /tmp/crash
# Register status (22 may change in different architectures)
tail -22 /tmp/crash
# Number of goroutines
cat /tmp/crash | grep goroutine | wc -l
# Will count the goroutines states
cat /tmp/crash | grep goroutine | awk '{print $3,$4}' | sort | uniq -c | sort -n
# will count goroutines modules freq
bat /tmp/crash | grep -a1 goroutine | grep -v goroutine | cut -d. -f1 | sort | uniq -c | sort -n
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment