skip to main content
10.1145/1390630.1390650acmconferencesArticle/Chapter ViewAbstractPublication PagesisstaConference Proceedingsconference-collections
research-article

Racer: effective race detection using aspectj

Published:20 July 2008Publication History

ABSTRACT

Programming errors occur frequently in large software systems, and even more so if these systems are concurrent. In the past researchers have developed specialized programs to aid programmers detecting concurrent programming errors such as deadlocks, livelocks, starvation and data races.

In this work we propose a language extension to the aspect-oriented programming language AspectJ, in the form of three new pointcuts, lock(), unlock() and maybeShared(). These pointcuts allow programmers to monitor program events where locks are granted or handed back, and where values are accessed that may be shared amongst multiple Java threads. We decide thread-locality using a static thread-local objects analysis developed by others. Using the three new primitive pointcuts, researchers can directly implement efficient monitoring algorithms to detect concurrent programming errors online. As an example, we expose a new algorithm which we call Racer, an adoption of the well-known Eraser algorithm to the memory model of Java.

We implemented the new pointcuts as an extension to the AspectBench Compiler, implemented the Racer algorithm using this language extension and then applied the algorithm to the NASA K9 Rover Executive. Our experiments proved our implementation very effective. In the Rover Executive Racer finds 70 data races. Only one of these races was previously known. We further applied the algorithm to two other multi-threaded programs written by Computer Science researchers, in which we found races as well.

References

  1. R. Agarwal, L. Wang, and S. D. Stoller. Detecting potential deadlocks with static analysis and run-time monitoring. In Ur et al. {39}, pages 191--207.Google ScholarGoogle Scholar
  2. C. Allan, P. Avgustinov, A. S. Christensen, L. J. Hendren, S. Kuzins, O. Lhoták, O. de Moor, D. Sereni, G. Sittampalam, and J. Tibble. Adding trace matching with free variables to AspectJ. In R. Johnson and R. P. Gabriel, editors, OOPSLA, pages 345--364. ACM, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. T. Aotani and H. Masuhara. Compiling conditional pointcuts for user-level semantic pointcuts. In Software-Engineering Properties of Languages and Aspect Technologies (SPLAT), March 2005.Google ScholarGoogle Scholar
  4. C. Artho, K. Havelund, and A. Biere. High-level data races. Software Testing, Verification and Reliability, 13(4):207--227, 2003.Google ScholarGoogle ScholarCross RefCross Ref
  5. C. Artho, K. Havelund, and A. Biere. Using block-local atomicity to detect stale-value concurrency errors. In F. Wang, editor, ATVA, volume 3299 of LNCS, pages 150--164. Springer, 2004.Google ScholarGoogle Scholar
  6. P. Avgustinov, A. S. Christensen, L. Hendren, S. Kuzins, J. Lhoták, O. Lhoták, O. de Moor, D. Sereni, G. Sittampalam, and J. Tibble. abc: An extensible AspectJ compiler. In AOSD conference, pages 87--98. ACM Press, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. H. Barringer, A. Goldberg, K. Havelund, and K. Sen. Rule-based runtime verification. In B. Steffen and G. Levi,editors, VMCAI, volume 2937 of Lecture Notes in Computer Science, pages 44--57. Springer, 2004.Google ScholarGoogle Scholar
  8. S. Bensalem, J.-C. Fernandez, K. Havelund, and L. Mounier. Confirmation of deadlock potentials detected by runtime analysis. In PADTAD '06: Proceeding of the 2006 workshop on Parallel and distributed systems: testing and debugging, pages 41--50, New York, NY, USA, 2006. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. S. Bensalem and K. Havelund. Dynamic deadlock analysis of multi-threaded programs. In Ur et al. {39}, pages 208--223. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. E. Bodden, F. Forster, and F. Steimann. Avoiding infinite recursion with stratified aspects. In R. Hirschfeld, A. Polze, and R. Kowalczyk, editors, GI-Edition Lecture Notes in Informatics "NODe 2006 GSEM 2006", volume P-88, pages 49--64. Gesellschaft für Informatik, Bonner Köllen Verlag, 2006.Google ScholarGoogle Scholar
  11. E. Bodden and K. Havelund. Racer: Effective race detection using AspectJ (extended version). Technical Report abc-2008-1, http://www.aspectbench.org/, 05 2008.Google ScholarGoogle Scholar
  12. E. Bodden, L. J. Hendren, and O. Lhoták. A staged static program analysis to improve the performance of runtime monitoring. In E. Ernst, editor, ECOOP, volume 4609 of Lecture Notes in Computer Science, pages 525--549. Springer, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. E. Bodden, P. Lam, and L. Hendren. Static analysis techniques for evaluating runtime monitoring properties ahead-of-time. Technical Report abc-2007-6, http://www.aspectbench.org/, 11 2007.Google ScholarGoogle Scholar
  14. G. P. Brat, D. Drusinsky, D. Giannakopoulou, A. Goldberg, K. Havelund, M. R. Lowry, C. S. Pasareanu, A. Venet, W. Visser, and R. Washington. Experimental evaluation of verification and validation tools on martian rover software. Formal Methods in System Design, 25(2-3):167--198, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. E. Bruneton, R. Lenglet, and T. Coupaye. ASM: A code manipulation tool to implement adaptable systems. In Adaptable and Extensible Component Systems, Grenoble, France, November 2002. http://asm.objectweb.org.Google ScholarGoogle Scholar
  16. F. Chen, T. F. Serbanuta, and G. Rosu. jPredictor: A predictive runtime analysis tool for Java. In International Conference on Software Engineering (ICSE'08). ACM press, 2008. To appear. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. S. Cohen. Jtrek. Compaq. No longer maintained.Google ScholarGoogle Scholar
  18. M. Dahm. BCEL. http://jakarta.apache.org/bcel.Google ScholarGoogle Scholar
  19. M. d'Amorim and K. Havelund. Event-based runtime verification of Java programs. In WODA '05: Proceedings of the third international workshop on Dynamic analysis, pages 1--7, New York, NY, USA, 2005. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. M. Eichberg, M. Mezini, and K. Ostermann. Pointcuts as functional queries. In W.-N. Chin, editor, APLAS, volume 3302 of Lecture Notes in Computer Science, pages 366--381. Springer, 2004.Google ScholarGoogle Scholar
  21. A. Eustace and A. Srivastava. ATOM: a flexible interface for building high performance program analysis tools. In Technical Conference Proceedings on USENIX 1995, pages 25--25, Berkeley, CA, USA, 1995. USENIX Association. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Y. Eytani, K. Havelund, S. D. Stoller, and S. Ur. Towards a framework and a benchmark for testing tools for multi-threaded programs: Research articles. Concurrency and Computation: Practice and Experience, 19(3):267--279, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. C. Flanagan and S. Freund. Atomizer: A dynamic atomicity checker for multithreaded programs. SIGPLAN Notices, 39(1):256--267, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. B. Goetz. Java concurrency in practice. Addison Wesley, 2006.Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. A. Goldberg and K. Havelund. Instrumentation of Java bytecode for runtime analysis. In Fifth ECOOP Workshop on Formal Techniques for Java-like Programs (FTfJP'03), July 2003. Darmstadt, Germany.Google ScholarGoogle Scholar
  26. A. Goldberg and K. Havelund. Instrumentation of Java bytecode for runtime analysis. In Fifth ECOOP Workshop on Formal Techniques for Java-like Programs (FTfJP'03), July 2003. Darmstadt, Germany.Google ScholarGoogle Scholar
  27. R. L. Halpert, C. J. F. Pickett, and C. Verbrugge. Component-based lock allocation. In PACT'07: Proceedings of the 16th International Conference on Parallel Architectures and Compilation Techniques, pages 353--364, Sept. 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. J. Harrow. Runtime checking of multithreaded applications with visual threads. In K. Havelund, J. Penix, and W. Visser, editors, SPIN Model Checking and Software Verification, volume 1885 of Lecture Notes in Computer Science, pages 331--342. Springer, 2000. http://h30097.www3.hp.com/dtk/visualthreads_ov.html Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. K. Havelund. Using runtime analysis to guide model checking of Java programs. In SPIN Model Checking and Software Verification, volume 1885 of Lecture Notes in Computer Science, pages 245--264. Springer, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. K. Havelund. Using runtime analysis to guide model checking of Java programs. In SPIN Model Checking and Software Verification, volume 1885 of Lecture Notes in Computer Science, pages 245--264. Springer, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. A. Kinneer, M. B. Dwyer, and G. Rothermel. Sofya: Supporting rapid development of dynamic program analyses for java. In ICSE COMPANION '07: Companion to the proceedings of the 29th International Conference on Software Engineering, pages 51--52, Washington, DC, USA, 2007. IEEE Computer Society. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. D. Lea. Concurrent Programming in Java: Design Principles and Patterns. Addison-Wesley Longman Publishing Co., Inc., Boston, MA, USA, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. O. Lhot´ak and L. Hendren. Scaling Java points-to analysis using Spark. In G. Hedin, editor, Compiler Construction, 12th International Conference, volume 2622 of LNCS, pages 153--169, Warsaw, Poland, April 2003. Springer. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. G. C. Necula, S. McPeak, S. P. Rahul, and W. Weimer. CIL: Intermediate language and tools for analysis and transformation of C programs. In R. N. Horspool, editor, CC, volume 2304 of Lecture Notes in Computer Science, pages 213--228. Springer, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. R. O'Callahan and J.-D. Choi. Hybrid dynamic data race detection. In ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming (PPoPP'03), pages 167--178, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. S. Savage, M. Burrows, G. Nelson, P. Sobalvarro, and T. Anderson. Eraser: a dynamic data race detector for multithreaded programs. ACM Transactions on Computer Systems, 15(4):391--411, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. S. Savage, M. Burrows, G. Nelson, P. Sobalvarro, and T. Anderson. Eraser: a dynamic data race detector for multithreaded programs. ACM Transactions on Computer Systems, 15(4):391--411, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. V. Stolz and E. Bodden. Temporal assertions using AspectJ. Electr. Notes in Theor. Computer Science, 144(4):109--124, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. S. Ur, E. Bin, and Y. Wolfsthal, editors. Hardware and Software Verification and Testing, First International Haifa Verification Conference, Haifa, Israel, November 13-16, 2005, volume 3875 of Lecture Notes in Computer Science. Springer, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. Valgrind. http://valgrind.org.Google ScholarGoogle Scholar
  41. W. Visser, K. Havelund, G. P. Brat, S. Park, and F. Lerda. Model checking programs. In 15th IEEE International Conference on Automated Software Engineering, volume 10, pages 203--232, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  42. C. von Praun and T. R. Gross. Object race detection. In OOPSLA, pages 70--82, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  43. L. Wang and S. D. Stoller. Run-time analysis for atomicity. Electronic Notes in Theoretical Computer Science, 89(2), 2003.Google ScholarGoogle Scholar

Index Terms

  1. Racer: effective race detection using aspectj

    Recommendations

    Comments

    Login options

    Check if you have access through your login credentials or your institution to get full access on this article.

    Sign in
    • Published in

      cover image ACM Conferences
      ISSTA '08: Proceedings of the 2008 international symposium on Software testing and analysis
      July 2008
      324 pages
      ISBN:9781605580500
      DOI:10.1145/1390630

      Copyright © 2008 ACM

      Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 20 July 2008

      Permissions

      Request permissions about this article.

      Request Permissions

      Check for updates

      Qualifiers

      • research-article

      Acceptance Rates

      Overall Acceptance Rate58of213submissions,27%

      Upcoming Conference

      ISSTA '24

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader