Science China Information Sciences

, Volume 55, Issue 12, pp 2774–2784 | Cite as

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

Research Paper Progress of Projects Supported by NSFC

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.

Keywords

concurrency error dynamic test data race atomicity violations test case generation 

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    Godefroid P, Nagappan N. Concurrency at Microsoft: an exploratory survey. In: Workshop on Exploiting Concurrency Efficiently and Correctly, Princeton, 2008Google Scholar
  2. 2.
    Poulsen K. Tracking the blackout bug Security Focus. 2004-04-07. http://www.securityfocus.com/news/8412
  3. 3.
    Leveson N G. SafeWare: System Safety and Computers. Boston: Addison-Wesley Professional, 1995Google Scholar
  4. 4.
    McDowell C E, Helmbold D P. Debugging concurrent programs. ACM Comput Surv, 1989, 4: 593–622CrossRefGoogle Scholar
  5. 5.
    Musuvathi M, Qadeer S. Iterative context bounding for systematic testing of multithreaded programs. ACM SIGPLAN Not, 2007, 6: 446–455CrossRefGoogle Scholar
  6. 6.
    Flanagan C, Freund S. FastTrack: efficient and precise dynamic race detection. ACM SIGPLAN Not, 2009, 44: 121–133CrossRefGoogle Scholar
  7. 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–254Google Scholar
  8. 8.
    Park S, Lu S, Zhou Y. CTrigger: exposing atomicity violation bugs from their hiding places. ACM SIGPLAN Not, 2009, 44: 25–36CrossRefGoogle Scholar
  9. 9.
    Burckhardt S, Kothari P, Musuvathi M, et al. A randomized scheduler with probabilistic guarantees of finding bugs. ACM SIGPLAN Not, 2010, 45: 167–178CrossRefGoogle Scholar
  10. 10.
    Coons K E, Burckhardt S, Musuvathi M. GAMBIT: effective unit testing for concurrency libraries. ACM SIGPLAN Not, 2010, 45: 15–24CrossRefGoogle Scholar
  11. 11.
    Pradel M, Gross T R. Fully automatic and precise detection of thread safety violations. ACM SIGPLAN Not, 2012, 47: 521–530CrossRefGoogle Scholar
  12. 12.
    Schildt H. Java 7 the Complete Reference. 8th Ed. New York: Mc-Graw Hill, 2011Google Scholar
  13. 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–339CrossRefGoogle Scholar
  14. 14.
    Shacham O, Bronson N, Aiken A, et al. Testing atomicity of composed concurrent operations. ACM SIGPLAN Not, 2011, 46: 51–64CrossRefGoogle Scholar
  15. 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–737Google Scholar
  16. 16.
    Marino D, Musuvathi M, Narayanasamy S. LiteRace: effective sampling for lightweight data-race detection. ACM SIGPLAN Not, 2009, 44: 134–143CrossRefGoogle Scholar
  17. 17.
    Praun C V, Gross T R. Object race detection. ACM SIGPLAN Not, 2001, 36: 70–82CrossRefGoogle Scholar
  18. 18.
    Callahan R O, Choi J D. Hybrid dynamic data race detection. ACM SIGPLAN Not, 2003, 38: 167–178CrossRefGoogle Scholar
  19. 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–303CrossRefGoogle Scholar
  20. 20.
    Lu S. Finding atomicity-violation bugs through unserializable interleaving testing. IEEE Trans Softw Eng, 2012, 38: 844–860CrossRefGoogle Scholar
  21. 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–396Google Scholar
  22. 22.
    Joshi S, Lahiri S K, Lal A. Underspecified harnesses and interleaved bugs. ACM SIGPLAN Not, 2012, 47: 19–30CrossRefGoogle Scholar
  23. 23.
    Herlihy M, Wing J M. Linearizability: a correctness condition for concurrent objects. ACM Trans Program Lang Syst, 1990, 12: 463–492CrossRefGoogle Scholar
  24. 24.
    Burckhardt S, Dern C, Musuvathi M, et al. Line-Up: a complete and automatic linearizability checker. ACM SIGPLAN Not, 2010, 45: 330–340CrossRefGoogle Scholar
  25. 25.
    Godefroid P, Klarlund N, Sen K. DART: directed automated random testing. ACM SIGPLAN Not, 2005, 40: 213–223CrossRefGoogle Scholar
  26. 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–84Google Scholar
  27. 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–1812MathSciNetCrossRefGoogle Scholar

Copyright information

© Science China Press and Springer-Verlag Berlin Heidelberg 2012

Authors and Affiliations

  1. 1.School of ComputersWuhan UniversityWuhanChina
  2. 2.State Key Laboratory of Software EngineeringWuhan UniversityWuhanChina

Personalised recommendations