skip to main content
10.1145/1806596.1806625acmconferencesArticle/Chapter ViewAbstractPublication PagespldiConference Proceedingsconference-collections
research-article

Adversarial memory for detecting destructive races

Published:05 June 2010Publication History

ABSTRACT

Multithreaded programs are notoriously prone to race conditions, a problem exacerbated by the widespread adoption of multi-core processors with complex memory models and cache coherence protocols. Much prior work has focused on static and dynamic analyses for race detection, but these algorithms typically are unable to distinguish destructive races that cause erroneous behavior from benign races that do not. Performing this classification manually is difficult, time consuming, and error prone.

This paper presents a new dynamic analysis technique that uses adversarial memory to classify race conditions as destructive or benign on systems with relaxed memory models. Unlike a typical language implementation, which may only infrequently exhibit non-sequentially consistent behavior, our adversarial memory implementation exploits the full freedom of the memory model to return older, unexpected, or stale values for memory reads whenever possible, in an attempt to crash the target program (that is, to force the program to behave erroneously). A crashing execution provides concrete evidence of a destructive bug, and this bug can be strongly correlated with a specific race condition in the target program.

Experimental results with our Jumble prototype for Java demonstrate that adversarial memory is highly effective at identifying destructive race conditions, and in distinguishing them from race conditions that are real but benign. Adversarial memory can also reveal destructive races that would not be detected by traditional testing (even after thousands of runs) or by model checkers that assume sequential consistency.

References

  1. M. Abadi, C. Flanagan, and S. N. Freund. Types for safe locking: Static race detection for Java. TOPLAS, 28(2):207--255, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. S. V. Adve and K. Gharachorloo. Shared memory consistency models: A tutorial. IEEE Computer, 29(12):66--76, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. S. V. Adve, M. D. Hill, B. P. Miller, and R. H. B. Netzer. Detecting data races on weak memory systems. In ISCA, pages 234--243, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. R. Agarwal and S. D. Stoller. Type inference for parameterized race-free Java. In VMCAI, pages 149--160, 2004.Google ScholarGoogle ScholarCross RefCross Ref
  5. A. Aiken and D. Gay. Barrier inference. In POPL, pages 243--354, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. M. D. Bond, K. E. Coons, and K. S. McKinley. Pacer: Proportional detection of data races. In PLDI, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. G. Boudol and G. Petri. Relaxed memory models: an operational approach. In POPL, pages 392--403, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. C. Boyapati and M. Rinard. A parameterized type system for race-free Java programs. In OOPSLA, pages 56--69, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. J. Burnim, K. Sen, and C. Stergiou. Sound and complete monitoring of sequential consistency in relaxed memory models. Technical Report UCB/EECS-2010-31, EECS Department, University of California, Berkeley, 2010.Google ScholarGoogle Scholar
  10. J. Burnim, K. Sen, and C. Stergiou. Testing concurrent programs on relaxed memory models. Technical Report UCB/EECS-2010-32, EECS Department, University of California, Berkeley, 2010.Google ScholarGoogle Scholar
  11. A. T. Chamillard, L. A. Clarke, and G. S. Avrunin. An empirical comparison of static concurrency analysis techniques. Technical Report 96-084, Department of Computer Science, University of Massachusetts at Amherst, 1996.Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. J.-D. Choi, K. Lee, A. Loginov, R. O'Callahan, V. Sarkar, and M. Sridhara. Efficient and precise datarace detection for multithreaded object-oriented programs. In PLDI, pages 258--269, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. J.-D. Choi, B. P. Miller, and R. H. B. Netzer. Techniques for debugging parallel programs with flowback analysis. TOPLAS, 13(4):491--530, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. M. Christiaens and K. D. Bosschere. TRaDe: Data Race Detection for Java. In International Conference on Computational Science, pages 761--770, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. T. Elmas, S. Qadeer, and S. Tasiran. Goldilocks: A race and transaction-aware Java runtime. In PLDI, pages 245--255, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. D. R. Engler and K. Ashcraft. RacerX: Effective, static detection of race conditions and deadlocks. In SOSP, pages 237--252, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. C. Flanagan and S. N. Freund. FastTrack: Efficient and precise dynamic race detection. In PLDI, pages 121--133, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. C. Flanagan and S. N. Freund. The RoadRunner dynamic analysis framework for concurrent programs. In ACM Workshop on Program Analysis for Software Tools and Engineering, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. K. Gharachorloo. Memory Consistency Models for Shared-Memory Multiprocessors. PhD thesis, Stanford University, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. D. Grossman. Type-safe multithreading in Cyclone. In TLDI, pages 13--25, 2003.Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Java Grande Forum. Java Grande benchmark suite. Available at http://www.javagrande.org/, 2008.Google ScholarGoogle Scholar
  22. L. Lamport. How to make a multiprocessor computer that correctly executes multiprocess programs. IEEE Trans. Comput., 28(9):690--691, 1979. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. R. J. Lipton. Reduction: A method of proving properties of parallel programs. Communications of the ACM, 18(12):717--721, 1975. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. S. Lu, S. Park, C. Hu, X. Ma, W. Jiang, Z. Li, R. A. Popa, and Y. Zhou. Muvi: automatically inferring multi-variable access correlations and detecting related semantic and concurrency bugs. In SOSP, pages 103--116, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. J. Manson, W. Pugh, and S. V. Adve. The Java memory model. In POPL, pages 378--391, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. F. Mattern. Virtual time and global states of distributed systems. In Workshop on Parallel and Distributed Algorithms, 1988.Google ScholarGoogle Scholar
  27. M. Musuvathi, S. Qadeer, T. Ball, G. Basler, P. A. Nainar, and I. Neamtiu. Finding and reproducing heisenbugs in concurrent programs. In OSDI, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. M. Naik, A. Aiken, and J. Whaley. Effective static race detection for Java. In PLDI, pages 308--319, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. S. Narayanasamy, Z. Wang, J. Tigani, A. Edwards, and B. Calder. Automatically classifying benign and harmful data races using replay analysis. In PLDI, pages 22--31, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. H. Nishiyama. Detecting data races using dynamic escape analysis based on read barrier. In Virtual Machine Research and Technology Symposium, pages 127--138, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. S. Owens, S. Sarkar, and P. Sewell. A better x86 memory model: x86-TSO. In TPHOLs, pages 391--407, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. E. Pozniansky and A. Schuster. Efficient on-the-fly data race detection in multihreaded C++ programs. In PPOPP, pages 179--190, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. E. Pozniansky and A. Schuster. MultiRace: Efficient on-the-fly data race detection in multithreaded C++ programs. Concurrency and Computation: Practice and Experience, 19(3):327--340, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. M. Ronsse and K. D. Bosschere. RecPlay: A fully integrated practical record/replay system. TCS, 17(2):133--152, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. S. Savage, M. Burrows, G. Nelson, P. Sobalvarro, and T. E. Anderson. Eraser: A dynamic data race detector for multi-threaded programs. TOCS, 15(4):391--411, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. K. Sen. Race directed random testing of concurrent programs. In PLDI, pages 11--21, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. Standard Performance Evaluation Corporation. SPEC benchmarks. http://www.spec.org/, 2003.Google ScholarGoogle Scholar
  38. N. Sterling. Warlock: A static data race analysis tool. In USENIX Winter Technical Conference, pages 97--106, 1993.Google ScholarGoogle Scholar
  39. M. Vaziri, F. Tip, and J. Dolby. Associating synchronization constraints with data in an object-oriented language. In POPL, pages 334--345, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. W. Visser and P. C. Mehlitz. Model checking programs with Java PathFinder. In SPIN, page 27, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. C. von Praun and T. Gross. Object race detection. In OOPSLA, pages 70--82, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  42. C. von Praun and T. Gross. Static conflict analysis for multi-threaded object-oriented programs. In PLDI, pages 115--128, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  43. J. W. Voung, R. Jhala, and S. Lerner. Relay: Static race detection on millions of lines of code. In FSE, pages 205--214, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  44. E. Yahav. Verifying safety properties of concurrent Java programs using 3-valued logic. In POPL, pages 27--40, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  45. Y. Yu, T. Rodeheffer, and W. Chen. RaceTrack: Efficient detection of data race conditions via adaptive tracking. In SOSP, pages 221--234, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Adversarial memory for detecting destructive races

              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
                PLDI '10: Proceedings of the 31st ACM SIGPLAN Conference on Programming Language Design and Implementation
                June 2010
                514 pages
                ISBN:9781450300193
                DOI:10.1145/1806596
                • cover image ACM SIGPLAN Notices
                  ACM SIGPLAN Notices  Volume 45, Issue 6
                  PLDI '10
                  June 2010
                  496 pages
                  ISSN:0362-1340
                  EISSN:1558-1160
                  DOI:10.1145/1809028
                  Issue’s Table of Contents

                Copyright © 2010 ACM

                Publisher

                Association for Computing Machinery

                New York, NY, United States

                Publication History

                • Published: 5 June 2010

                Permissions

                Request permissions about this article.

                Request Permissions

                Check for updates

                Qualifiers

                • research-article

                Acceptance Rates

                Overall Acceptance Rate406of2,067submissions,20%

              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!