Skip to main content
Log in

An efficient method for detecting concurrency errors in object-oriented programs

  • Research Paper
  • Progress of Projects Supported by NSFC
  • Published:
Science China Information Sciences Aims and scope Submit manuscript

Abstract

Multicore and multi-threaded processors have become the norm for modern processors. Accordingly, concurrent programs have become more and more prevalent despite being difficult to write and understand. Although errors are highly likely to appear in concurrent code, conventional error detection methods such as model checking, theorem proving, and code analysis do not scale smoothly to concurrent programs. Testing is an indispensable technique for detecting concurrency errors, but it involves a great deal of manual work and is inefficient. This paper presents an automatic method for detecting concurrency errors in classes in object-oriented languages. The method uses a heuristic algorithm to automatically generate test cases that can effectively trigger errors. Then, each test case is executed automatically and a fast method is adopted to identify the actual concurrency error from anomalous run results. We have implemented a prototype of the method and applied it to some typical Java classes. Evaluation shows that our method is more effective and faster than previous work.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  1. Godefroid P, Nagappan N. Concurrency at Microsoft: an exploratory survey. In: Workshop on Exploiting Concurrency Efficiently and Correctly, Princeton, 2008

  2. Poulsen K. Tracking the blackout bug Security Focus. 2004-04-07. http://www.securityfocus.com/news/8412

  3. Leveson N G. SafeWare: System Safety and Computers. Boston: Addison-Wesley Professional, 1995

    Google Scholar 

  4. McDowell C E, Helmbold D P. Debugging concurrent programs. ACM Comput Surv, 1989, 4: 593–622

    Article  Google Scholar 

  5. Musuvathi M, Qadeer S. Iterative context bounding for systematic testing of multithreaded programs. ACM SIGPLAN Not, 2007, 6: 446–455

    Article  Google Scholar 

  6. Flanagan C, Freund S. FastTrack: efficient and precise dynamic race detection. ACM SIGPLAN Not, 2009, 44: 121–133

    Article  Google Scholar 

  7. Park S, Vuduc R W, Harrold M J. Falcon: fault localization in concurrent programs. In: Proceedings of the 32nd ACM/IEEE International Conference on Software Engineering, Cape Town, 2010. 245–254

  8. Park S, Lu S, Zhou Y. CTrigger: exposing atomicity violation bugs from their hiding places. ACM SIGPLAN Not, 2009, 44: 25–36

    Article  Google Scholar 

  9. Burckhardt S, Kothari P, Musuvathi M, et al. A randomized scheduler with probabilistic guarantees of finding bugs. ACM SIGPLAN Not, 2010, 45: 167–178

    Article  Google Scholar 

  10. Coons K E, Burckhardt S, Musuvathi M. GAMBIT: effective unit testing for concurrency libraries. ACM SIGPLAN Not, 2010, 45: 15–24

    Article  Google Scholar 

  11. Pradel M, Gross T R. Fully automatic and precise detection of thread safety violations. ACM SIGPLAN Not, 2012, 47: 521–530

    Article  Google Scholar 

  12. Schildt H. Java 7 the Complete Reference. 8th Ed. New York: Mc-Graw Hill, 2011

    Google Scholar 

  13. Lu S, Park S, Seo E, et al. Learning from mistakes: a comprehensive study on real world concurrency bug characteristics. ACM SIGPLAN Not, 2008, 43: 329–339

    Article  Google Scholar 

  14. Shacham O, Bronson N, Aiken A, et al. Testing atomicity of composed concurrent operations. ACM SIGPLAN Not, 2011, 46: 51–64

    Article  Google Scholar 

  15. Nistor A, Luo Q, Pradel M, et al. Ballerina: automatic generation and clustering of efficient random unit tests for multithreaded code. In: ICSE 2012 Proceedings of the 2012 International Conference on Software Engineering, Piscataway, 2012. 727–737

  16. Marino D, Musuvathi M, Narayanasamy S. LiteRace: effective sampling for lightweight data-race detection. ACM SIGPLAN Not, 2009, 44: 134–143

    Article  Google Scholar 

  17. Praun C V, Gross T R. Object race detection. ACM SIGPLAN Not, 2001, 36: 70–82

    Article  Google Scholar 

  18. Callahan R O, Choi J D. Hybrid dynamic data race detection. ACM SIGPLAN Not, 2003, 38: 167–178

    Article  Google Scholar 

  19. Flanagan C, Freund S N, Yi J. Velodrome: a sound and complete dynamic atomicity checker for multithreaded programs. ACM SIGPLAN Not, 2008, 43: 293–303

    Article  Google Scholar 

  20. Lu S. Finding atomicity-violation bugs through unserializable interleaving testing. IEEE Trans Softw Eng, 2012, 38: 844–860

    Article  Google Scholar 

  21. Naik M, Park C S, Sen K, et al. Effective static deadlock detection. In: ICSE’ 09 Proceedings of the 31st International Conference on Software Engineering, Vancouver, 2009. 386–396

  22. Joshi S, Lahiri S K, Lal A. Underspecified harnesses and interleaved bugs. ACM SIGPLAN Not, 2012, 47: 19–30

    Article  Google Scholar 

  23. Herlihy M, Wing J M. Linearizability: a correctness condition for concurrent objects. ACM Trans Program Lang Syst, 1990, 12: 463–492

    Article  Google Scholar 

  24. Burckhardt S, Dern C, Musuvathi M, et al. Line-Up: a complete and automatic linearizability checker. ACM SIGPLAN Not, 2010, 45: 330–340

    Article  Google Scholar 

  25. Godefroid P, Klarlund N, Sen K. DART: directed automated random testing. ACM SIGPLAN Not, 2005, 40: 213–223

    Article  Google Scholar 

  26. Pacheco C, Lahiri S K, Ernst M D, et al. Feedback-directed random test generation. In: ICSE’ 07 Proceedings of the 29th international conference on Software Engineering, Minneapolis, 2007. 75–84

  27. Krishnamoorthy S, Hsiao M S, Lingappan L. Strategies for scalable symbolic execution-driven test generation for programs. Sci China Inf Sci, 2011, 54: 1797–1812

    Article  MathSciNet  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Wei Wu.

Rights and permissions

Reprints and permissions

About this article

Cite this article

He, Y., Wu, W. & Chen, Y. An efficient method for detecting concurrency errors in object-oriented programs. Sci. China Inf. Sci. 55, 2774–2784 (2012). https://doi.org/10.1007/s11432-012-4751-z

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s11432-012-4751-z

Keywords

Navigation