Rust's ownership system prevents many data races, but deadlocks still slip through in real applications. Existing static deadlock detectors either fail to incorporate Rust-specific semantics or focus only on resource deadlocks caused by mutexes, ignoring communication deadlocks that arise from condition variables. A new paper introduces RcChecker, which the authors describe as the first static detection method to handle both deadlock types in Rust simultaneously.

RcChecker builds a signal-lock graph that captures how threads interact through lock variables and condition variables. The construction relies on flow-sensitive and context-sensitive analyses to track variable lifetimes, and it abstracts condition-variable operations into signal resource holdings and requests. By looking for cycles in this graph, the tool can identify resource and communication deadlocks in a unified way.

The paper reports that compared with an existing Rust deadlock detection tool, RcChecker eliminates eight resource deadlock false positives and detects seventeen errors that the existing tool fails to identify. It also flags seven previously undiscovered issues in real-world Rust applications: two resource deadlocks and five communication deadlocks. The work is published in Automated Software Engineering.