Lune

Abstract

We develop a static deadlock analysis for commercial Android Java applications, of sizes in the tens of millions of LoC, under active development at Facebook. The analysis runs primarily at code-review time, on only the modified code and its dependents; we aim at reporting to developers in under 15 minutes. To detect deadlocks in this setting, we first model the real language as an abstract language with balanced re-entrant locks, nondeterministic iteration and branching, and non-recursive procedure calls. We show that the existence of a deadlock in this abstract language is equivalent to a certain condition over the sets of critical pairs of each program thread; these record, for all possible executions of the thread, which locks are currently held at the point when a fresh lock is acquired. Since the critical pairs of any program thread is finite and computable, the deadlock detection problem for our language is decidable, and in NP. We then leverage these results to develop an open-source implementation of our analysis adapted to deal with real Java code. The core of the implementation is an algorithm which computes critical pairs in a compositional, abstract interpretation style, running in quasi-exponential time. Our analyser is built in the INFER verification framework and has been in industrial deployment for over two years; it has seen over two hundred fixed deadlock reports with a report fix rate of ∼54%.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

4 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Place Your Locks Well: Understanding and Detecting Lock Misuse Bugs cites Peahen: fast and precise static deadlock detection via context reduction
  • Peahen: fast and precise static deadlock detection via context reduction cites Low-overhead deadlock prediction
  • When Threads Meet Interrupts: Effective Static Detection of Interrupt-Based Deadlocks in Linux cites Place Your Locks Well: Understanding and Detecting Lock Misuse Bugs
  • When Threads Meet Interrupts: Effective Static Detection of Interrupt-Based Deadlocks in Linux cites Low-overhead deadlock prediction
  • When Threads Meet Interrupts: Effective Static Detection of Interrupt-Based Deadlocks in Linux cites Peahen: fast and precise static deadlock detection via context reduction
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers4

  1. Concurrent incorrectness separation logicAzalea Raad, Josh Berdine, Derek Dreyer, Peter W. O'HearnPOPL 2022 · 24 citations
  2. Peahen: fast and precise static deadlock detection via context reductionYuandao Cai, Chengfeng Ye, Qingkai Shi, Charles ZhangFSE 2022 · 16 citations
  3. When Threads Meet Interrupts: Effective Static Detection of Interrupt-Based Deadlocks in LinuxChengfeng Ye, Yuandao Cai, Charles ZhangUSENIX Security 2024 · 5 citations
  4. Place Your Locks Well: Understanding and Detecting Lock Misuse BugsYuandao Cai, Peisen Yao, Chengfeng Ye, Charles ZhangUSENIX Security 2023

Builds on1

  1. Low-overhead deadlock predictionYan Cai, Ruijie Meng, Jens PalsbergICSE 2020 · 11 citations

Related papers

  1. DLOS: Effective Static Detection of Deadlocks in OS KernelsJia-Ju Bai, Tuo Li, Shi-Min HuUSENIX ATC 2022 · 10 citations
  2. Static executes-before analysis for event driven programsRekha R. Pai, Abhishek Uppar, Akshatha Shenoy, Pranshul Kushwaha et al.FSE 2022
  3. Static asynchronous component misuse detection for Android applicationsLinjie Pan, Baoquan Cui, Hao Liu, Jiwei Yan et al.FSE 2020 · 10 citations
  4. Database Deadlock Diagnosis for Large-Scale ORM-Based Web ApplicationsZhiyuan Dong, Zhaoguo Wang, Chuanwei Yi, Xian Xu et al.ICDE 2023 · 7 citations
  5. A Predictive Analysis for Detecting Deadlock in MPI ProgramsYu Huang, Benjamin Ogles, Eric MercerASE 2020 · 3 citations
Dusk over the sea between two cliffs drawn in fine vertical lines