By Greg Law
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.










