<p>Although Rust claims to enable fearless concurrency, concurrency errors remain prevalent in practical applications, with deadlocks particularly prominent and harmful. Current static deadlock detection techniques either do not cater to Rust programs without incorporating Rust semantics or solely concentrate on resource deadlocks, disregarding communication deadlocks. In this paper, we present <span>RcChecker</span>, the first static detection method that simultaneously targets resource and communication deadlocks for Rust. At its core, <span>RcChecker</span> introduces the signal-lock graph to characterize the interactions between threads through lock variables and condition variables. The construction of the signal-lock graph involves utilizing flow-sensitive and context-sensitive analyses to track variable lifetime details and abstracting actions associated with condition variables into signal resource holdings and requests. By examining cycles within the signal-lock graph, we can effectively identify resource and communication deadlocks in a unified way. Compared to the existing Rust deadlock detection tool, <span>RcChecker</span> effectively eliminates eight resource deadlock false positives and detects seventeen errors that the existing tool fails to identify. Furthermore, <span>RcChecker</span> reports seven previously undiscovered issues in real-world Rust applications, including two resource deadlocks and five communication deadlocks.</p>

错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

Two birds one stone: Effective static detection of resource and communication deadlocks in Rust programs

  • Yu Zhang,
  • Kaiwen Zhang,
  • Guanjun Liu,
  • Yuandao Cai,
  • Shengchao Qin

摘要

Although Rust claims to enable fearless concurrency, concurrency errors remain prevalent in practical applications, with deadlocks particularly prominent and harmful. Current static deadlock detection techniques either do not cater to Rust programs without incorporating Rust semantics or solely concentrate on resource deadlocks, disregarding communication deadlocks. In this paper, we present RcChecker, the first static detection method that simultaneously targets resource and communication deadlocks for Rust. At its core, RcChecker introduces the signal-lock graph to characterize the interactions between threads through lock variables and condition variables. The construction of the signal-lock graph involves utilizing flow-sensitive and context-sensitive analyses to track variable lifetime details and abstracting actions associated with condition variables into signal resource holdings and requests. By examining cycles within the signal-lock graph, we can effectively identify resource and communication deadlocks in a unified way. Compared to the existing Rust deadlock detection tool, RcChecker effectively eliminates eight resource deadlock false positives and detects seventeen errors that the existing tool fails to identify. Furthermore, RcChecker reports seven previously undiscovered issues in real-world Rust applications, including two resource deadlocks and five communication deadlocks.