🤖 AI Summary
Dynamic deadlock prediction suffers from high false-positive rates: detected potential deadlock patterns may never manifest under actual thread schedules. This paper addresses scheduling-sensitive concurrent programs by proposing a trace-based dynamic deadlock prediction technique that models the partial order among lock acquisitions to determine deadlock reachability. Our key contribution is the introduction of TRW partial order and its weakened variant, enabling, for the first time, a theoretically grounded balance between soundness (zero false positives) and completeness (high recall) under formal guarantees. The approach integrates partial-order modeling, lightweight lock-sequence monitoring, and formal verification. Evaluated on standard benchmarks, our method achieves zero false positives, significantly lower false negatives than state-of-the-art techniques, and manageable runtime overhead.
📝 Abstract
Deadlocks are a major source of bugs in concurrent programs. They are hard to predict, because they may only occur under specific scheduling conditions. Dynamic analysis attempts to identify potential deadlocks by examining a single execution trace of the program. A standard approach involves monitoring sequences of lock acquisitions in each thread, with the goal of identifying deadlock patterns. A deadlock pattern is characterized by a cyclic chain of lock acquisitions, where each lock is held by one thread while being requested by the next. However, it is well known that not all deadlock patterns identified in this way correspond to true deadlocks, as they may be impossible to manifest under any schedule. We tackle this deficiency by proposing a new method based on partial orders to eliminate false positives: lock acquisitions must be unordered under a given partial order, and not preceded by other deadlock patterns. We prove soundness (no falsely predicted deadlocks) for the novel TRW partial order, and completeness (no deadlocks missed) for a slightly weakened variant of TRW. Both partial orders can be computed efficiently and report the same deadlocks for an extensive benchmark suite.