Skip to content

Debugging concurrent programs

Category: Testing and tools · Status: stub · Lessons: chapter 09, Testing and tools (planned)

One line: Thread dumps, deadlock detectors and tracing that show what every thread or task is waiting for at a given moment.

Also called: thread dump, deadlock detection, goroutine dump, stack dump.

How it connects

In each language

Go SIGQUIT (Ctrl-backslash) makes a program exit with a stack dump ↗; runtime/pprof has goroutine, block and mutex profiles
Java jcmd Thread.print prints all threads with stack traces; ThreadMXBean.findDeadlockedThreads finds cycles of deadlocked threads
Python faulthandler.dump_traceback dumps the tracebacks of all threads, also after a timeout or on a signal
C# dotnet-stack inspects managed stack traces
Elsewhere GDB ↗ thread apply all bt applies bt to every thread, printing a backtrace for each

Where to read more