HistLock+: Precise Memory Access Maintenance Without Lockset Comparison for Complete Hybrid Data Race Detection

Dynamic hybrid data race detectors alleviate the detection imprecision problem incurred by pure lockset-based race detectors and the thread interleaving sensitive problem incurred by pure happens-before race detectors. Nonetheless, to ensure at least one data race on every memory location to be detected, keeping all historical memory access events in the analysis state of such a detector is impractical. Existing complete hybrid race detectors perform extensive comparisons among the locksets of the memory accesses on each memory location to identify which of them to be retained in its analysis state, which incurs significant runtime overhead. In this paper, we investigate to what extent a complete hybrid data race detector able to perform such identifications without lockset comparison. We present HistLock+, which is built atop thread epoch and lock release events to infer whether two memory accesses on the same memory location from the same thread in between consecutive lock release operations have any lock subset relation without performing expensive lockset comparison. HistLock+ guarantees exactly one racy memory access event to be reported on each thread segment separated by lock releases and hard-order thread synchronizations, and it never reports false positive on lockset violation. We have validated HistLock+ using the PARSEC benchmark suite and four real-world applications. The experimental results showed that HistLock+ was 122% faster and 28% more memory-efficient than the previous state-of-the-art complete hybrid race detector. Moreover, HistLock+ achieved the highest effectiveness in race detection among all evaluated race detectors in our experiment.

[1]  Leslie Lamport,et al.  Time, clocks, and the ordering of events in a distributed system , 1978, CACM.

[2]  Michael Burrows,et al.  Eraser: a dynamic data race detector for multi-threaded programs , 1997, TOCS.

[3]  L. Dagum,et al.  OpenMP: an industry standard API for shared-memory programming , 1998 .

[4]  Stephen N. Freund,et al.  Type-based race detection for Java , 2000, PLDI '00.

[5]  Friedemann Mattern,et al.  Virtual Time and Global States of Distributed Systems , 2002 .

[6]  Jong-Deok Choi,et al.  Hybrid dynamic data race detection , 2003, PPoPP '03.

[7]  Dawson R. Engler,et al.  RacerX: effective, static detection of race conditions and deadlocks , 2003, SOSP '03.

[8]  Assaf Schuster,et al.  Efficient on-the-fly data race detection in multithreaded C++ programs , 2003, PPoPP '03.

[9]  Wei Chen,et al.  RaceTrack: efficient detection of data race conditions via adaptive tracking , 2005, SOSP '05.

[10]  Martín Abadi,et al.  Types for safe locking: Static race detection for Java , 2006, TOPL.

[11]  Sorin Lerner,et al.  RELAY: static race detection on millions of lines of code , 2007, ESEC-FSE '07.

[12]  Yuanyuan Zhou,et al.  Learning from mistakes: a comprehensive study on real world concurrency bug characteristics , 2008, ASPLOS.

[13]  Kai Li,et al.  The PARSEC benchmark suite: Characterization and architectural implications , 2008, 2008 International Conference on Parallel Architectures and Compilation Techniques (PACT).

[14]  Koushik Sen,et al.  Race directed random testing of concurrent programs , 2008, PLDI '08.

[15]  Satish Narayanasamy,et al.  A case for an interleaving constrained shared-memory multi-processor , 2009, ISCA '09.

[16]  Walter F. Tichy,et al.  Helgrind+: An efficient dynamic race detector , 2009, 2009 IEEE International Symposium on Parallel & Distributed Processing.

[17]  Satish Narayanasamy,et al.  LiteRace: effective sampling for lightweight data-race detection , 2009, PLDI '09.

[18]  Konstantin Serebryany,et al.  ThreadSanitizer: data race detection in practice , 2009, WBIA '09.

[19]  Stephen N. Freund,et al.  FastTrack: efficient and precise dynamic race detection , 2009, PLDI '09.

[20]  Shing-Chi Cheung,et al.  Detecting atomic-set serializability violations in multithreaded programs through active randomized testing , 2010, 2010 ACM/IEEE 32nd International Conference on Software Engineering.

[21]  Sebastian Burckhardt,et al.  Line-up: a complete and automatic linearizability checker , 2010, PLDI '10.

[22]  Michael D. Bond,et al.  PACER: proportional detection of data races , 2010, PLDI '10.

[23]  Jingling Xue,et al.  Acculock: Accurate and efficient detection of data races , 2011, International Symposium on Code Generation and Optimization (CGO 2011).

[24]  Grigore Rosu,et al.  Maximal Causal Models for Sequentially Consistent Systems , 2012, RV.

[25]  Yannis Smaragdakis,et al.  Sound predictive race detection in polynomial time , 2012, POPL '12.

[26]  Dan Grossman,et al.  IFRit: interference-free regions for dynamic data-race detection , 2012, OOPSLA '12.

[27]  T. H. Tse,et al.  CARISMA: a context-sensitive approach to race-condition sample-instance selection for multithreaded applications , 2012, ISSTA 2012.

[28]  Satish Narayanasamy,et al.  Maple: a coverage-driven testing tool for multithreaded programs , 2012, OOPSLA '12.

[29]  Doo-Hwan Bae,et al.  SimpleLock: Fast and Accurate Hybrid Data Race Detector , 2013, 2013 International Conference on Parallel and Distributed Computing, Applications and Technologies.

[30]  Stephen N. Freund,et al.  RedCard: Redundant Check Elimination for Dynamic Race Detectors , 2013, ECOOP.

[31]  W. K. Chan,et al.  Lock Trace Reduction for Multithreaded Programs , 2013, IEEE Transactions on Parallel and Distributed Systems.

[32]  Grigore Rosu,et al.  Maximal sound predictive race detection with control flow abstraction , 2014, PLDI.

[33]  Adam Betts,et al.  Concurrency testing using schedule bounding: an empirical study , 2014, PPoPP '14.

[34]  Yan Cai,et al.  Effective and precise dynamic detection of hidden races for Java programs , 2015, ESEC/SIGSOFT FSE.

[35]  Wing Kwong Chan,et al.  ASP: Abstraction Subspace Partitioning for Detection of Atomicity Violations with an Empirical Study , 2016, IEEE Transactions on Parallel and Distributed Systems.

[36]  W. K. Chan,et al.  HistLock: Efficient and Sound Hybrid Detection of Hidden Predictive Data Races with Functional Contexts , 2016, 2016 IEEE International Conference on Software Quality, Reliability and Security (QRS).

[37]  Michael D. Bond,et al.  An Online Dynamic Analysis for Sound Predictive Data Race Detection , 2016 .

[38]  Doo-Hwan Bae,et al.  SimpleLock+: Fast and Accurate Hybrid Data Race Detection , 2016, Comput. J..

[39]  Mahesh Viswanathan,et al.  Dynamic race prediction in linear time , 2017, PLDI.