Causality-Guided Adaptive Interventional Debugging

Anna Fariha, Suman Nath, Alexandra Meliou

Here is a summary of the paper tailored for a technically literate audience:

TL;DR

Debugging intermittent software failures—like concurrency bugs that only crash an app 1% of the time—is a notorious nightmare. This paper introduces Adaptive Interventional Debugging (AID), a novel framework that combines statistical debugging, causal inference, and fault injection to not only pinpoint the exact root cause of a flaky failure but also generate a step-by-step explanation of how the bug unfolds.

What Problem Does This Paper Address?

Modern database-backed applications are highly concurrent, making them prone to intermittent failures caused by unpredictable thread scheduling or timing (e.g., race conditions, deadlocks). Because these bugs don't reproduce consistently, developers often turn to Statistical Debugging (SD).

SD works by logging thousands of runtime behaviors (called "predicates"—e.g., "Method A returns null" or "Thread 1 and 2 overlap") across both successful and failed runs. It then flags predicates that are highly correlated with failures. However, SD has two major flaws:

  1. Correlation $\neq$ Causation: SD returns a massive list of suspicious predicates. Most are just downstream symptoms or coincidences, not the root cause.
  2. No Context: SD hands the developer a list of isolated behaviors without explaining the chain of events that actually leads to the crash.

The authors tackle this gap by building a system that automatically sifts through these correlated behaviors, discovers their true causal relationships, and outputs a clean, causal path explaining the failure.

Methods

AID solves this problem through a clever pipeline of four techniques:

  1. Statistical Debugging (The Starting Point): AID first uses standard SD to find "fully-discriminative predicates"—behaviors that always happen in failed runs and never in successful ones.
  2. Approximate Causal DAG (AC-DAG): AID looks at the timestamps of these predicates to build a Directed Acyclic Graph (DAG). The logic is simple: a cause must temporally precede its effect. This graph over-approximates causality, containing the true root cause alongside some false positives.
  3. Fault Injection (The Interventions): To test if a predicate is truly causal, AID "intervenes." It uses fault injection to force the application to behave correctly at that specific point (e.g., adding a lock to prevent a data race, or injecting a delay). If the app survives the run, that predicate is proven to be a counterfactual cause of the failure.
  4. Causality-Guided Group Testing: Testing every predicate one-by-one is too slow (each test requires re-running the app). Instead, AID uses a divide-and-conquer "group testing" approach. It intervenes on groups of predicates at once. Crucially, it uses the AC-DAG to test predicates in topological order. If an intervention stops the failure, AID knows the cause is in that group. Furthermore, it aggressively prunes downstream predicates from the graph without even testing them, knowing their effects were muted by the upstream fix.

Datasets

The authors evaluated AID on a mix of real-world and synthetic data:

  • Open-Source Applications: Known intermittent bugs in Npgsql (a PostgreSQL provider), Apache Kafka, and Azure Cosmos DB.
  • Proprietary Software: Three large-scale, internal Microsoft applications (a network control plane, a build/test platform, and a telemetry module).
  • Synthetic Benchmark: 500 auto-generated multi-threaded applications with known root causes to test algorithmic scaling and worst-case performance.

Key Insights and Ideas

  • Time is a powerful filter for causality: While temporal precedence doesn't guarantee causality, it is a necessary condition. Using time to build an approximate causal graph drastically shrinks the search space for root causes.
  • Group testing shouldn't be blind: Traditional adaptive group testing (TAGT) picks random items to test. By making group testing "causality-aware" (using the AC-DAG), AID can test logical branches of the program together.
  • Interventional Pruning: If you fix a root cause (e.g., you lock a variable to stop a data race), you also prevent all of its downstream symptoms (e.g., an out-of-bounds array access). AID leverages this "deterministic effect" to cross dozens of suspects off the list with a single successful intervention.

Key Results

  • High Precision & Explainability: In all six real-world case studies, AID successfully identified the exact root cause and generated a step-by-step causal path that perfectly matched the explanations provided by human developers in the original GitHub issue tickets.
  • Massive Reduction in Noise: For the Npgsql bug, standard SD flagged 14 suspicious predicates. AID narrowed this down to the 3 actual causal steps. For Kafka, SD flagged 72 predicates; AID isolated the 5 true causal steps.
  • Fewer Interventions (Speed): Because re-running apps with fault injection is expensive, minimizing interventions is key. For the Cosmos DB bug, traditional group testing would require up to 42 interventions. AID found the root cause in just 15.
  • Better Worst-Case Scaling: In synthetic benchmarks, AID's pruning mechanisms prevented worst-case blowups. In the most complex synthetic scenario, traditional group testing required 217 interventions, while AID capped out at 52.

Limitations and Future Work

  • Single Root Cause Assumption: AID assumes there is exactly one root-cause predicate per failure signature. It does not currently support disjunctive root causes (where Bug A or Bug B can independently cause the exact same failure path).
  • Safe Interventions Only: AID relies on developers to flag which methods are "safe" to alter via fault injection without causing unrelated, catastrophic side effects in the app.
  • Clock Imprecision: Relying on system clocks to determine temporal precedence can be tricky in distributed systems or across different CPU cores.
  • Future Work: The authors plan to incorporate more program behavior data to better approximate the initial causal graph, and expand the framework to handle multiple simultaneous root causes and multiple causal paths.

Summary updated

BibTeX
@inproceedings{fariha2020causality,
  author = {Anna Fariha and Suman Nath and Alexandra Meliou},
  title = {{Causality-Guided Adaptive Interventional Debugging}},
  booktitle = {SIGMOD},
  year = {2020},
  doi = {10.1145/3318464.3389694},
}
Figure