Debugging concurrency programs in Go
summary
Shows concrete techniques: run-time tracing with GOMAXPROCS tweaks and GODEBUG=schedtrace to see scheduler-to-thread mapping, inspect goroutine stacks and channel buffers, and set conditional breakpoints to hit a specific goroutine. Demonstrates using delve and gdb to list goroutines, print goroutine backtraces, and inspect channel internals; explains why Go only reports a deadlock when all goroutines sleep and recommends go-deadlock-like libraries and practices to find leaking or blocked goroutines.
AI-written summary · about
chapters (14)
- 0:00Introduction to debugging concurrency
- 1:34Why concurrency debugging is hard
- 4:27What is a goroutine
- 6:16Using Go Playground for debugging
- 7:46Visualizing goroutines with colors
- 10:16Tracing with GODEBUG
- 12:29Debugging with Delve basics
- 13:56Debugging goroutines with Delve
- 22:18Debugging channels in Go
- 26:55Using GDB for Go debugging
- 29:46Detecting deadlocks in Go
- 32:41Seven rules for concurrency debugging
- 35:15References and resources
- 36:21Q&A session
related talks
24mMastering Concurrency in Go: From Patterns to Production
35mGoroutines: the dark side of the runtime
44mGo Profiling and Observability from Scratch
16mIn the land of Gophers from age 3
16mIn the Land of Gophers (from Age 3)
14mDr Gopher, Anatomy of the Scheduler
49mDeep dive into the Go scheduler, or Why would I steal goroutines?
47mQueues, Fairness, and The Go Scheduler
