| Concurrent programs are becoming important due to the prevalence of multi-core hardware. Analyzing concurrent programs is different and much more costly compared with analyzing sequential programs. A concurrent program's behaving is nondeterministic according to mostly dependence on random threads schedule, that is, the program may produce different results with the same input. There are many tools have developed for automatically find bugs by analyzing programs statically or dynamically. But with the difference of the bug types and the purposes, their effects are different in some aspects.Atomicity violation is a significant kind of concurrency bug, thus much work has been done to detect or prevent it. Especially, experience shows that atomicity violations referring to multi variables is an important part of the problem in practice, such as different fields of an object required to be atomically treated and updated. Since it is difficult to infer apparent correlations among shared variables according to control and data flows, people would be usually unable to detect this kind of concurrency bug when atomicity specification or annotation is absent.In this paper, we propose a new statistical approach to detect multiple variable atomicity violations without consulting atomicity specification or annotation. The essential idea is to define different dimensions of distances among shared variables, and then infer the correlations through them. We have implemented this approach and evaluated it with a series of Java programs. Experimental results show that our approach can infer multiple variable correlations automatically according to program executions and detect multi-variable atomicity violations effectively based on the inferred correlations. |