Export Citations
Concurrent programs are notoriously difficult to write and debug, a problem that is becoming acute with the recent shift in hardware from uniprocessors to multicore processors. A fundamental concurrency bug is a race : a condition in a shared-memory multithreaded program in which a pair of threads may access the same memory location without any ordering enforced between the accesses, and at least one of the accesses is a write. Despite thirty years of research on race detection, today's concurrent programs are still riddled with harmful races.
We present an effective approach to static race detection for Java. We dissect the specification of a race to identify four natural conditions, each of which is sufficient for proving a given pair of accesses race-free, and all of which are necessary in practice as different pairs of accesses may be race-free for different reasons. We present four static analyses each of which conservatively approximates a separate condition while together enabling the overall algorithm to report a useful set of potential races. We have implemented our approach and report upon our experience applying it to a suite of eight multithreaded Java programs which includes a mix of libraries, complete programs, previously studied programs, and newer, real-world, open-source programs.
For complete programs, the approach is sound in that it finds all races. On our benchmark suite, the approach is precise in that it has a false positive rate of 25% (only one in every four reported races is not in fact a race) and it is reasonably scalable in that it is fully automatic and checks programs comprising hundreds of thousands of Java bytecodes in a few minutes. Finally, the approach is effective, finding tens to hundreds of previously unknown concurrency bugs in mature and widely used Java programs in our benchmark suite, many of which were fixed upon reporting.
Cited By
- Huang J Scalable thread sharing analysis Proceedings of the 38th International Conference on Software Engineering, (1097-1108)
- Demsky B and Lam P (2013). Views, ACM Transactions on Software Engineering and Methodology, 22:1, (1-33), Online publication date: 1-Feb-2013.
- Chen N and Johnson R JFlow Proceedings of the 28th IEEE/ACM International Conference on Automated Software Engineering, (202-212)
- Tao B, Qian J and Zhou X Side-effect analysis with fast escape filter Proceedings of the ACM SIGPLAN International Workshop on State of the Art in Java Program analysis, (15-20)
- Naik M, Park C, Sen K and Gay D Effective static deadlock detection Proceedings of the 31st International Conference on Software Engineering, (386-396)
Recommendations
Effective static race detection for Java
Proceedings of the 2006 PLDI ConferenceWe present a novel technique for static race detection in Java programs, comprised of a series of stages that employ a combination of static analyses to successively reduce the pairs of memory accesses potentially involved in a race. We have implemented ...
Effective static race detection for Java
PLDI '06: Proceedings of the 27th ACM SIGPLAN Conference on Programming Language Design and ImplementationWe present a novel technique for static race detection in Java programs, comprised of a series of stages that employ a combination of static analyses to successively reduce the pairs of memory accesses potentially involved in a race. We have implemented ...
Practical static race detection for Java parallel loops
ISSTA 2013: Proceedings of the 2013 International Symposium on Software Testing and AnalysisDespite significant progress in recent years, the important problem of static race detection remains open. Previous techniques took a general approach and looked for races by analyzing the effects induced by low-level concurrency constructs (e.g., ...