KernelDiag: Agent-Based Root Cause Diagnosis for Kernel Crashes

2026-07-20Software Engineering

Software Engineering
AI summary

The authors created KernelDiag, a tool to help find the exact cause of crashes in the Linux kernel, which is very complicated and hard to debug. Unlike previous methods, KernelDiag connects different types of diagnostic information like logs and crash reports to the actual code and reasons step-by-step about where the problem happens. It builds detailed evidence maps that help pinpoint faulty code sections and explain why the crash occurred. Their tests showed KernelDiag works better than existing tools and produces clear, useful explanations for humans and other AI systems.

Linux kernelfuzzingroot cause analysisstructured causal reasoninglog-to-code mappingevidence graphskernel debuggingsystem callscrash reportslocalization
Authors
Weijing Wang, Zan Wang, Dong Wang, Haichi Wang, Junjie Chen
Abstract
The Linux kernel is one of the most complex software systems, where automated fuzzing continuously exposes thousands of crashes, yet root-cause diagnosis remains a manual and time-consuming bottleneck. Existing LLM-based root cause analysis (RCA) techniques, effective for distributed systems, do not readily generalize to kernel debugging due to sparse low-level artifacts, heterogeneous diagnostic evidence (e.g., syscalls, logs, and crash reports), and complex non-linear fault propagation that demands fine-grained method-level reasoning. To address these challenges, we propose KernelDiag, an agent-based framework for kernel root-cause diagnosis via structured causal reasoning. KernelDiag first aligns heterogeneous diagnostic artifacts through log-to-code mapping, and then employs artifact-specialized agents to iteratively reason over source-level program semantics and crash-specific kernel configurations. The inferred causal dependencies are incrementally organized into structured Evidence Graphs, enabling accurate faulty-method localization and causal explanations. We evaluate KernelDiag on the real-world KGYM benchmark. KernelDiag consistently outperforms state-of-the-art localization approaches at both file and method levels, achieving significant improvements in Top@k accuracy, including up to 4x and 2x gains in challenging settings without explicit hints. Furthermore, both human and LLM-assisted evaluations show that KernelDiag generates accurate, coherent, and actionable diagnostic explanations. Overall, this work lays the foundation for automated kernel root-cause diagnosis by bridging low-level diagnostic evidence with source-level causal reasoning.