Race conditions: practical tools and techniques for testing, preventing, and debugging.

Greg Law

⏱ 20 mins
intermediate
advanced
15:10-15:30, Thursday, 3rd April 2025
Race conditions are hard, and your code is littered with them whether or not you realise it! They often escape testing to crop up in production, but wherever they raise their ugly head they are fiendishly difficult to track down. So often the dreaded 'Heisenbug' -- you add some logging or attach a debugger, and the bug goes away.

There are many tools and techniques that can help: some well known, others less so. This talk contains few slides, lots of practical examples of how to test for them, and how to fix them. Includes introduction and advanced usage of Thread Sanitizer, Helgrind and DRD, how to get the most of GDB with threaded programs, super-lightweight and lock-free logging with L3, an introduction to use thread fuzzing, introduction to static analysis, and some tips and tricks on how to test for them and how to avoid them in the first place.

🏷 threads
🏷 debugging
🏷 testing
🏷 race conditions
🏷 valgrind
🏷 asan

Greg Law

Greg is the founder of undo.io. He is a coder at heart, but likes to bridge the gap between the business and software worlds.

Greg has 25 years’ experience in the software industry and has held development and management roles at companies including the pioneering British computer firm Acorn, as well as fast-growing start ups, NexWave and Solarflare. It was at Acorn that Greg met Julian and on evenings and weekends, they invented the time-travel technology that would become the basis of Undo that is used today by developers at the world's leading tech companies to help them understand and root cause the most complex bugs -- as well as the day-to-day stuff.

Greg lives in Cambridge, UK with his wife, two teenagers, two dogs and two cats. In his spare time, he catches up on email.