ThreadSanitizer: data race detection in practice

  • Authors:
  • Konstantin Serebryany;Timur Iskhodzhanov

  • Affiliations:
  • OOO Google, Moscow, Russia;MIPT, Dolgoprudny, Russia

  • Venue:
  • Proceedings of the Workshop on Binary Instrumentation and Applications
  • Year:
  • 2009

Quantified Score

Hi-index 0.00

Visualization

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.