AI Chat Paper
Note: Please note that the following content is generated by AMiner AI. SciOpen does not take any responsibility related to this content.
{{lang === 'zh_CN' ? '文章概述' : 'Summary'}}
{{lang === 'en_US' ? '中' : 'Eng'}}
Chat more with AI
Article Link
Collect
Submit Manuscript
Show Outline
Outline
Show full outline
Hide outline
Outline
Show full outline
Hide outline
Regular Paper

Minimal Context-Switching Data Race Detection with Dataflow Tracking

National Engineering Research Center for Big Data Technology and System, School of Computer Science and Technology Huazhong University of Science and Technology, Wuhan 430074, China
Services Computing Technology and System Laboratory, School of Computer Science and Technology, Huazhong University of Science and Technology, Wuhan 430074, China
Cluster and Grid Computing Laboratory, School of Computer Science and Technology, Huazhong University of Science and Technology, Wuhan 430074, China
Show Author Information

Abstract

Data race is one of the most important concurrent anomalies in multi-threaded programs. Emerging constraint-based techniques are leveraged into race detection, which is able to find all the races that can be found by any other sound race detector. However, this constraint-based approach has serious limitations on helping programmers analyze and understand data races. First, it may report a large number of false positives due to the unrecognized dataflow propagation of the program. Second, it recommends a wide range of thread context switches to schedule the reported race (including the false one) whenever this race is exposed during the constraint-solving process. This ad hoc recommendation imposes too many context switches, which complicates the data race analysis. To address these two limitations in the state-of-the-art constraint-based race detection, this paper proposes DFTracker, an improved constraint-based race detector to recommend each data race with minimal thread context switches. Specifically, we reduce the false positives by analyzing and tracking the dataflow in the program. By this means, DFTracker thus reduces the unnecessary analysis of false race schedules. We further propose a novel algorithm to recommend an effective race schedule with minimal thread context switches for each data race. Our experimental results on the real applications demonstrate that 1) without removing any true data race, DFTracker effectively prunes false positives by 68% in comparison with the state-of-the-art constraint-based race detector; 2) DFTracker recommends as low as 2.6–8.3 (4.7 on average) thread context switches per data race in the real world, which is 81.6% fewer context switches per data race than the state-of-the-art constraint based race detector. Therefore, DFTracker can be used as an effective tool to understand the data race for programmers.

Electronic Supplementary Material

Download File(s)
JCST-2105-11569-Highlights.pdf (402.4 KB)

References

[1]

Netzer R H B, Miller B P. What are race conditions?: Some issues and formalizations. ACM Letters on Programming Languages and Systems, 1992, 1(1): 74–88. DOI: 10.1145/130616.130623.

[2]

Lamport L. Time, clocks, and the ordering of events in a distributed system. Communications of the ACM, 1978, 21(7): 558–565. DOI: 10.1145/359545.359563.

[3]
Flanagan C, Freund S N. FastTrack: Efficient and precise dynamic race detection. In Proc. the 30th ACM SIGPLAN Conference on Programming Language Design and Implementation, Jun. 2009, pp.121–133. DOI: 10.1145/1542476.1542490.
[4]
Tessler C, Fisher N. BUNDLEP: Prioritizing conflict free regions in multi-threaded programs to improve cache reuse. In Proc. the 2018 IEEE Real-Time Systems Symposium, Dec. 2018, pp.325–337. DOI: 10.1109/RTSS.2018.00048.
[5]
Davis R I, Altmeyer S, Burns A. Mixed criticality systems with varying context switch costs. In Proc. the 2018 IEEE Real-Time and Embedded Technology and Applications Symposium, Apr. 2018, pp.140–151. DOI: 10.1109/RTAS.2018.00024.
[6]
Huang J, Zhang C, Dolby J. CLAP: Recording local executions to reproduce concurrency failures. In Proc. the 34th ACM SIGPLAN Conference on Programming Language Design and Implementation, Jun. 2013, pp.141–152. DOI: 10.1145/2491956.2462167.
[7]
Huang J, Meredith P O N, Rosu G. Maximal sound predictive race detection with control flow abstraction. In Proc. the 35th ACM SIGPLAN Conference on Programming Language Design and Implementation, Jun. 2014, pp.337–348. DOI: 10.1145/2594291.2594315.
[8]
Zheng L, Liao X F, Jin H, He B S, Xue J L, Liu H K. Towards concurrency race debugging: An integrated approach for constraint solving and dynamic slicing. In Proc. the 27th International Conference on Parallel Architectures and Compilation Techniques, Nov. 2018, Article No. 26. DOI: 10.1145/3243176.3243206.
[9]
Pereira J C, Machado N, Pinto J S. Testing for race conditions in distributed systems via SMT solving. In Proc. the 14th International Conference on Tests and Proofs, Jun. 2020, pp.122–140. DOI: 10.1007/978-3-030-50995-8_7.
[10]
De Moura L, Bjørner N. Z3: An efficient SMT solver. In Proc. the 14th International Conference on Tools and Algorithms for the Construction and Analysis of Systems, Mar. 2008, pp.337–340. DOI: 10.1007/978-3-540-78800-3_24.
[11]
Lu S, Park S, Seo E, Zhou Y Y. Learning from mistakes: A comprehensive study on real world concurrency bug characteristics. In Proc. the 13th International Conference on Architectural Support for Programming Languages and Operating Systems, Mar. 2008, pp.329–339. DOI: 10.1145/1346281.1346323.
[12]
Machado N, Lucia B, Rodrigues L. Concurrency debugging with differential schedule projections. In Proc. the 36th ACM SIGPLAN Conference on Programming Language Design and Implementation, Jun. 2015, pp.586–595. DOI: 10.1145/2737924.2737973.
[13]
Machado N, Lucia B, Rodrigues L. Production-guided concurrency debugging. In Proc. the 21st ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming, Feb. 2016, Article No. 29. DOI: 10.1145/2851141.2851149.
[14]
Mathur U, Pavlogiannis A, Viswanathan M. The complexity of dynamic data race prediction. In Proc. the 35th Annual ACM/IEEE Symposium on Logic in Computer Science, Jul. 2020, pp.713–727. DOI: 10.1145/3373718.3394783.
[15]
Zhang X Y, Gupta R. Whole execution traces. In Proc. the 37th International Symposium on Microarchitecture, Dec. 2004, pp.105–116. DOI: 10.1109/MICRO.2004.37.
[16]
Qin F, Wang C, Li Z M, Kim H S, Zhou Y Y, Wu Y F. LIFT: A low-overhead practical information flow tracking system for detecting security attacks. In Proc. the 39th Annual IEEE/ACM International Symposium on Microarchitecture, Dec. 2006, pp.135–148. DOI: 10.1109/MICRO.2006.29.
[17]
Zheng L, Liao X F, He B S, Wu S, Jin H. On performance debugging of unnecessary lock contentions on multicore processors: A replay-based approach. In Proc. the 2015 IEEE/ACM International Symposium on Code Generation and Optimization, Feb. 2015, pp.56–67. DOI: 10.1109/CGO.2015.7054187.
[18]
Cadar C, Dunbar D, Engler D. KLEE: Unassisted and automatic generation of high-coverage tests for complex systems programs. In Proc. the 8th USENIX Conference on Operating Systems Design and Implementation, Dec. 2008, pp.209–224.
[19]
Lattner C, Adve V. LLVM: A compilation framework for lifelong program analysis & transformation. In Proc. the International Symposium on Code Generation and Optimization, Mar. 2004, pp.75–86. DOI: 10.1109/CGO.2004.1281665.
[20]
Xu M, Kashyap S, Zhao H Q, Kim T. Krace: Data race fuzzing for kernel file systems. In Proc. the 2020 IEEE Symposium on Security and Privacy, May 2020, pp.1643–1660. DOI: 10.1109/SP40000.2020.00078.
[21]
Endo A T, Møller A. NodeRacer: Event race detection for Node. js applications. In Proc. the 13th IEEE International Conference on Software Testing, Validation and Verification, Oct. 2020, pp.120–130. DOI: 10.1109/ICST46399.2020.00022.
[22]

Mathur U, Kini D, Viswanathan M. What happens-after the first race? Enhancing the predictive power of happens-before based dynamic race detection. Proceedings of the ACM on Programming Languages, 2018, 2(OOPSLA): Article No. 145. DOI: 10.1145/3276515.

[23]
Xie X W, Xue J L. Acculock: Accurate and efficient detection of data races. In Proc. the International Symposium on Code Generation and Optimization, Apr. 2011, pp.201–212. DOI: 10.1109/CGO.2011.5764688.
[24]

Genç K, Roemer J, Xu Y F, Bond M D. Dependence-aware, unbounded sound predictive race detection. Proceedings of the ACM on Programming Languages, 2019, 3(OOPSLA): Article No. 179. DOI: 10.1145/3360605.

[25]
Roemer J, Genç K, Bond M D. SmartTrack: Efficient predictive race detection. In Proc. the 41st ACM SIGPLAN Conference on Programming Language Design and Implementation, Jun. 2020, pp.747–762. DOI: 10.1145/3385412.3385993.
[26]
Yang D Q, Ghasemazar A, Ren X W, Golub M, Lemieux G, Lis M. Procrustes: A dataflow and accelerator for sparse deep neural network training. In Proc. the 53rd Annual IEEE/ACM International Symposium on Microarchitecture, Oct. 2020, pp.711–724. DOI: 10.1109/MICRO50266.2020.00064.
[27]

Wongsuphasawat K, Smilkov D, Wexler J, Wilson J, Mané D, Fritz D, Krishnan D, Viégas F B, Wattenberg M. Visualizing dataflow graphs of deep learning models in tensorFlow. IEEE Trans. Visualization and Computer Graphics, 2018, 24(1): 1–12. DOI: 10.1109/TVCG.2017.2744878.

[28]

Lai L B, Qing Z, Yang Z Y, Jin X, Lai Z M, Wang R, Hao K Z, Lin X M, Qin L, Zhang W J, Zhang Y, Qian Z P, Zhou J R. Distributed subgraph matching on timely dataflow. Proceedings of the VLDB Endowment, 2019, 12(10): 1099–1112. DOI: 10.14778/3339490.3339494.

[29]
Chen R, Li S S, Li Z. From monolith to microservices: A dataflow-driven approach. In Proc. the 24th Asia-Pacific Software Engineering Conference, Dec. 2017, pp.466–475. DOI: 10.1109/APSEC.2017.53.
[30]
Zhang J Q, Xiong W W, Liu Y, Park S, Zhou Y Y, Ma Z Q. ATDetector: Improving the accuracy of a commercial data race detector by identifying address transfer. In Proc. the 44th Annual IEEE/ACM International Symposium on Microarchitecture, Dec. 2011, pp.206–215. DOI: 10.1145/2155620.2155645.
[31]
Abdulla P A, Arora J, Atig M F, Krishna S. Verification of programs under the release-acquire semantics. In Proc. the 40th ACM SIGPLAN Conference on Programming Language Design and Implementation, Jun. 2019, pp.1117–1132. DOI: 10.1145/3314221.3314649.
[32]
Inverso O, Trubiani C. Parallel and distributed bounded model checking of multi-threaded programs. In Proc. the 25th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming, Feb. 2020, pp.202–216. DOI: 10.1145/3332466.3374529.
Journal of Computer Science and Technology
Pages 211-226
Cite this article:
Zheng L, Li Y, Xin J, et al. Minimal Context-Switching Data Race Detection with Dataflow Tracking. Journal of Computer Science and Technology, 2024, 39(1): 211-226. https://doi.org/10.1007/s11390-023-1569-7

117

Views

0

Crossref

0

Web of Science

0

Scopus

0

CSCD

Altmetrics

Received: 07 May 2021
Accepted: 23 December 2023
Published: 25 January 2024
© Institute of Computing Technology, Chinese Academy of Sciences 2024
Return