skip to main content
research-article

SOS: saving time in dynamic race detection with stationary analysis

Published:22 October 2011Publication History
Skip Abstract Section

Abstract

Data races are subtle and difficult to detect errors that arise during concurrent program execution. Traditional testing techniques fail to find these errors, but recent research has shown that targeted dynamic analysis techniques can be developed to precisely detect races (i.e., no false race reports are generated) that occur during program execution. Unfortunately, precise race detection is still too expensive to be used in practice. State-of-the-art techniques still slow down program execution by a factor of eight or more. In this paper, we incorporate an optimization technique based on the observation that many thread-shared objects are written early in their lifetimes and then become read-only for the remainder of their lifetimes; these are known as stationary objects. The main contribution of our work is the insight that once a stationary object becomes thread-shared, races cannot occur. Therefore, our proposed approach does not monitor access to these objects. As such, our system only incurs an average overhead of 45% of that of an implementation of FastTrack, a low-overhead dynamic race detector. We then compared the effectiveness of our approach to de- tect races in deployed environments with that of Pacer, a sampling based race detector based on FastTrack. We found that our approach can detect over five times more races than Pacer when we budget 50% for runtime overhead.

References

  1. M. Abadi, C. Flanagan, and S. N. Freund. Types for Safe Locking: Static Race Detection for Java. ACM Transactions on Programing Languages and Systems, 28:207--255, March 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Apache Software Foundation. Datarace on org.apache.catalina.loader.webappclassloader. https://issues.apache.org/bugzilla/show_bug.cgi?id=37458.Google ScholarGoogle Scholar
  3. M. Arnold, M. Vechev, and E. Yahav. QVM: An Efficient Runtime for Detecting Defects in Deployed Systems. In Proceedings of the Conference on Object-Oriented Programming Systems Languages and Applications, pages 143--162, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. S. M. Blackburn, R. Garner, C. Hoffmann, A. M. Khang, K. S. McKinley, R. Bentzur, A. Diwan, D. Feinberg, D. Frampton, S. Z. Guyer, M. Hirzel, A. Hosking, M. Jump, H. Lee, J. Eliot, B. Moss, A. Phansalkar, D. Stefanović, T. VanDrunen, D. von Dincklage, and B. Wiedermann. The DaCapo Benchmarks: Java Benchmarking Development and Analysis. In Proceedings of the ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages, and Applications (OOPSLA), pages 169--190, Portland, Oregon, USA, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. E. Bodden. Efficient Hybrid Typestate Analysis by Determining Continuation-Equivalent States. In Int'l. Conf. on Soft. Eng., 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. E. Bodden, L. J. Hendren, P. Lam, O. Lhoták, and N. A. Naeem. Collaborative Runtime Verification with Tracematches. In Works. on Runtime Verif., pages 22--37, March 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. E. Bodden, P. Lam, and L. Hendren. Finding Programming Errors Earlier by Evaluating Runtime Monitors Ahead-of-Time. In International Symposium on Foundation of Software Engineering, pages 36--47, New York, NY, USA, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. E. Bodden, P. Lam, and L. J. Hendren. Clara: A framework for partially evaluating finite-state runtime monitors ahead of time. In RV, pages 183--197, Malta, November 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. R. Bodık, R. Gupta, and V. Sarkar. ABCD: Eliminating Array Bounds Checks on Demand. In Proceedings of the Conference on Programming Language Design and Implementation, pages 321--333, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. M. Bond. Pacer: Proportional Detection of Data Races - ID: 2988434. http://sourceforge.net/tracker/?func=detail&aid=2988434&group_id=128805&atid=723235. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. M. D. Bond, K. E. Coons, and K. S. McKinley. PACER: Proportional Detection of Data Races. In Proceedings of the Conference on Programming Language Design and Implementation, pages 255--268, Toronto, Ontario, Canada, June 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. N. G. Bronson, C. Kozyrakis, and K. Olukotun. Feedback-Directed Barrier Optimization in a Strongly Isolated S™. In Proceedings of the 36th annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL '09, pages 213--225, New York, NY, USA, 2009. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Canonical Ltd. Launchpad: data-races-implementation sql crash. https://bugs.launchpad.net/f-4d-cb/bug/516622.Google ScholarGoogle Scholar
  14. J.-D. Choi, M. Gupta, M. J. Serrano, V. C. Sreedhar, and S. P. Midkiff. Stack Allocation and Synchronization Optimizations for Java Using Escape Analysis. ACM Transactions Programming Languages and Systems, 25:876--910, November 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. 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 Proceedings of the Conference on Programming Language Design and Implementation, pages 258--269, Berlin, Germany, June 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. M. Dwyer, A. Kinneer, and S. Elbaum. Adaptive Online Program Analysis. In Proceedings of the International Conference on Software Engineering, pages 220--229, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. M. Dwyer and R. Purandare. Residual dynamic typestate analysis. In Proceedings of the International Conference on Automated Software Engineering, pages 124--133, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. M. B. Dwyer, M. Diep, and S. Elbaum. Reducing the cost of path property monitoring through sampling. In Int'l. Conf. on Aut. Soft. Eng., pages 228--237, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. T. Elmas, S. Qadeer, and S. Tasiran. Goldilocks: A Race and Transaction-Aware Java Runtime. In Proceedings of the Conference on Programming Language Design and Implementation, pages 245--255, San Diego, California, USA, June 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. C. Flanagan and S. N. Freund. FastTrack: Efficient and Precise Dynamic Race Detection. In Proceedings of the Conference on Programming Language Design and Implementation, pages 121--133, Dublin, Ireland, June 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. C. Flanagan and S. N. Freund. RoadRunner: Dynamic Analysis Framework for Concurrent Programs. In Proceedings of the 9th ACM SIGPLAN-SIGSOFT workshop on Program Analysis for Software Tools and Engineering, pages 1--8, Toronto, Ontario, Canada, 2010. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. T. A. Henzinger, R. Jhala, and R. Majumdar. Race Checking by Context Inference. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI '04, pages 1--13. ACM, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Jikes RVM. Jikes research virtual machine. http://jikesrvm.org, 2011.Google ScholarGoogle Scholar
  24. M. Jump, S. M. Blackburn, and K. S. McKinley. Dynamic object sampling for pretenuring. In Proceedings of the 4th International Symposium on Memory Management, pages 152--162, Vancouver, BC, Canada, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. K. Kim, T. Yavuz-Kahveci, and B. A. Sanders. Precise Data Race Detection in a Relaxed Memory Model Using Heuristic-Based Model Checking. In Proceedings of the 2009 IEEE/ACM International Conference on Automated Software Engineering, ASE '09, pages 495--499. IEEE Computer Society, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. L. Lamport. Time, Clocks, and the Ordering of Events in a Distributed System. Communications of the ACM, 21:558--565, July 1978. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. K. Lee and S. P. Midkiff. A Two-Phase Escape Analysis for Parallel Java Programs. In Proceedings of the Conference on Parallel Architectures and Compilation Techniques, pages 53--62, Seattle, Washington, USA, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. Liang T. Chen. The Challenge of Race Conditions in Parallel Programming. http://developers.sun.com/solaris/articles/\\raceconditions.html.Google ScholarGoogle Scholar
  29. A. Loginov, E. Yahav, S. Chandra, S. Fink, N. Rinetzky, and M. Nanda. Verifying Dereference Safety via Expanding-Scope Analysis. In Proceedings of the International Symposium on Software Testing and Analysis, ISSTA '08, pages 213--224, New York, NY, USA, 2008. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. D. Marino, M. Musuvathi, and S. Narayanasamy. LiteRace: Effective Sampling for Lightweight Data-Race Detection. In Proceedings of the Conference on Programming Language Design and Implementation, pages 134--143, Dublin, Ireland, June 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. S. P. Midkiff, J. E. Moreira, and M. Snir. Optimizing Array Reference Checking in Java Programs. IBM Systems Journal, 37(3):409--453, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. M. Naik, A. Aiken, and J. Whaley. Effective Static Race Detection for Java. In Proceedings of the Conference on Programming Language Design and Implementation, pages 308--319, Ottawa, Ontario, Canada, June 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. R. O'Callahan and J.-D. Choi. Hybrid Dynamic Data Race Detection. In Proceedings of the Symposium on Principles and Practice of Parallel Programming, pages 167--178, San Diego, California, USA, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. Oracle Corp. The java language specification. http://java.sun.com/docs/books/jls/, 2011.Google ScholarGoogle Scholar
  35. E. Pozniansky and A. Schuster. Efficient On-the-Fly Data Race Detection in Multithreaded CGoogle ScholarGoogle Scholar
  36. Programs. In Proceedings of the ninth ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming, pages 179--190, San Diego, California, USA, 2003.Google ScholarGoogle Scholar
  37. E. Pozniansky and A. Schuster. MultiRace: Efficient on-the-fly Data Race Detection in Multithreaded C+ programs: Research Articles. Concurrency and Computation: Practice and Experience - Parallel and Distributed Systems: Testing and Debugging (PADTAD), 19:327--340, March 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. R. Purandare, M. Dwyer, and S. Elbaum. Monitor Optimization via Stutter-Equivalent Loop Transformation. In Proceedings of the Conference on Object-Oriented Programming Systems Languages and Applications, pages 270--285, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. I. Rogers, J. Zhao, C. Kirkham, and I. Watson. Constraint Based Optimization of Stationary Fields. In Proceedings of the International Symposium on Principles and Practice of Programming in Java, PPPJ '08, pages 95--104, New York, NY, USA, 2008. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. 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:391--411, November 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. Standard Performance Evaluation Corporation. SPECjbb2005. On-Line Documentation, 2005. http://www.spec.org/jbb2005.Google ScholarGoogle Scholar
  42. R. E. Strom and S. Yemini. Typestate: A programming language concept for enhancing software reliability. IEEE Trans. Softw. Eng., 12(1):157--171, 1986. Google ScholarGoogle ScholarDigital LibraryDigital Library
  43. C. Unkel. Stationary Fields in Object-Oriented Programs. PhD thesis, Stanford University, Stanford, CA, USA, 2009.Google ScholarGoogle Scholar
  44. C. Unkel and M. S. Lam. Automatic Inference of Stationary Fields: A Generalization of Java's Final Fields. In Proceedings of the Symposium on Principles of Programming Languages, pages 183--195, San Francisco, California, USA, January 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  45. J. W. Voung, R. Jhala, and S. Lerner. RELAY: Static Race Detection on Millions of Lines of Code. In Proceedings of the the 6th Joint Meeting of the European Software Engineering Conference and the ACM SIGSOFT Symposium on The foundations of Software Engineering, pages 205--214, Dubrovnik, Croatia, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  46. F. Xian, W. Srisa-an, and H. Jiang. Contention-Aware Scheduler: Unlocking Execution Parallelism in Multithreaded Java Programs. In Proceedings of the Conference on Object-Oriented Programming Systems Languages and Applications, pages 163--180, Nashville, TN, USA, October 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  47. Y. Yu, T. Rodeheffer, and W. Chen. RaceTrack: Efficient Detection of Data Race Conditions via Adaptive Tracking. In Proceedings of the ACM Symposium on Operating Systems Principles, pages 221--234, Brighton, United Kingdom, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. SOS: saving time in dynamic race detection with stationary analysis

    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

    Full Access

    • Published in

      cover image ACM SIGPLAN Notices
      ACM SIGPLAN Notices  Volume 46, Issue 10
      OOPSLA '11
      October 2011
      1063 pages
      ISSN:0362-1340
      EISSN:1558-1160
      DOI:10.1145/2076021
      Issue’s Table of Contents
      • cover image ACM Conferences
        OOPSLA '11: Proceedings of the 2011 ACM international conference on Object oriented programming systems languages and applications
        October 2011
        1104 pages
        ISBN:9781450309400
        DOI:10.1145/2048066

      Copyright © 2011 ACM

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 22 October 2011

      Check for updates

      Qualifiers

      • research-article

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader
    About Cookies On This Site

    We use cookies to ensure that we give you the best experience on our website.

    Learn more

    Got it!