DeepAnalyze: Learning to Localize Crashes at Scale

Manish Shetty, Chetan Bansal, Suman Nath, Sean Bowles, Henry Wang, Ozgur Arman, Siamak Ahari

TL;DR

DeepAnalyze is a deep learning framework designed to automate "crash localization"—identifying the specific function in a code execution path responsible for a software failure. By treating stack traces as sequences and using multi-task learning, it replaces brittle, manually-written rules with a model that achieves 90% accuracy and can bootstrap localization for new applications with little to no training data.

What Problem Does This Paper Address?

When software crashes "in the wild," it sends a crash report containing a stack trace—a list of active function calls (frames) at the moment of failure. To fix the bug, developers must find the "blamed frame," the specific function where the error originated.

In massive systems like Windows Error Reporting (WER), which receives millions of reports daily, this process is currently handled by tens of thousands of manually written heuristics (e.g., "If function X is present, ignore it; the real bug is likely in function Y"). This approach is unsustainable: as software evolves and new apps are released, experts must constantly write and maintain these rules. The authors seek a data-driven, automated way to localize crashes at the scale of the entire Windows ecosystem.

Methods

The authors formulate crash localization as a sequence labeling task, drawing inspiration from Natural Language Processing (NLP). If a stack trace is a "sentence," each function call is a "word."

  • Architecture: They use a Bi-directional Long Short-Term Memory (Bi-LSTM) network to capture the context of a frame (what called it and what it called).
  • Attention & CRF: An Attention mechanism helps the model focus on the most relevant parts of the stack, while a Conditional Random Field (CRF) layer ensures the model obeys a structural constraint: only one frame in a stack can be the "blamed" frame.
  • Multi-Task Learning (MTL): The model is trained to perform two tasks simultaneously: identifying the blamed frame and predicting the "problem class" (e.g., heap corruption vs. stack overflow). Learning these related tasks together improves the model's overall performance.
  • Features: Instead of just looking at function names, they use Tf-Idf to capture the semantic importance of namespaces and methods, alongside structural features like the frame's normalized position in the stack.

Datasets

The study utilizes massive, real-world datasets from Windows Error Reporting:

  • Empirical Analysis Dataset: 362,249 unique crash stacks from approximately 8,700 software components, sampled over one week.
  • Evaluation Dataset: Over 1.2 million user-mode crashes from four major Microsoft applications: Edge, Word, Excel, and Outlook.
  • Ground Truth: The "labels" for training were generated by the existing, highly-vetted (but hard to maintain) !analyze heuristic system used by Microsoft engineers.

Key Insights and Ideas

  • The "Top Frame" is often a red herring: While many crashes happen at the very top of the stack, the study found that in 33% of cases, the blamed frame is actually buried deeper.
  • Context is King: A specific function might be the culprit in one crash but a harmless bystander in another. Its "guilt" depends entirely on the sequence of calls surrounding it.
  • System vs. App Code: Crashes are significantly more likely to occur in application-specific code than in core OS libraries (like ntdll.dll), even though those libraries appear in almost every stack trace.
  • Transferability: Because many applications share underlying system libraries and common coding patterns, a "Global Model" trained on a diverse set of apps can effectively localize crashes in a completely new, unseen application.

Key Results

  • High Accuracy: DeepAnalyze achieved an average accuracy of 90% across the four test applications, outperforming standard machine learning baselines like Logistic Regression (77%).
  • Zero-Shot Capabilities: Using transfer learning, the model achieved ~80% accuracy on new applications with zero application-specific training data.
  • Efficiency: Fine-tuning the global model for a new application required only a few thousand samples to reach 90% accuracy and took only 10 minutes of training time, compared to 3 hours for training a model from scratch.

Limitations and Future Work

The authors acknowledge several areas for expansion:

  • Feedback Loops: They plan to integrate DeepAnalyze into the live WER service with a feedback loop, allowing developer corrections to improve the model over time.
  • Cross-Platform Support: The current study focuses on Windows; future work could explore cross-platform and cross-OS crash localization.
  • Complex Root Causes: Some crashes involve "inter-crash dump correlations" (where the cause is spread across multiple threads or processes), which the current single-stack approach may not fully capture.

Summary updated

BibTeX
@inproceedings{shetty2022deepanalyze,
  author = {Manish Shetty and Chetan Bansal and Suman Nath and Sean Bowles and Henry Wang and Ozgur Arman and Siamak Ahari},
  title = {{DeepAnalyze: Learning to Localize Crashes at Scale}},
  booktitle = {ICSE},
  year = {2022},
  doi = {10.1145/3510003.3512759},
}
Figure