Abstract
The happens-before (HB) relation is widely used to precisely detect data races, which are among the major causes of concurrency bugs. However, the HB relation is sensitive to thread interleaving; thus, hidden races that can be revealed in other thread interleavings may remain despite the repeated running of a program with an HB detector. In this paper, we propose a noise injection-based race detection technique (RaceInducer) that can expose and detect hidden races by using the runtime HB analysis result to determine the noise injection instants. RaceInducer delays a thread execution after the occurrence of the first no-lock non-racing accesses of three types (read-exclusive, write-exclusive, and read-shared) to a shared variable during a precise HB detection (FastTrack). Using this technique, RaceInducer can efficiently disturb the normal locking sequences between two threads that generate HB edges hiding data races. We implemented RaceInducer on the RoadRunner instrumentation framework for Java and evaluated its detection capability and runtime overheads on 12 real-world benchmark programs. The evaluation results showed that RaceInducer generated a lower runtime overhead compared to random noise injection that randomly injected noise for no-lock non-racing accesses and can detect more races with the same noise strength. RaceInducer generates particularly lower runtime overhead than the random noise injection for large programs that generates a high number of shared-memory accesses. In addition, we experimentally demonstrated that RaceInducer incurred lower runtime overheads than a current hidden-race detector (DrFinder) for programs with a relatively large number of locking operations.
Similar content being viewed by others
Change history
02 January 2020
The Acknowledgements section contains an error. The correct wording is given below.
Notes
Two accesses of different threads are not ordered by synchronization.
At least one of two accesses is a write [47].
References
Avros R, Dudka V, Křena B, Letko Z, Pluháčková H, Ur S, Vojnar T, Volkovich Z (2017) Boosted decision trees for behaviour mining of concurrent programmes. Concurr Comput: Pract Exp 29(21):1–21
Ball T, Burckhardt S, Coons KE, Musuvathi M, Qadeer S (2010) Preemption sealing for efficient concurrency testing. In: Proceedings of the 16th International Conference on Tools and Algorithms for the Construction and Analysis of Systems, pp 420–434
Biswas S, Cao M, Zhang M, Bond MD, Wood BP (2017) Lightweight data race detection for production runs. In: Proceedings of the 26th International Conference on Compiler Construction, pp 11–21
Blackburn et al (2006) The DaCapo benchmarks: Java benchmarking development and analysis. In: Proceedings of the 21st Annual ACM SIGPLAN Conference on Object-oriented Programming Systems, Languages, and Applications, pp 169–190
Bond et al (2010) Pacer: proportional detection of data races. In: Proceedings of the 31st ACM SIGPLAN Conference on Programming Language Design and Implementation, pp 255–268
Burckhardt S, Kothari P, Musuvathi M, Nagarakatte S (2010) A randomized scheduler with probabilistic guarantees of finding bugs. In: Proceedings of the 15th Edition of ASPLOS on Architectural Support for Programming Languages and Operating Systems, pp 167–178
Cai Y, Cao L (2015) Effective and precise dynamic detection of hidden races for java programs. In: Proceedings of the 10th Joint Meeting on Foundations of Software Engineering, pp 450–461
Edelstein O et al (2003) Framework for testing multi-threaded java programs. Concurr Comput: Pract Exp 15(3–5):485–499
Effinger-Dean et al (2012) IFRit: interference-free regions for dynamic data-race detection. In: Proceedings of the 27th ACM International Conference on Object Oriented Programming Systems Languages and Applications, pp 467–484
Eslamimehr M, Palsberg J (2014) Race directed scheduling of concurrent programs. In: Proceedings of the 19th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming, pp 301–314
Eytani Y, Farchi E, Ben-Asher Y (2003) Heuristics for finding concurrent bugs. In: Proceedings of the 17th International Symposium on Parallel and Distributed Processing, p 288.1
Fiedor J, Hrubá V, Křena B, Letko Z, Ur S, Vojnar T (2015) Advances in noise-based testing of concurrent software. Softw Test Verif Reliab 25(3):272–309
Fiedor J, Mužikovská M, Smrčka A, Vašíček O, Vojnar T (2018) Advances in the anaconda framework for dynamic analysis and testing of concurrent C/C++ programs. In: Proceedings of the 27th ACM SIGSOFT International Symposium on Software Testing and Analysis, pp 356–359
Fiedor J, Vojnar T (2013) Anaconda: a framework for analysing multi-threaded C/C++ programs on the binary level. In: Proceedings of the 3rd International Conference on Runtime Verification, vol 12, pp 35–41
Fiedor J, Vojnar T (2012) Noise-based testing and analysis of multi-threaded C/C++ programs on the binary level. In: Proceedings of the 2012 Workshop on Parallel And Distributed Systems: Testing, Analysis, and Debugging, pp 36–46
Flanagan C, Freund S (2017) The FASTTRACK2 race detector. Tech. rep., http://cs.williams.edu/,freund/papers/ft2-techreport.pdf
Flanagan C, Freund SN (2009) Fasttrack: efficient and precise dynamic race detection. In: Proceedings of the 30th ACM SIGPLAN Conference on Programming Language Design and Implementation, pp 121–133
Flanagan C, Freund SN (2010) The RoadRunner dynamic analysis framework for concurrent programs. In: Proceedings of the 9th ACM SIGPLAN-SIGSOFT Workshop on Program Analysis for Software Tools and Engineering, pp 1–8
Gunawi HS, Hao M, Leesatapornwongsa T, Patana-anake T, Do T, Adityatama J, Eliazar KJ, Laksono A, Lukman JF, Martin V, Satria AD (2014) What bugs live in the cloud? A study of 3000+ issues in cloud systems. In: Proceedings of the ACM Symposium on Cloud Computing, SOCC ’14, pp 7:1–7:14. ACM, New York. https://doi.org/10.1145/2670979.2670986
Guo et al (2015) Assertion guided symbolic execution of multithreaded programs. In: Proceedings of the 10th Joint Meeting on Foundations of Software Engineering, pp 854–865
Hrubá V, Křena B, Letko Z, Pluháčková H, Vojnar T (2014) Multi-objective genetic optimization for noise-based testing of concurrent software. In: Proceedings of the 6th International Symposium on Search Based Software Engineering, pp 107–122
Huang J, Meredith PO, Rosu G (2014) Maximal sound predictive race detection with control flow abstraction. In: Proceedings of the 35th ACM SIGPLAN Conference on Programming Language Design and Implementation, pp 337–348
Jackson J (2004) Nasdaq’s facebook glitch came from ’race conditions’. https://www.computerworld.com/article/2504676/financial-it/nasdaq-s-facebook-glitch-came-from--race-conditions-.html
Jesdanun A (2004) GE energy acknowledges blackout bug. The Associated Press. https://www.securityfocus.com/news/8032
Jikes RVM: Jikes RVM 3.1.3 (2013). https://sourceforge.net/projects/jikesrvm/files/jikesrvm/3.1.3/
Kini D, Mathur U, Viswanathan M (2017) Dynamic race prediction in linear time. In: Proceedings of the 38th ACM SIGPLAN Conference on Programming Language Design and Implementation, pp 157–170
Křena B, Letko Z, Vojnar T (2012) Noise injection heuristics for concurrency testing. In: Proceedings of the 7th International Doctoral Workshop on Mathematical and Engineering Methods in Computer Science, pp 123–135
Laguna I, Ahn DH, de Supinski BR, Gamblin T, Lee GL, Schulz M, Bagchi S, Kulkarni M, Zhou B, Chen Z, Qin F (2015) Debugging high-performance computing applications at massive scales. Commun ACM 58(9):72–81
Lamport L (1978) Time, clocks, and the ordering of events in a distributed system. Commun ACM 21(7):558–565
Leveson NG, Turner CS (1993) An investigation of the Therac-25 accidents. Computer 26(7):18–41
Li Y, Liu B, Huang J (2019) Sword: A scalable whole program race detector for java. In: Proceedings of the 41st International Conference on Software Engineering: Companion Proceedings, pp 75–78
Luo P, Zou D, Jin H, Du Y, Zheng L, Shen J (2018) DigHR: precise dynamic detection of hidden races with weak causal relation analysis. J Supercomput 74(6):2684–2704
Lv X, He F, Cai W, Cheng Y (2018) Supporting selective undo of string-wise operations for collaborative editing systems. Future Gener Comput Syst 82:41–62
Lv X, He F, Cai W, Cheng Y (2019) An optimized RGA supporting selective undo for collaborative text editing systems. J Parallel Distrib Comput 132:310–330
Marino et al (2009) LiteRace: effective sampling for lightweight data-race detection. In: Proceedings of the 30th ACM SIGPLAN Conference on Programming Language Design and Implementation, pp 134–143
Mattern F (1988) Virtual time and global states of distributed systems. In: Parallel and Distributed Algorithms, pp 215–226
Microsoft: Power framework delay fuzzing (2017). https://docs.microsoft.com/en-us/windows-hardware/drivers/devtest/concurrency-stress-test
Musuvathi et al (2008) Finding and reproducing heisenbugs in concurrent programs. In: Proceedings of the 8th USENIX Conference on Operating Systems Design and Implementation, vol 8, pp 267–280
Naik M, Aiken A, Whaley J (2006) Effective static race detection for java. In: Proceedings of the 27th ACM SIGPLAN Conference on Programming Language Design and Implementation, pp 308–319
O’Callahan R, Choi JD (2003) Hybrid dynamic data race detection. In: Proceedings of the 9th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming, pp 167–178
Pratikakis P, Foster JS, Hicks M (2006) Locksmith: context-sensitive correlation analysis for race detection. In: Proceedings of the 27th ACM SIGPLAN Conference on Programming Language Design and Implementation, pp 320–331
Radoi C, Dig D (2015) Effective techniques for static race detection in java parallel loops. ACM Trans Softw Eng Methodol 24(4):24:1–24:30
Rhodes D, Flanagan C, Freund SN (2017) Bigfoot: static check placement for dynamic race detection. In: Proceedings of the 38th ACM SIGPLAN Conference on Programming Language Design and Implementation, pp 141–156
Roemer J, Genç K, Bond MD (2018) High-coverage, unbounded sound predictive race detection. In: Proceedings of the 39th ACM SIGPLAN Conference on Programming Language Design and Implementation, pp 374–389
Savage S et al (1997) Eraser: a dynamic data race detector for multithreaded programs. ACM Trans Comput Syst 15(4):391–411
Sen K (2008) Race directed random testing of concurrent programs. In: Proceedings of the 29th ACM SIGPLAN Conference on Programming Language Design and Implementation, pp 11–21
Shasha D, Snir M (1988) Efficient and correct execution of parallel programs that share memory. ACM Trans Program Lang Syst 10(2):282–312
Smaragdakis et al (2012) Sound predictive race detection in polynomial time. In: Proceedings of the 39th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pp 387–400
Voung JW, Jhala R, Lerner S (2007) Relay: static race detection on millions of lines of code. In: Proceedings of the 6th Joint Meeting of the European Software Engineering Conference and the ACM SIGSOFT Symposium on the Foundations of Software Engineering, pp 205–214
Wang C, Said M, Gupta A (2011) Coverage guided systematic concurrency testing. In: Proceedings of the 33rd International Conference on Software Engineering, pp 221–230
Wilcox JR, Flanagan C, Freund SN (2018) Verified FT: a verified, high-performance precise dynamic race detector. In: Proceedings of the 23rd ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming, pp 354–367. ACM
Wu Z, Lu K, Wang X (2015) Efficiently trigger data races through speculative execution. In: Proceedings of the 17th International Conference on High Performance Computing and Communications, pp 90–95
Wu Z, Lu K, Wang X, Zhou X, Chen C (2015) Detecting harmful data races through parallel verification. J Supercomput 71(8):2922–2943
Xie X et al (2013) Acculock: accurate and efficient detection of data races. Softw: Pract Exp 43(5):543–576
Yang J, Jiang B, Chan WK (2018) Histlock+: precise memory access maintenance without lockset comparison for complete hybrid data race detection. IEEE Trans Reliab 67(3):786–801. https://doi.org/10.1109/TR.2018.2832226
Yang J, Yang C, Chan WK (2016) Histlock: Efficient and sound hybrid detection of hidden predictive data races with functional contexts. In: Proceedings in the 2016 IEEE International Conference on Software Quality, Reliability and Security, pp 13–24
Yu J, Narayanasamy S, Pereira C, Pokam G (2012) Maple: A coverage-driven testing tool for multithreaded programs. In: Proceedings of the 27th ACM International Conference on Object Oriented Programming Systems Languages and Applications, pp 485–502
Yu M, Bae DH (2016) SimpleLock+: fast and accurate hybrid data race detection. Comput J 59(6):793–809
Yu M, Lee JS, Bae DH (2018) Adaptivelock: efficient hybrid data race detection based on real-world locking patterns. Int J Parallel Program
Acknowledgements
This work was supported by Institute for Information & communications Technology Promotion (IITP) grant funded by the Korea government (MSIP) (No.R0126-18-1101 (SW Star Lab) Software R&D for Model-based Analysis and Verification of Higher-order Large Complex System, and No.1711073912, Neuromorphic Computing Software Platform for Artificial Intelligence Systems).
Author information
Authors and Affiliations
Corresponding author
Additional information
Publisher's Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Rights and permissions
About this article
Cite this article
Yu, M., Ma, YS. & Bae, DH. Efficient noise injection for exposing hidden data races. J Supercomput 76, 292–323 (2020). https://doi.org/10.1007/s11227-019-03031-0
Published:
Issue Date:
DOI: https://doi.org/10.1007/s11227-019-03031-0