skip to main content
research-article

Hybrid Static–Dynamic Analysis for Statically Bounded Region Serializability

Published:14 March 2015Publication History
Skip Abstract Section

Abstract

Data races are common. They are difficult to detect, avoid, or eliminate, and programmers sometimes introduce them intentionally. However, shared-memory programs with data races have unexpected, erroneous behaviors. Intentional and unintentional data races lead to atomicity and sequential consistency (SC) violations, and they make it more difficult to understand, test, and verify software. Existing approaches for providing stronger guarantees for racy executions add high run-time overhead and/or rely on custom hardware. This paper shows how to provide stronger semantics for racy programs while providing relatively good performance on commodity systems. A novel hybrid static--dynamic analysis called \emph{EnfoRSer} provides end-to-end support for a memory model called \emph{statically bounded region serializability} (SBRS) that is not only stronger than weak memory models but is strictly stronger than SC. EnfoRSer uses static compiler analysis to transform regions, and dynamic analysis to detect and resolve conflicts at run time. By demonstrating commodity support for a reasonably strong memory model with reasonable overheads, we show its potential as an always-on execution model.

References

  1. S. V. Adve and H.-J. Boehm. Memory Models: A Case for Rethinking Parallel Languages and Hardware. CACM, 53:90--101, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. S. V. Adve and M. D. Hill. Weak Ordering--A New Definition. In ISCA, pages 2--14, 1990. 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. W. Ahn, S. Qi, M. Nicolaides, J. Torrellas, J.-W. Lee, X. Fang, S. Midkiff, and D. Wong. BulkCompiler: High-performance Sequential Consistency through Cooperative Compiler and Hardware Support. In MICRO, pages 133--144, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. B. Alpern, S. Augart, S. M. Blackburn, M. Butrico, A. Cocchi, P. Cheng, J. Dolby, S. Fink, D. Grove, M. Hind, K. S. McKinley, M. Mergen, J. E. B. Moss, T. Ngo, and V. Sarkar. The Jikes Research Virtual Machine Project: Building an Open-Source Research Community. IBM Systems Journal, 44:399--417, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. S. M. Blackburn, R. Garner, C. Hoffman, A. M. Khan, K. S. McKinley, R. Bentzur, A. Diwan, D. Feinberg, D. Frampton, S. Z. Guyer, M. Hirzel, A. Hosking, M. Jump, H. Lee, J. E. B. Moss, A. Phansalkar, D. Stefanović, T. VanDrunen, D. von Dincklage, and B. Wiedermann. The DaCapo Benchmarks: Java Benchmarking Development and Analysis. In OOPSLA, pages 169--190, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. H.-J. Boehm. Position paper: Nondeterminism is Unavoidable, but Data Races are Pure Evil. In RACES, pages 9--14, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. H.-J. Boehm and S. V. Adve. Foundations of the CGoogle ScholarGoogle Scholar
  9. Concurrency Memory Model. In PLDI, pages 68--78, 2008.Google ScholarGoogle Scholar
  10. M. D. Bond, K. E. Coons, and K. S. McKinley. Pacer: Proportional Detection of Data Races. In PLDI, pages 255--268, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. M. D. Bond, M. Kulkarni, M. Cao, M. Zhang, M. Fathi Salmi, S. Biswas, A. Sengupta, and J. Huang. Octet: Capturing and Controlling Cross-Thread Dependences Efficiently. In OOPSLA, pages 693--712, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. C. Boyapati, R. Lee, and M. Rinard. Ownership Types for Safe Programming: Preventing Data Races and Deadlocks. In OOPSLA, pages 211--230, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. S. Burckhardt and M. Musuvathi. Effective Program Verification for Relaxed Memory Models. In CAV, pages 107--120, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. M. Cao, M. Zhang, and M. D. Bond. Drinking from Both Glasses: Adaptively Combining Pessimistic and Optimistic Synchronization for Efficient Parallel Runtime Support. In WoDet, 2014.Google ScholarGoogle Scholar
  15. L. Ceze, J. Devietti, B. Lucia, and S. Qadeer. A Case for System Support for Concurrency Exceptions. In HotPar, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. 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 PLDI, pages 258--269, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. R. Chugh, J. W. Voung, R. Jhala, and S. Lerner. Dataflow Analysis for Concurrent Programs using Datarace Detection. In PLDI, pages 316--326, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. M. de Kruijf and K. Sankaralingam. Idempotent Code Generation: Implementation, Analysis, and Evaluation. In CGO, pages 1--12, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. L. Effinger-Dean, B. Lucia, L. Ceze, D. Grossman, and H.-J. Boehm. IFRit: Interference-Free Regions for Dynamic Data-Race Detection. In OOPSLA, pages 467--484, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. 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
  21. J. Ferrante, K. J. Ottenstein, and J. D. Warren. The Program Dependence Graph and Its Use in Optimization. TOPLAS, 9(3):319--349, 1987. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. C. Flanagan and S. N. Freund. FastTrack: Efficient and Precise Dynamic Race Detection. In PLDI, pages 121--133, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. C. Flanagan and S. N. Freund. Adversarial Memory For Detecting Destructive Races. In PLDI, pages 244--254, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. K. Gharachorloo and P. B. Gibbons. Detecting Violations of Sequential Consistency. In SPAA, pages 316--326, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. L. Hammond, V. Wong, M. Chen, B. D. Carlstrom, J. D. Davis, B. Hertzberg, M. K. Prabhu, H. Wijaya, C. Kozyrakis, and K. Olukotun. Transactional Memory Coherence and Consistency. In ISCA, pages 102--113, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. T. Harris and K. Fraser. Language Support for Lightweight Transactions. In OOPSLA, pages 388--402, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. M. Herlihy and J. E. B. Moss. Transactional Memory: Architectural Support for Lock-Free Data Structures. In ISCA, pages 289--300, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. S. Horwitz, T. Reps, and D. Binkley. Interprocedural Slicing Using Dependence Graphs. In PLDI, pages 35--46, 1988. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. L. Lamport. Time, Clocks, and the Ordering of Events in a Distributed System. CACM, 21(7):558--565, 1978. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. L. Lamport. How to Make a Multiprocessor Computer That Correctly Executes Multiprocess Programs. IEEE Computer, 28:690--691, 1979. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. C. Lattner and V. Adve. LLVM: A Compilation Framework for Lifelong Program Analysis & Transformation. In CGO, pages 75--88, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. D. Lee, P. M. Chen, J. Flinn, and S. Narayanasamy. Chimera: Hybrid Program Analysis for Determinism. In PLDI, pages 463--474, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. D. Lee, B. Wester, K. Veeraraghavan, S. Narayanasamy, P. M. Chen, and J. Flinn. Respec: Efficient Online Multiprocessor Replay via Speculation and External Determinism. In ASPLOS, pages 77--90, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. C. Lin, V. Nagarajan, and R. Gupta. Efficient Sequential Consistency Using Conditional Fences. In PACT, pages 295--306, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. C. Lin, V. Nagarajan, R. Gupta, and B. Rajaram. Efficient Sequential Consistency via Conflict Ordering. In ASPLOS, pages 273--286, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. T. Lindholm and F. Yellin. The Java Virtual Machine Specification. Prentice Hall PTR, 2nd edition, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. S. Lu, S. Park, E. Seo, and Y. Zhou. Learning from Mistakes: A Comprehensive Study on Real World Concurrency Bug Characteristics. In ASPLOS, pages 329--339, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. S. Lu, J. Tucek, F. Qin, and Y. Zhou. AVIO: Detecting Atomicity Violations via Access-Interleaving Invariants. In ASPLOS, pages 37--48, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. B. Lucia, L. Ceze, K. Strauss, S. Qadeer, and H.-J. Boehm. Conflict Exceptions: Simplifying Concurrent Language Semantics with Precise Hardware Exceptions for Data-Races. In ISCA, pages 210--221, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. B. Lucia, J. Devietti, K. Strauss, and L. Ceze. Atom-Aid: Detecting and Surviving Atomicity Violations. In ISCA, pages 277--288, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. J. Manson, W. Pugh, and S. V. Adve. The Java Memory Model. In POPL, pages 378--391, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  42. D. Marino, A. Singh, T. Millstein, M. Musuvathi, and S. Narayanasamy. DRFx: A Simple and Efficient Memory Model for Concurrent Programming Languages. In PLDI, pages 351--362, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  43. D. Marino, A. Singh, T. Millstein, M. Musuvathi, and S. Narayanasamy. A Case for an SC-Preserving Compiler. In PLDI, pages 199--210, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  44. M. Musuvathi and S. Qadeer. Iterative Context Bounding for Systematic Testing of Multithreaded Programs. In PLDI, pages 446--455, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  45. M. Naik and A. Aiken. Conditional Must Not Aliasing for Static Race Detection. In POPL, pages 327--338, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  46. M. Naik, A. Aiken, and J. Whaley. Effective Static Race Detection for Java. In PLDI, pages 308--319, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  47. J. Ouyang, P. M. Chen, J. Flinn, and S. Narayanasamy. ...and region serializability for all. In HotPar, 2013.Google ScholarGoogle Scholar
  48. S. Park, Y. Zhou, W. Xiong, Z. Yin, R. Kaushik, K. H. Lee, and S. Lu. PRES: Probabilistic Replay with Execution Sketching on Multiprocessors. In SOSP, pages 177--192, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  49. P. Ranganathan, V. Pai, and S. Adve. Using Speculative Retirement and Larger Instruction Windows to Narrow the Performance Gap between Memory Consistency Models. In SPAA, page pages, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  50. C. G. Ritson and F. R. Barnes. An Evaluation of Intel's Restricted Transactional Memory for CPAs. In CPA, pages 271--292, 2013.Google ScholarGoogle Scholar
  51. M. Ronsse and K. De Bosschere. RecPlay: A Fully Integrated Practical Record/Replay System. TOCS, 17:133--152, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  52. D. Shasha and M. Snir. Efficient and Correct Execution of Parallel Programs that Share Memory. TOPLAS, 10(2):282--312, 1988. Google ScholarGoogle ScholarDigital LibraryDigital Library
  53. A. Singh, D. Marino, S. Narayanasamy, T. Millstein, and M. Musuvathi. Efficient Processor Support for DRFx, a Memory Model with Exceptions. In ASPLOS, pages 53--66, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  54. A. Singh, S. Narayanasamy, D. Marino, T. Millstein, and M. Musuvathi. End-to-End Sequential Consistency. In ISCA, pages 524--535, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  55. L. A. Smith, J. M. Bull, and J. Obdrzálek. A Parallel Java Grande Benchmark Suite. In SC, pages 8--8, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  56. Z. Sura, X. Fang, C.-L. Wong, S. P. Midkiff, J. Lee, and D. Padua. Compiler Techniques for High Performance Sequentially Consistent Java Programs. In PPoPP, pages 2--13, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  57. K. Veeraraghavan, D. Lee, B. Wester, J. Ouyang, P. M. Chen, J. Flinn, and S. Narayanasamy. DoublePlay: Parallelizing Sequential Logging and Replay. In ASPLOS, pages 15--26, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  58. C. von Praun and T. R. Gross. Static Conflict Analysis for Multi-Threaded Object-Oriented Programs. In PLDI, pages 115--128, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  59. J. Ševčík and D. Aspinall. On Validity of Program Transformations in the Java Memory Model. In ECOOP, pages 27--51, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  60. R. M. Yoo, C. J. Hughes, K. Lai, and R. Rajwar. Performance Evaluation of Intel Transactional Synchronization Extensions for High-Performance Computing. In SC, pages 19:1--19:11, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  61. M. Zhang, J. Huang, M. Cao, and M. D. Bond. LarkTM: Efficient, Strongly Atomic Software Transactional Memory. In PPoPP, 2015. To appear.Google ScholarGoogle Scholar
  62. W. Zhang, M. de Kruijf, A. Li, S. Lu, and K. Sankaralingam. ConAir: Featherweight Concurrency Bug Recovery via Single-threaded Idempotent Execution. In ASPLOS, pages 113--126, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Hybrid Static–Dynamic Analysis for Statically Bounded Region Serializability

    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

    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!