Data races are among the most frequent errors in concurrent programs. Data race happens when several threads access the same shared memory location and at least one of the threads writes to it. Usually data races are very dangerous because they unpredictably change program flow and corrupt shared data structures. It is very difficult to detect data races manually, because often their effects cannot be seen immediately (as apposed to deadlocks) and depend on uncontrollable interleaving of threads’ execution.
In this report we will present our dynamic data race detection tool. It gathers and analyzes information about program execution and detects data races on the fly. Previous attempts to create race detection tool for Java failed to achieve wide adoption and stability on a level enough to use in regular QA activities. The difficulty is in many technical obstacles and amount of data to be processed.
We have solved many of the problems with result good enough to use the tool for regular testing of applications developed by our company. We will tell about our experience of developing data race detection tool:
- Data race detection algorithms
- Dynamic Java program instrumentation
- Technical complications we have faced and ways of solution
- Tuning performance and memory consumption overhead.