Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
10.1145/1791194.1791203acmotherconferencesArticle/Chapter ViewAbstractPublication PageswbiaConference Proceedingsconference-collections
research-article

ThreadSanitizer: data race detection in practice

Published: 12 December 2009 Publication History

Abstract

Data races are a particularly unpleasant kind of threading bugs. They are hard to find and reproduce -- you may not observe a bug during the entire testing cycle and will only see it in production as rare unexplainable failures. This paper presents ThreadSanitizer -- a dynamic detector of data races. We describe the hybrid algorithm (based on happens-before and locksets) used in the detector. We introduce what we call dynamic annotations -- a sort of race detection API that allows a user to inform the detector about any tricky synchronization in the user program. Various practical aspects of using ThreadSanitizer for testing multithreaded C++ code at Google are also discussed.

References

[1]
Chromium project. http://dev.chromium.org.
[2]
Intel Parallel Studio. http://software.intel.com/enus/intel-parallel-studio-home.
[3]
Intel Thread Checker. http://software.intel.com/en-us/intel-thread-checker.
[4]
Multi-Thread Run-time Analysis Tool for Java. http://www.alphaworks.ibm.com/tech/mtrat.
[5]
Pin - a dynamic binary instrumentation tool. http://www.pintool.org.
[6]
Sun Studio. http://developers.sun.com/sunstudio.
[7]
ThreadSanitizer project: documentation, source code, dynamic annotations, unit tests. http://code.google.com/p/data-race-test.
[8]
Valgrind project. Home of Memcheck, Helgrind and DRD. http://www.valgrind.org.
[9]
U. Banerjee, B. Bliss, Z. Ma, and P. Petersen. A theory of data race detection. In PADTAD '06: Proceedings of the 2006 workshop on Parallel and distributed systems: testing and debugging, pages 69--78, New York, NY, USA, 2006. ACM.
[10]
U. Banerjee, B. Bliss, Z. Ma, and P. Petersen. Unraveling Data Race Detection in the Intel® Thread Checker. In First Workshop on Software Tools for Multi-core Systems (STMCS), in conjunction with IEEE/ACM International Symposium on Code Generation and Optimization (CGO), March, volume 26, 2006.
[11]
D. Engler and K. Ashcraft. Racerx: effective, static detection of race conditions and deadlocks. In SOSP '03: Proceedings of the nineteenth ACM symposium on Operating systems principles, pages 237--252, New York, NY, USA, 2003. ACM.
[12]
F. Garcia and J. Fernandez. Posix thread libraries. Linux J., 70es (Feb. 2000):36, 2000.
[13]
J. J. Harrow. Runtime checking of multithreaded applications with visual threads. In Proceedings of the 7th International SPIN Workshop on SPIN Model Checking and Software Verification, pages 331--342, London, UK, 2000. Springer-Verlag.
[14]
L. Lamport. Time, clocks, and the ordering of events in a distributed system. Commun. ACM, 21(7):558--565, 1978.
[15]
C.-K. Luk, R. Cohn, R. Muth, H. Patil, A. Klauser, G. Lowney, S. Wallace, V. J. Reddi, and K. Hazelwood. Pin: building customized program analysis tools with dynamic instrumentation. In PLDI '05: Proceedings of the 2005 ACM SIGPLAN conference on Programming language design and implementation, pages 190--200, New York, NY, USA, 2005. ACM.
[16]
D. Marino, M. Musuvathi, and S. Narayanasamy. Literace: effective sampling for lightweight data-race detection. In PLDI '09: Proceedings of the 2009 ACM SIGPLAN conference on Programming language design and implementation, pages 134--143, New York, NY, USA, 2009. ACM.
[17]
S. Meyers and A. Alexandrescu. C++ and the Perils of Double-Checked Locking: Part I. DOCTOR DOBBS JOURNAL, 29:46--49, 2004.
[18]
S. Narayanasamy, Z. Wang, J. Tigani, A. Edwards, and B. Calder. Automatically classifying benign and harmful data races using replay analysis. In PLDI '07: Proceedings of the 2007 ACM SIGPLAN conference on Programming language design and implementation, pages 22--31, New York, NY, USA, 2007. ACM.
[19]
N. Nethercote and J. Seward. Valgrind: a framework for heavyweight dynamic binary instrumentation. In PLDI '07: Proceedings of the 2007 ACM SIGPLAN conference on Programming language design and implementation, pages 89--100, New York, NY, USA, 2007. ACM.
[20]
R. H. B. Netzer and B. P. Miller. What are race conditions?: Some issues and formalizations. ACM Letters on Programming Languages and Systems (LOPLAS), 1(1):74--88, 1992.
[21]
R. O'Callahan and J.-D. Choi. Hybrid dynamic data race detection. In PPoPP '03: Proceedings of the ninth ACM SIGPLAN symposium on Principles and practice of parallel programming, pages 167--178, New York, NY, USA, 2003. ACM.
[22]
S. Savage, M. Burrows, G. Nelson, P. Sobalvarro, and T. Anderson. Eraser: a dynamic data race detector for multithreaded programs. ACM Trans. Comput. Syst., 15(4):391--411, 1997.

Cited By

View all
  • (2024)The Rewriting of DataRaceBench Benchmark for OpenCL Program ValidationsWorkshop Proceedings of the 53rd International Conference on Parallel Processing10.1145/3677333.3678148(15-22)Online publication date: 12-Aug-2024
  • (2024)SSRD: Shapes and Summaries for Race Detection in Concurrent Data StructuresProceedings of the 2024 ACM SIGPLAN International Symposium on Memory Management10.1145/3652024.3665505(68-81)Online publication date: 20-Jun-2024
  • (2024)RTT-UAF: Reuse Time Tracking for Use-After-Free DetectionProceedings of the 38th ACM International Conference on Supercomputing10.1145/3650200.3656606(376-387)Online publication date: 30-May-2024
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Other conferences
WBIA '09: Proceedings of the Workshop on Binary Instrumentation and Applications
December 2009
70 pages
ISBN:9781605587936
DOI:10.1145/1791194
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: 12 December 2009

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. Valgrind
  2. concurrency bugs
  3. dynamic data race detection
  4. testing

Qualifiers

  • Research-article

Conference

WBIA '09

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)215
  • Downloads (Last 6 weeks)16
Reflects downloads up to 02 Sep 2024

Other Metrics

Citations

Cited By

View all
  • (2024)The Rewriting of DataRaceBench Benchmark for OpenCL Program ValidationsWorkshop Proceedings of the 53rd International Conference on Parallel Processing10.1145/3677333.3678148(15-22)Online publication date: 12-Aug-2024
  • (2024)SSRD: Shapes and Summaries for Race Detection in Concurrent Data StructuresProceedings of the 2024 ACM SIGPLAN International Symposium on Memory Management10.1145/3652024.3665505(68-81)Online publication date: 20-Jun-2024
  • (2024)RTT-UAF: Reuse Time Tracking for Use-After-Free DetectionProceedings of the 38th ACM International Conference on Supercomputing10.1145/3650200.3656606(376-387)Online publication date: 30-May-2024
  • (2024)Unified AddressSanitizer Framework for SYCL Kernel on CPU and GPU DeviceProceedings of the 12th International Workshop on OpenCL and SYCL10.1145/3648115.3648133(1-1)Online publication date: 8-Apr-2024
  • (2024)Hawkeyes: Addressing Weak Memory Order in Program Migration Based on Instruction WindowsProceedings of the 4th Workshop on Challenges and Opportunities of Efficient and Performant Storage Systems10.1145/3642963.3652204(17-22)Online publication date: 22-Apr-2024
  • (2024)Rooting for Efficiency: Mechanised Reasoning about Array-Based Trees in Separation LogicProceedings of the 13th ACM SIGPLAN International Conference on Certified Programs and Proofs10.1145/3636501.3636944(45-59)Online publication date: 9-Jan-2024
  • (2024)Predictive Monitoring against Pattern Regular LanguagesProceedings of the ACM on Programming Languages10.1145/36329158:POPL(2191-2225)Online publication date: 5-Jan-2024
  • (2024)Finding Correctness Bugs in eBPF Verifier with Structured and Sanitized ProgramProceedings of the Nineteenth European Conference on Computer Systems10.1145/3627703.3629562(689-703)Online publication date: 22-Apr-2024
  • (2024)When Is Parallelism Fearless and Zero-Cost with Rust?Proceedings of the 36th ACM Symposium on Parallelism in Algorithms and Architectures10.1145/3626183.3659966(27-40)Online publication date: 17-Jun-2024
  • (2024)Greybox Fuzzing for Concurrency TestingProceedings of the 29th ACM International Conference on Architectural Support for Programming Languages and Operating Systems, Volume 210.1145/3620665.3640389(482-498)Online publication date: 27-Apr-2024
  • Show More Cited By

View Options

Get Access

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media