Debugging Go – record and replay
It’s been 10 years since the Go programming language was released to the world as a fledgling open source project. Happy Birthday Go! 🎉
In just under a decade, Go has become the popular language of choice for rapid development of web applications, modern cloud networking and DevOps software. Go is all grown up – but debugging Go is still learning to walk.
Debugging in any programming language is an essential aspect in building robust and reliable software applications. When Go was first released, there were limited options for debugging Go code. Most debugging work was handled by the open-sourced debugger “GDB”.
This was a start, but GDB was not designed to work with several features of this modern language, notably Goroutines. As a result, Go bug hunters needed better tools. Several attempts to address the lack of native debugger for Go were made over the years, but eventually, Derek Parker’s Delve tool took the lead.
Crucially, Delve is a debugger that was built especially for Go programming. It is designed to be ‘Go-centric’ and easy to use. Delve understands the Go runtime, data structures, and expressions much better than the more generic GDB.
But until late 2019, traditional methods of debugging in Go using Delve, continued to rely on being able to reproduce software failures. Older, conventional debugging techniques allowed scrutiny of program execution only in the forward direction. This is a very slow method of identifying bugs and failures, that relies on a lot of trial and error guesswork.
At Undo, we recognized the opportunity to speed up Go software failure diagnosis, by extending the capabilities of the LiveRecorder platform to record the execution history of applications written in Go. Instead of spending time on reproducing bugs in order to fix them, LiveRecorder now simply records ‘what happened’ when the failure took place.
A recording simply gives a carbon copy of what actually occurred in your Go application code – no reproducibility time needed! Software engineers can now speed up defect diagnosis by loading the recording of any failure that occurs, into their usual GoLand IDE and Delve debuggers. There, they can step through the recording forwards and backwards using LiveRecorder’s reverse-debugging capability.
Time-to-resolution is accelerated and with the recording, DevOps engineers can swiftly and efficiently zero-in on the problem bug and fix it using advanced reverse-debugging techniques.
This is only the beginning of our support for the Go community and we hope to upstream this work into the main Delve project. In the first half of 2020, we’re looking forward to being able to share some more exciting LiveRecorder feature advancements for Go. Watch this space and sign up for our newsletter to keep updated about LiveRecorder for Go.
Undo’s LiveRecorder, based on flight recording technology, can now diagnose software defects in applications built in Go. Find out more about LiveRecorder for Go.