skip to main content
research-article
Open Access
Artifacts Evaluated & Functional

Instrumentation bias for dynamic data race detection

Published:12 October 2017Publication History
Skip Abstract Section

Abstract

This paper presents Fast Instrumentation Bias (FIB), a sound and complete dynamic data race detection algorithm that improves performance by reducing or eliminating the costs of analysis atomicity. In addition to checking for errors in target programs, dynamic data race detectors must introduce synchronization to guard against metadata races that may corrupt analysis state and compromise soundness or completeness. Pessimistic analysis synchronization can account for nontrivial performance overhead in a data race detector.

The core contribution of FIB is a novel cooperative ownership-based synchronization protocol whose states and transitions are derived purely from preexisting analysis metadata and logic in a standard data race detection algorithm. By exploiting work already done by the analysis, FIB ensures atomicity of dynamic analysis actions with zero additional time or space cost in the common case. Analysis of temporally thread-local or read-shared accesses completes safely with no synchronization. Uncommon write-sharing transitions require synchronous cross-thread coordination to ensure common cases may proceed synchronization-free.

We implemented FIB in the Jikes RVM Java virtual machine. Experimental evaluation shows that FIB eliminates nearly all instrumentation atomicity costs on programs where data often experience windows of thread-local access. Adaptive extensions to the ownership policy effectively eliminate high coordination costs of the core ownership protocol on programs with high rates of serialized sharing. FIB outperforms a naive pessimistic synchronization scheme by 50% on average. Compared to a tuned optimistic metadata synchronization scheme based on conventional fine-grained atomic compare-and-swap operations, FIB is competitive overall, and up to 17% faster on some programs. Overall, FIB effectively exploits latent analysis and program invariants to bring strong integrity guarantees to an otherwise unsynchronized data race detection algorithm at minimal cost.

References

  1. Sarita Adve. 2010. Data races are evil with no exceptions. Commun. ACM 53, 11 (Nov. 2010), 84.Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Sarita V. Adve and Hans-Juergen Boehm. 2010. Memory Models: A Case for Rethinking Parallel Languages and Hardware. Commun. ACM 53 (Aug. 2010). Issue 8.Google ScholarGoogle Scholar
  3. Sarita V. Adve and K. Gharachorloo. 1996. Shared Memory Consistency Models: A Tutorial. IEEE Computer 29, 12 (1996), 66–76. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Sarita V. Adve and Mark D. Hill. 1990. Weak Ordering—A New De�nition. In ACM/IEEE International Symposium on Computer Architecture.Google ScholarGoogle Scholar
  5. Sarita V. Adve, Mark D. Hill, Barton P. Miller, and Robert H. B. Netzer. 1991. Detecting Data Races on Weak Memory Systems. In ACM/IEEE International Symposium on Computer Architecture. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Bowen Alpern, C. Richard Attanasio, John J. Barton, Anthony Cocchi, Susan Flynn Hummel, Derek Lieber, Ton Ngo, Mark F. Mergen, Janice C. Shepherd, and Stephen E. Smith. 1999. Implementing Jalapeño in Java. In ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications. http://www.jikesrvm.org.Google ScholarGoogle Scholar
  7. David F. Bacon, Ravi Konuru, Chet Murthy, and Mauricio Serrano. 1998. Thin Locks: Featherweight Synchronization for Java. In ACM Conference on Programming Language Design and Implementation. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Utpal Banerjee, Brian Bliss, Zhiqiang Ma, and Paul Petersen. 2006. A Theory of Data Race Detection. In Workshop on Parallel and Distributed Systems: Testing, Analysis, and Debugging. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Tom Bergan, Owen Anderson, Joseph Devietti, Luis Ceze, and Dan Grossman. 2010. CoreDet: A Compiler and Runtime System for Deterministic Multithreaded Execution. In International Conference on Architectural Support for Programming Languages and Operating Systems. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Swarnendu Biswas, Minjia Zhang, Michael D. Bond, and Brandon Lucia. 2015. Valor: E�cient, Software-Only Region Con�ict Exceptions. In ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications.Google ScholarGoogle Scholar
  11. Stephen M. Blackburn, Robin Garner, Chris Ho�man, Asiad M. Khan, Kathryn S. McKinley, Rotem Bentzur, Amer Diwan, Daniel Feinberg, Daniel Frampton, Samuel Z. Guyer, Martin Hirzel, Antony Hosking, Maria Jump, Han Lee, J. Eliot B. Moss, Aashish Phansalkar, Darko Stefanović, Thomas VanDrunen, Daniel von Dincklage, and Ben Wiedermann. 2006. The DaCapo Benchmarks: Java Benchmarking Development and Analysis. In ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Hans-Juergen Boehm and Sarita V. Adve. 2008. Foundations of the C++ Concurrency Memory Model. In ACM Conference on Programming Language Design and Implementation. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Hans-Juergen Boehm and Sarita V. Adve. 2012. You Don’t Know Jack About Shared Variables or Memory Models. Commun. ACM 55, 2 (Feb. 2012), 48–54. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Michael D. Bond, Milind Kulkarni, Man Cao, Minjia Zhang, Meisam Fathi Salmi, Swarnendu Biswas, Aritra Sengupta, and Jipeng Huang. 2013. Octet: Capturing and Controlling Cross-Thread Dependences E�ciently. In ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Man Cao, Minjia Zhang, Aritra Sengupta, and Michael D. Bond. 2016. Drinking from Both Glasses: Combining Pessimistic and Optimistic Tracking of Cross-thread Dependences. In ACM Symposium on Principles and Practice of Parallel Programming.Google ScholarGoogle Scholar
  16. Luis Ceze, Joseph Devietti, Brandon Lucia, and Shaz Qadeer. 2009. A Case for System Support for Concurrency Exceptions. In USENIX Workshop on Hot Topics in Parallelism �HotPar).Google ScholarGoogle Scholar
  17. Jong-Deok Choi, Keunwoo Lee, Alexey Loginov, Robert O’Callahan, Vivek Sarkar, and Manu Sridharan. 2002. E�cient and Precise Datarace Detection for Multithreaded Object-Oriented Programs. In ACM Conference on Programming Language Design and Implementation.Google ScholarGoogle Scholar
  18. Jong-Deok Choi and Sang Lyul Min. 1991. Race Frontier: Reproducing Data Races in Parallel-Program Debugging. In ACM Symposium on Principles and Practice of Parallel Programming. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Mark Christaens and Koen De Bosschere. 2001. A Topological Approach to On-the-�y Race Detection in Java Programs. In Symposium on Java Virtual Machine Research and Technology.Google ScholarGoogle Scholar
  20. Joseph Devietti, Brandon Lucia, Luis Ceze, and Mark Oskin. 2009. DMP: Deterministic Shared Memory Multiprocessing. In International Conference on Architectural Support for Programming Languages and Operating Systems. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Joseph Devietti, Benjamin P. Wood, Karin Strauss, Luis Ceze, Dan Grossman, and Shaz Qadeer. 2012. RADISH: Always-On Sound and Complete Race Detection in Software and Hardware. In ACM/IEEE International Symposium on Computer Architecture. Google ScholarGoogle ScholarCross RefCross Ref
  22. Laura E�nger-Dean, Brandon Lucia, Luis Ceze, Dan Grossman, and Hans-Juergen Boehm. 2012. IFRit: Interference-free Regions for Dynamic Data-Race Detection. In ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications.Google ScholarGoogle Scholar
  23. Tayfun Elmas, Shaz Qadeer, and Serdar Tasiran. 2007. Goldilocks: A Race and Transaction-Aware Java Runtime. In ACM Conference on Programming Language Design and Implementation. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Colin Fidge. 1991. Logical Time in Distributed Computing Systems. IEEE Computer 24 (August 1991). Issue 8.Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Stephen J. Fink and Feng Qian. 2003. Design, Implementation and Evaluation of Adaptive Recompilation with On-stack Replacement. In Proceedings of the IEEE/ACM International Symposium on Code Generation and Optimization. Google ScholarGoogle ScholarCross RefCross Ref
  26. Cormac Flanagan and Stephen N. Freund. 2000. Type-Based Race Detection for Java. In ACM Conference on Programming Language Design and Implementation. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Cormac Flanagan and Stephen N. Freund. 2009. FastTrack: E�cient and Precise Dynamic Race Detection. In ACM Conference on Programming Language Design and Implementation. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. Cormac Flanagan and Stephen N. Freund. 2010. The RoadRunner Dynamic Analysis Framework for Concurrent Programs. In ACM SIGPLAN/SIGSOFT Workshop on Program Analysis for Software Tools and Engineering. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Cormac Flanagan and Stephen N. Freund. 2013. RedCard: Redundant Check Elimination For Dynamic Race Detectors. In European Conference on Object-Oriented Programming.Google ScholarGoogle Scholar
  30. Cormac Flanagan and Stephen N. Freund. 2017. The FastTrack2 Race Detector. Technical Report CSTR201701. Williams College. Working draft – accessed 25 August 2017.Google ScholarGoogle Scholar
  31. Cormac Flanagan, Stephen N. Freund, and Jaeheon Yi. 2008. Velodrome: A Sound And Complete Dynamic Atomicity Checker for Multithreaded Programs. In ACM Conference on Programming Language Design and Implementation. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. K. Kawachiya, A. Koseki, and T. Onodera. 2002. Lock Reservation: Java Locks Can Mostly Do Without Atomic Operations. In ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. Leslie Lamport. 1978. Time, Clocks, and the Ordering of Events in a Distributed System. Commun. ACM 21 (July 1978). Issue 7.Google ScholarGoogle Scholar
  34. Leslie Lamport. 1979. How to Make a Multiprocessor Computer That Correctly Executes Multiprocess Programs. IEEE Trans. Comput. C-28, 9 (1979), 690–691. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. Brandon Lucia, Luis Ceze, Karin Strauss, Shaz Qadeer, and Hans-Juergen Boehm. 2010. Con�ict Exceptions: Simplifying Concurrent Language Semantics with Precise Hardware Exceptions for Data-Races. In ACM/IEEE International Symposium on Computer Architecture.Google ScholarGoogle Scholar
  36. Jeremy Manson, William Pugh, and Sarita V. Adve. 2005. The Java Memory Model. In ACM Symposium on Principles of Programming Languages. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. Daniel Marino, Abhayendra Singh, Todd D. Millstein, Madanlal Musuvathi, and Satish Narayanasamy. 2010. DRFx: A Simple and E�cient Memory Model for Concurrent Programming Languages. In ACM Conference on Programming Language Design and Implementation. Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. Hassan Salehe Matar, Ismail Kuru, Serdar Tasiran, and Roman Dementiev. 2014. Accelerating Precise Race Detection Using Commercially-Available Hardware Transactional Memory Support. In Workshop on Determinism and Correctness in Parallel Programming.Google ScholarGoogle Scholar
  39. Friedemann Mattern. 1989. Virtual Time and Global States of Distributed Systems. In International Workshop on Parallel and Distributed Algorithms. 215–226.Google ScholarGoogle Scholar
  40. Sang L. Min and Jong-Deok Choi. 1991. An E�cient Cache-based Access Anomaly Detection Scheme. In International Conference on Architectural Support for Programming Languages and Operating Systems.Google ScholarGoogle Scholar
  41. Abdullah Muzahid, Dario Suárez, Shanxiang Qi, and Josep Torrellas. 2009. SigRace: Signature-Based Data Race Detection. In ACM/IEEE International Symposium on Computer Architecture. Google ScholarGoogle ScholarDigital LibraryDigital Library
  42. Mayur Naik, Alex Aiken, and John Whaley. 2006. E�ective Static Race Detection for Java. In ACM Conference on Programming Language Design and Implementation.Google ScholarGoogle ScholarDigital LibraryDigital Library
  43. Takuya Nakaike and Maged M. Michael. 2010. Lock Elision for Read-Only Critical Sections in Java. In ACM Conference on Programming Language Design and Implementation. Google ScholarGoogle ScholarDigital LibraryDigital Library
  44. Robert H. B. Netzer and Barton P. Miller. 1991. Improving the Accuracy of Data Race Detection. In ACM Symposium on Principles and Practice of Parallel Programming. Google ScholarGoogle ScholarDigital LibraryDigital Library
  45. Robert H. B. Netzer and Barton P. Miller. 1992. What Are Race Conditions?: Some Issues and Formalizations. ACM Letters on Programming Languages and Systems 1, 1 (March 1992), 74âĂŞ88.Google ScholarGoogle ScholarDigital LibraryDigital Library
  46. Marek Olszewski, Jason Ansel, and Saman Amarasinghe. 2009. Kendo: E�cient Deterministic Multithreading in Software. In International Conference on Architectural Support for Programming Languages and Operating Systems. Google ScholarGoogle ScholarDigital LibraryDigital Library
  47. Mark S. Papamarcos and Janak H. Patel. 1984. A Low-Overhead Coherence Solution for Multiprocessors with Private Cache Memories. In ACM/IEEE International Symposium on Computer Architecture. Google ScholarGoogle ScholarDigital LibraryDigital Library
  48. Yuanfeng Peng and Joseph Devietti. 2015. SlimFast: Reducing Metadata Redundancy in Sound & Complete Dynamic Data Race Detection. In PLDI Student Research Competition.Google ScholarGoogle Scholar
  49. Yuanfeng Peng, Benjamin P. Wood, and Joseph Devietti. 2017. PARSNIP: Performant Architecture for Race Safety with No Impact on Precision. In ACM/IEEE International Symposium on Microarchitecture.Google ScholarGoogle ScholarDigital LibraryDigital Library
  50. Filip Pizlo, Daniel Frampton, and Antony L. Hosking. 2011. Fine-grained Adaptive Biased Locking. In International Conference on Principles and Practice of Programming in Java. Google ScholarGoogle ScholarDigital LibraryDigital Library
  51. Milos Prvulovic. 2006. CORD: Cost-e�ective (and nearly overhead-free) Order-Recording and Data race detection. In International Symposium on High-Performance Computer Architecture. Google ScholarGoogle ScholarCross RefCross Ref
  52. Milos Prvulovic and Josep Torrellas. 2003. ReEnact: Using Thread-Level Speculation Mechanisms to Debug Data Races in Multithreaded Codes. In ACM/IEEE International Symposium on Computer Architecture. Google ScholarGoogle ScholarDigital LibraryDigital Library
  53. Ravi Rajwar and James R. Goodman. 2001. Speculative Lock Elision: Enabling Highly Concurrent Multithreaded Execution. In ACM/IEEE International Symposium on Microarchitecture.Google ScholarGoogle Scholar
  54. Dustin Rhodes, Cormac Flanagan, and Stephen N. Freund. 2017. BigFoot: Static Check Placement for Dynamic Race Detection. In ACM Conference on Programming Language Design and Implementation. Google ScholarGoogle ScholarDigital LibraryDigital Library
  55. Ian Rogers and Balaji Iyengar. 2011. Reducing Biased Lock Revocation By Learning. In Workshop on Implementation, Compilation, Optimization of Object-Oriented Languages, Programs and Systems. Google ScholarGoogle ScholarDigital LibraryDigital Library
  56. K. Russell and D. Detlefs. 2006. Eliminating Synchronization-Related Atomic Operations with Biased Locking and Bulk Rebiasing. In ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications. Google ScholarGoogle ScholarDigital LibraryDigital Library
  57. Stefan Savage, Michael Burrows, Greg Nelson, Patrick Sobalvarro, and Thomas Anderson. 1997. Eraser: A Dynamic Data Race Detector for Multithreaded Programs. ACM Transactions on Computer Systems 15, 4 (1997). Google ScholarGoogle ScholarDigital LibraryDigital Library
  58. Konstantin Serebryany and Timur Iskhodzhanov. 2009. ThreadSanitizer: Data Race Detection in Practice. In Workshop on Binary Instrumentation and Applications. Google ScholarGoogle ScholarDigital LibraryDigital Library
  59. Peter Sewell, Susmit Sarkar, Scott Owens, Francesco Zappa Nardelli, and Magnus O. Myreen. 2010. x86-TSO: A Rigorous and Usable Programmer’s Model for x86 Multiprocessors. Commun. ACM 53, 7 (July 2010), 89–97. Google ScholarGoogle ScholarDigital LibraryDigital Library
  60. Tatiana Shpeisman, Vijay Menon, Ali-Reza Adl-Tabatabai, Steven Balensiefer, Dan Grossman, Richard L. Hudson, Katherine F. Moore, and Bratin Saha. 2007. Enforcing Isolation and Ordering in STM. In ACM Conference on Programming Language Design and Implementation. Google ScholarGoogle ScholarDigital LibraryDigital Library
  61. Abhayendra Singh, Daniel Marino, Satish Narayanasamy, Todd D. Millstein, and Madanlal Musuvathi. 2011. E�cient Processor Support for DRFx, a Memory Model with Exceptions. In International Conference on Architectural Support for Programming Languages and Operating Systems.Google ScholarGoogle ScholarDigital LibraryDigital Library
  62. Standard Performance Evaluation Corporation. 2005. SPECjbb2005. http://www.spec.org/jbb2005/ . (2005).Google ScholarGoogle Scholar
  63. Nalini Vasudevan, Kedar S. Namjoshi, and Stephen A. Edwards. 2010. Simple and Fast Biased Locks. In International Conference on Parallel Architectures and Compilation Techniques. Google ScholarGoogle ScholarDigital LibraryDigital Library
  64. Christoph von Praun and Thomas Gross. 2001. Object Race Detection. In ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications. Google ScholarGoogle ScholarDigital LibraryDigital Library
  65. James R. Wilcox, Parker Finch, Cormac Flanagan, and Stephen N. Freund. 2015. Array Shadow State Compression for Precise Dynamic Race Detection. In IEEE/ACM International Conference on Automated Software Engineering.Google ScholarGoogle Scholar
  66. Benjamin P. Wood, Luis Ceze, and Dan Grossman. 2014. Low-Level Detection of Language-Level Data Races with LARD. In International Conference on Architectural Support for Programming Languages and Operating Systems. Google ScholarGoogle ScholarDigital LibraryDigital Library
  67. Xi Yang, Stephen M. Blackburn, Daniel Frampton, Jennifer B. Sartor, and Kathryn S. McKinley. 2011. Why Nothing Matters: The Impact of Zeroing. In ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications. Google ScholarGoogle ScholarDigital LibraryDigital Library
  68. Yuan Yu, Tom Rodehe�er, and Wei Chen. 2005. RaceTrack: E�cient Detection of Data Race Conditions via Adaptive Tracking. In ACM Symposium on Operating Systems Principles. Google ScholarGoogle ScholarDigital LibraryDigital Library
  69. P. Zhou, R. Teodorescu, and Y. Zhou. 2007. HARD: Hardware-Assisted Lockset-based Race Detection. In International Symposium on High-Performance Computer Architecture.Google ScholarGoogle Scholar

Index Terms

  1. Instrumentation bias for dynamic data race detection

          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!