Effective and precise dynamic detection of hidden races for Java programs

Yan Cai, Lingwei Cao
2015 Proceedings of the 2015 10th Joint Meeting on Foundations of Software Engineering - ESEC/FSE 2015  
Happens-before relation is widely used to detect data races dynamically. However, it could easily hide many data races as it is interleaving sensitive. Existing techniques based on randomized scheduling are ineffective on detecting these hidden races. In this paper, we propose DrFinder, an effective and precise dynamic technique to detect hidden races. Given an execution, DrFinder firstly analyzes the lock acquisitions in it and collects a set of "may-trigger" relations. Each may-trigger
more » ... may-trigger relation consists of a method and a type of a Java object. It indicates that, during execution, the method may directly or indirectly acquire a lock of the type. In the subsequent executions of the same program, DrFinder actively schedules the execution according to the set of collected may-trigger relations. It aims to reverse the set of happens-before relation that may exist in the previous executions so as to expose those hidden races. To effectively detect hidden races in each execution, DrFinder also collects a new set of may-trigger relation during its scheduling, which is used in its next scheduling. Our experiment on a suite of realworld Java multithreaded programs shows that DrFinder is effective to detect 89 new data races in 10 runs. Many of these races could not be detected by existing techniques (i.e., FastTrack, Con-Test, and PCT) even in 100 runs.
doi:10.1145/2786805.2786839 dblp:conf/sigsoft/CaiC15 fatcat:4mwh7mqcdzewfi3d6sf3w5tnbi