Time Travel Debugging, or, Making Even the Hardest Problems Easy to Debug

Speaker: James McNellis

Audience level: Beginner | Intermediate | Advanced

category

We’ve all heard horror stories about bugs that were near-impossible to root-cause, and many of us have at least a few stories of our own. Corrupted or uninitialized memory. Resource leaks. API misuse and race conditions. Occasional and inconsistent crashes where all you have to go on are a series of unhelpful crash dumps. These kinds of problems are often time-consuming and tedious to debug, and can be both draining and infuriating.

Time Travel Debugging (TTD) is a reverse debugging toolkit for Windows that makes debugging these kinds of problems far easier, in both small programs and commercial-scale software like Windows and Office.  It enables you to record bugs as they happen, then replay the recording in the debugger afterwards, and use most of the debugger features that are available when debugging a live process.  TTD has been an invaluable tool for software developers and escalation engineers within Microsoft for many years and we were excited to release the first public preview of TTD last year at CppCon 2017.

In this interactive and hands-on session, I’ll introduce what Time Travel Debugging is and demonstrate the basics of how to use it.  We’ll walk through the root cause analysis of some typically difficult-to-solve bugs like memory corruption and API misuse.  Finally, we'll look at TTD’s advanced querying capabilities, which let you query information about memory accesses and function calls, enabling you to quickly answer questions such as “where were all of the places where the value 1 was written to this variable?” and “where are all of the places that this function was called where it returned an error?”

We’ll look at all of these things from the perspective of a C++ developer.  All of the example programs that we’ll be debugging will be C++ programs, and the larger examples will be based on real-world bugs.  As we walk through the examples, I’ll also introduce other, related debugger features that make debugging easier in general, even when not using Time Travel Debugging.