Abstract
Concurrent, object-oriented programs often use thread-safe library classes. Existing techniques for testing a thread-safe class either rely on tests using the class, on formal specifications, or on both. Unfortunately, these techniques often are not fully automatic as they involve the user in analyzing the output. This paper presents an automatic testing technique that reveals concurrency bugs in supposedly thread-safe classes. The analysis requires as input only the class under test and reports only true positives. The key idea is to generate tests in which multiple threads call methods on a shared instance of the tested class. If a concurrent test exhibits an exception or a deadlock that cannot be triggered in any linearized execution of the test, the analysis reports a thread safety violation. The approach is easily applicable, because it is independent of hand-written tests and explicit specifications. The analysis finds 15 concurrency bugs in popular Java libraries, including two previously unknown bugs in the Java standard library.
- API documentation of java.lang.StringBuffer (Java platform standard edition 6), 2011.Google Scholar
- C. Artho, K. Havelund, and A. Biere. High-level data races. Softw Test Verif Rel, 13(4):207--227, 2003.Google Scholar
Cross Ref
- A. Bessey, K. Block, B. Chelf, A. Chou, B. Fulton, S. Hallem, C. Henri-Gros, A. Kamsky, S. McPeak, and D. R. Engler. A few billion lines of code later: Using static analysis to find bugs in the real world. Commun ACM, 53(2):66--75, 2010. Google Scholar
Digital Library
- S. Burckhardt and R. Tan. Private communication, August 2011.Google Scholar
- S. Burckhardt, C. Dern, M. Musuvathi, and R. Tan. Line-Up: a complete and automatic linearizability checker. In PLDI, pages 330--340, 2010. Google Scholar
Digital Library
- S. Burckhardt, P. Kothari, M. Musuvathi, and S. Nagarakatte. A randomized scheduler with probabilistic guarantees of finding bugs. In ASPLOS, pages 167--178, 2010. Google Scholar
Digital Library
- J. Burnim, T. Elmas, G. C. Necula, and K. Sen. NDSeq: runtime checking for nondeterministic sequential specifications of parallel correctness. In PLDI, pages 401--414, 2011. Google Scholar
Digital Library
- J.-D. Choi, K. Lee, A. Loginov, R. O'Callahan, V. Sarkar, and M. Sridharan. Efficient and precise datarace detection for multithreaded object-oriented programs. In PLDI, pages 258--269, 2002. Google Scholar
Digital Library
- I. Ciupa, A. Pretschner, A. Leitner, M. Oriol, and B. Meyer. On the predictability of random tests for object-oriented software. In ICST, pages 72--81, 2008. Google Scholar
Digital Library
- K. E. Coons, S. Burckhardt, and M. Musuvathi. GAMBIT: effective unit testing for concurrency libraries. In PPOPP, pages 15--24, 2010. Google Scholar
Digital Library
- C. Csallner and Y. Smaragdakis. JCrasher: an automatic robustness tester for Java. Software Pract Exper, 34(11):1025--1050, Sept. 2004. Google Scholar
Digital Library
- O. Edelstein, E. Farchi, Y. Nir, G. Ratsaby, and S. Ur. Multithreaded Java program test generation. IBM Syst J, 41(1):111--125, 2002. Google Scholar
Digital Library
- T. Elmas, S. Tasiran, and S. Qadeer. VYRD: verifying concurrent programs by runtime refinement-violation detection. In PLDI, pages 27--37, 2005. Google Scholar
Digital Library
- C. Flanagan and S. N. Freund. Atomizer: a dynamic atomicity checker for multithreaded programs. In POPL, pages 256--267, 2004. Google Scholar
Digital Library
- C. Flanagan and S. N. Freund. FastTrack: efficient and precise dynamic race detection. In PLDI, pages 121--133, 2009. Google Scholar
Digital Library
- C. Flanagan, S. N. Freund, and J. Yi. Velodrome: a sound and complete dynamic atomicity checker for multithreaded programs. In PLDI, pages 293--303, 2008. Google Scholar
Digital Library
- P. Fonseca, C. Li, and R. Rodrigues. Finding complex concurrency bugs in large multi-threaded applications. In EuroSys, pages 215--228, 2011. Google Scholar
Digital Library
- Q. Gao, W. Zhang, Z. Chen, M. Zheng, and F. Qin. 2ndstrike: toward manifesting hidden concurrency typestate bugs. In ASPLOS, pages 239--250, 2011. Google Scholar
Digital Library
- P. Godefroid, N. Klarlund, and K. Sen. DART: directed automated random testing. In PLDI, pages 213--223, 2005. Google Scholar
Digital Library
- B. Goetz, T. Peierls, J. Bloch, J. Bowbeer, D. Holmes, and D. Lea. Java Concurrency in Practice. 2006. Google Scholar
Digital Library
- C. Hammer, J. Dolby, M. Vaziri, and F. Tip. Dynamic detection of atomic-set-serializability violations. In ICSE, pages 231--240, 2008. Google Scholar
Digital Library
- M. Herlihy and J. M. Wing. Linearizability: A correctnes condition for concurrent objects. ACM T Progr Lang Sys, 12(3):463--492, 1990. Google Scholar
Digital Library
- V. Jagannath, M. Gligoric, D. Jin, Q. Luo, G. Rosu, and D. Marinov. Improved multithreaded unit testing. In ESEC/FSE, pages 223--233, 2011. Google Scholar
Digital Library
- G. Jin, A. V. Thakur, B. Liblit, and S. Lu. Instrumentation and sampling strategies for cooperative concurrency bug isolation. In OOPSLA, pages 241--255, 2010. Google Scholar
Digital Library
- P. Joshi, C.-S. Park, K. Sen, and M. Naik. A randomized dynamic program analysis technique for detecting real deadlocks. In PLDI, pages 110--120, 2009. Google Scholar
Digital Library
- P. Joshi, M. Naik, K. Sen, and D. Gay. An effective dynamic analysis for detecting generalized deadlocks. In FSE, pages 327--336, 2010. Google Scholar
Digital Library
- S. Joshi, S. K. Lahiri, and A. Lal. Underspecified harnesses and interleaved bugs. In POPL, pages 19--30, 2012. Google Scholar
Digital Library
- Z. Lai, S.-C. Cheung, and W. K. Chan. Detecting atomic-set serializability violations in multithreaded programs through active randomized testing. In ICSE, pages 235--244, 2010. Google Scholar
Digital Library
- S. Lu, J. Tucek, F. Qin, and Y. Zhou. AVIO: detecting atomicity violations via access interleaving invariants. In ASPLOS, pages 37--48, 2006. Google Scholar
Digital Library
- S. Lu, S. Park, E. Seo, and Y. Zhou. Learning from mistakes: a comprehensive study on real world concurrency bug characteristics. In ASPLOS, pages 329--339, 2008. Google Scholar
Digital Library
- B. Lucia and L. Ceze. Finding concurrency bugs with context-aware communication graphs. In MICRO, pages 553--563, 2009. Google Scholar
Digital Library
- D. Marino, M. Musuvathi, and S. Narayanasamy. LiteRace: effective sampling for lightweight data-race detection. In PLDI, pages 134--143, 2009. Google Scholar
Digital Library
- M. Musuvathi, S. Qadeer, T. Ball, G. Basler, P. A. Nainar, and I. Neamtiu. Finding and reproducing Heisenbugs in concurrent programs. In OSDI, pages 267--280, 2008. Google Scholar
Digital Library
- M. Naik, C.-S. Park, K. Sen, and D. Gay. Effective static deadlock detection. In ICSE, pages 386--396, 2009. Google Scholar
Digital Library
- A. Nistor, Q. Luo, M. Pradel, T. R. Gross, and D. Marinov. Ballerina: Automatic generation and clustering of efficient random unit tests for multithreaded code. In ICSE, 2012. Google Scholar
Digital Library
- R. O'Callahan and J.-D. Choi. Hybrid dynamic data race detection. In PPOPP, pages 167--178, 2003. Google Scholar
Digital Library
- C. Pacheco, S. K. Lahiri, M. D. Ernst, and T. Ball. Feedback directed random test generation. In ICSE, pages 75--84, 2007. Google Scholar
Digital Library
- C.-S. Park and K. Sen. Randomized active atomicity violation detection in concurrent programs. In FSE, pages 135--145, 2008. Google Scholar
Digital Library
- S. Park, S. Lu, and Y. Zhou. CTrigger: exposing atomicity violation bugs from their hiding places. In ASPLOS, pages 25--36, 2009. Google Scholar
Digital Library
- H. Patil, C. Pereira, M. Stallcup, G. Lueck, and J. Cownie. PinPlay: a framework for deterministic replay and reproducible analysis of parallel programs. In CGO, pages 2--11, 2010. Google Scholar
Digital Library
- W. Pugh and N. Ayewah. Unit testing concurrent software. In ASE, pages 513--516, 2007. Google Scholar
Digital Library
- S. Savage, M. Burrows, G. Nelson, P. Sobalvarro, and T. E. Anderson. Eraser: A dynamic data race detector for multithreaded programs. ACM T Comput Syst, 15(4):391--411, 1997. Google Scholar
Digital Library
- K. Sen. Effective random testing of concurrent programs. In ASE, pages 323--332, 2007. Google Scholar
Digital Library
- K. Sen. Race directed random testing of concurrent programs. In PLDI, pages 11--21, 2008. Google Scholar
Digital Library
- O. Shacham, N. Bronson, A. Aiken, M. Sagiv, M. Vechev, and E. Yahav. Testing atomicity of composed concurrent operations. In OOPSLA, pages 51--64, 2011. Google Scholar
Digital Library
- Y. Shi, S. Park, Z. Yin, S. Lu, Y. Zhou, W. Chen, and W. Zheng. Do I use the wrong definition?: Defuse: definition-use invariants for detecting concurrency and sequential bugs. In OOPSLA, pages 160--174, 2010. Google Scholar
Digital Library
- Y. Smaragdakis and C. Csallner. Combining static and dynamic reasoning for bug detection. In TAP, pages 1--16, 2007. Google Scholar
Digital Library
- F. Sorrentino, A. Farzan, and P. Madhusudan. PENELOPE: weaving threads to expose atomicity violations. In FSE, pages 37--46, 2010. Google Scholar
Digital Library
- C. von Praun and T. R. Gross. Object race detection. In OOPSLA, pages 70--82, 2001. Google Scholar
Digital Library
- S. Zhang, D. Saff, Y. Bu, and M. D. Ernst. Combined static and dynamic automated test generation. In ISSTA, pages 353--363, 2011. Google Scholar
Digital Library
- W. Zhang, C. Sun, and S. Lu. ConMem: detecting severe concurrency bugs through an effect-oriented approach. In ASPLOS, pages 179--192, 2010. Google Scholar
Digital Library
- W. Zhang, J. Lim, R. Olichandran, J. Scherpelz, G. Jin, S. Lu, and T. W. Reps. ConSeq: detecting concurrency bugs through sequential errors. In ASPLOS, pages 251--264, 2011. Google Scholar
Digital Library
Index Terms
Fully automatic and precise detection of thread safety violations
Recommendations
Fully automatic and precise detection of thread safety violations
PLDI '12: Proceedings of the 33rd ACM SIGPLAN Conference on Programming Language Design and ImplementationConcurrent, object-oriented programs often use thread-safe library classes. Existing techniques for testing a thread-safe class either rely on tests using the class, on formal specifications, or on both. Unfortunately, these techniques often are not ...
Efficient detection of thread safety violations via coverage-guided generation of concurrent tests
ICSE '17: Proceedings of the 39th International Conference on Software EngineeringAs writing concurrent programs is challenging, developers often rely on thread-safe classes, which encapsulate most synchronization issues. Testing such classes is crucial to ensure the correctness of concurrent programs. An effective approach to ...
A Thread Taxonomy for MPI
MPIDC '96: Proceedings of the Second MPI Developers ConferenceAbstract: In 1994, we presented extensions to MPI and offered an early paper on potential thread extensions to MPI as well as non-blocking collective extensions to MPI. The present paper is a thorough review of thread issues in MPI, including ...







Comments