Data race is one of the most important concurrent anomalies in multi-threaded programs.Emerging con-straint-based techniques are leveraged into race detection,which is able to find all the races that can be found by a...Data race is one of the most important concurrent anomalies in multi-threaded programs.Emerging con-straint-based techniques are leveraged into race detection,which is able to find all the races that can be found by any oth-er 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 propa-gation of the program.Second,it recommends a wide range of thread context switches to schedule the reported race(in-cluding 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 detec-tor to recommend each data race with minimal thread context switches.Specifically,we reduce the false positives by ana-lyzing 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 con-text 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 detec-tor.Therefore,DFTracker can be used as an effective tool to understand the data race for programmers.展开更多
Data races are ubiquitous in multi-threaded ap- plications, but they are by no means easy to detect. One of the most important reasons is the complexity of thread in- terleavings. A volume of research has been devoted...Data races are ubiquitous in multi-threaded ap- plications, but they are by no means easy to detect. One of the most important reasons is the complexity of thread in- terleavings. A volume of research has been devoted to the interleaving-insensitive detection. However, all the previous work focuses on the uniform detection (unknown to the char- acteristics of thread interleavings), thereby making the detec- tion defective in either reporting false positives or suffering from prohibitive overhead. To cope with the problem above, we propose an efficient, precise, and sound step-by-step res- olution based on the characteristics of thread interleavings. We first try to tease apart the categories of thread interleav- ings from the several typical sources arising from the lock synchronizations. We then conduct a brief study and find a new and complex pattern the previous work cannot detect. It is also revealed that the simple pattern with the majority of thread interleavings can be resolved by a simple processing to achieve a big profit for the previous reordering-based design. Our final experimental results demonstrate the effectiveness of our empiricism-based approach, and show that 51.0% of execution time and 52.3 % of trace size arising from the state- of-the-art reordering technique can be saved through a quick filtering of the simple pattern with a negligible (4.45%) per- formance overhead introduced on-the-fly.展开更多
在多重中断C程序中,中断嵌套可能会导致一些非期望的交叠执行,从而造成错误的程序执行结果。典型的问题是共享变量引起的数据竞争破坏了程序的原子性。针对此类问题,对多重中断C程序的运行时语义进行建模,根据共享变量的访问给出了一种...在多重中断C程序中,中断嵌套可能会导致一些非期望的交叠执行,从而造成错误的程序执行结果。典型的问题是共享变量引起的数据竞争破坏了程序的原子性。针对此类问题,对多重中断C程序的运行时语义进行建模,根据共享变量的访问给出了一种原子性的定义,提出了相应的数据竞争及原子性检测方法,并采用函数摘要技术缩减静态分析过程中所需遍历的程序状态。最后,设计并实现了一个数据竞争及原子性检测原型工具MIDAC(multiple interruption C program data race and atomicity checker),实验结果表明,该工具能够针对一定规模的实际程序得到很好的检测效果。展开更多
基金This work is supported by the National Key Research and Development Program of China under Grant No.2023YFB4503400the National Natural Science Foundation of China under Grant Nos.62322205,62072195,and 61825202.
文摘Data race is one of the most important concurrent anomalies in multi-threaded programs.Emerging con-straint-based techniques are leveraged into race detection,which is able to find all the races that can be found by any oth-er 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 propa-gation of the program.Second,it recommends a wide range of thread context switches to schedule the reported race(in-cluding 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 detec-tor to recommend each data race with minimal thread context switches.Specifically,we reduce the false positives by ana-lyzing 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 con-text 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 detec-tor.Therefore,DFTracker can be used as an effective tool to understand the data race for programmers.
文摘Data races are ubiquitous in multi-threaded ap- plications, but they are by no means easy to detect. One of the most important reasons is the complexity of thread in- terleavings. A volume of research has been devoted to the interleaving-insensitive detection. However, all the previous work focuses on the uniform detection (unknown to the char- acteristics of thread interleavings), thereby making the detec- tion defective in either reporting false positives or suffering from prohibitive overhead. To cope with the problem above, we propose an efficient, precise, and sound step-by-step res- olution based on the characteristics of thread interleavings. We first try to tease apart the categories of thread interleav- ings from the several typical sources arising from the lock synchronizations. We then conduct a brief study and find a new and complex pattern the previous work cannot detect. It is also revealed that the simple pattern with the majority of thread interleavings can be resolved by a simple processing to achieve a big profit for the previous reordering-based design. Our final experimental results demonstrate the effectiveness of our empiricism-based approach, and show that 51.0% of execution time and 52.3 % of trace size arising from the state- of-the-art reordering technique can be saved through a quick filtering of the simple pattern with a negligible (4.45%) per- formance overhead introduced on-the-fly.
文摘在多重中断C程序中,中断嵌套可能会导致一些非期望的交叠执行,从而造成错误的程序执行结果。典型的问题是共享变量引起的数据竞争破坏了程序的原子性。针对此类问题,对多重中断C程序的运行时语义进行建模,根据共享变量的访问给出了一种原子性的定义,提出了相应的数据竞争及原子性检测方法,并采用函数摘要技术缩减静态分析过程中所需遍历的程序状态。最后,设计并实现了一个数据竞争及原子性检测原型工具MIDAC(multiple interruption C program data race and atomicity checker),实验结果表明,该工具能够针对一定规模的实际程序得到很好的检测效果。