Lune

ICML2026Top-tier venue

One Bug, Hundreds Behind: LLMs for Large-Scale Bug Discovery

Qiushi Wu, Yue Xiao, Dhilung Kirat, Kevin Eykholt, Jiyong Jang, Douglas Schales

Abstract

Managing large programs and fixing bugs is a challenging task that demands substantial time and manual effort. In practice, when a bug is found, it is reported to the project maintainers, who work with the reporter to fix it. Once the bug is resolved, the issue is marked as closed. However, across the program, there are often similar code segments, which may also contain the bug, but were initially missed during discovery. Finding and fixing each recurring bug instance individually is labor intensive. Even more concerning, bug reports can inadvertently widen the attack surface as they provide attackers with an exploitable pattern that may be unresolved in other parts of the program. In this paper, we explore these Recurring Pattern Bugs (RPBs) that appear repeatedly across various code segments of a program or even in different programs, stemming from a same root cause, but are unresolved, even when a fix is available. Our investigation reveals that RPBs are not only prevalent, but also have the potential to significantly compromise the security of software programs. Various static analyzers exist for finding specific bug patterns but require significant engineering effort and don't generalize well beyond their predefined template. To tackle RPBs and enhance project maintenance efficiency, this paper introduces BUGSTONE, a program analysis system empowered by LLVM and a Large Language Model (LLM). The key observation is that many RPBs have a single instance patched, which can be leveraged to identify a consistent error pattern, such as a specific API misuse. By examining the entire program for other instances of this pattern, it is possible to identify similar sections of code that are vulnerable to the same type of bug. Starting with 135 unique seed RPBs, BUGSTONE was able to identify more than 22K new potential issues in the Linux kernel. Manual analysis of 400 of these findings confirmed that 246 are valid issues. These detected issues include invalid pointer dereferences, resource leaks, type errors, performance issues, and others, threatening the security and stability of the program. We also create a dataset from over 1.9K security bugs reported by 23 recent top-tier conference works targeting bug identification in the Linux kernel. We manually annotate the dataset, identify 80 recurring patterns and 850 corresponding fixes, and evaluate BUGSTONE on this dataset across six different LLMs and six prompt configurations. Even with a cost-efficient model choice, BUGSTONE achieved 92.2% precision and 79.1% pairwise accuracy, demonstrating its capability to accurately identify RPBs in real-world programs.

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.

1 top-tier paper has 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

Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers1

  1. BugAuditor: Detecting Bugs via Inconsistent Defensive Code AuditingMiaoqian Lin, Kai Chen, Hao ChenUSENIX Security 2026

Builds on44

  1. WizardCoder: Empowering Code Large Language Models with Evol-InstructZiyang Luo, Can Xu, Pu Zhao, Qingfeng Sun et al.ICLR 2024 · 945 citations
  2. A Large-Scale Empirical Study of Security PatchesFrank Li, Vern PaxsonCCS 2017 · 273 citations
  3. Razzer: Finding Kernel Race Bugs through FuzzingDae R. Jeong, Kyungtae Kim, Basavesh Shivakumar, Byoungyoung Lee et al.S&P 2019 · 202 citations
  4. LLMs Cannot Reliably Identify and Reason About Security Vulnerabilities (Yet?): A Comprehensive Evaluation, Framework, and BenchmarksSaad Ullah, Mingji Han, Saurabh Pujar, Hammond Pearce et al.S&P 2024 · 167 citations
  5. Enhancing Static Analysis for Practical Bug Detection: An LLM-Integrated ApproachHaonan Li, Yu Hao, Yizhuo Zhai, Zhiyun QianOOPSLA 2024 · 142 citations

Related papers

  1. Towards More Accurate Static Analysis for Taint-Style Bug Detection in Linux KernelHaonan Li, Hang Zhang, Kexin Pei, Zhiyun QianASE 2025 · 5 citations
  2. Characterizing and Mitigating False-Positive Bug Reports in the Linux KernelJiashuo Tian, Dong Wang, Chen Yang, Haichi Wang et al.FSE 2026
  3. KNighter: Transforming Static Analysis with LLM-Synthesized CheckersChenyuan Yang, Zijie Zhao, Zichen Xie, Haoyu Li et al.SOSP 2025 · 1 citation
  4. Mining Long Tail Bugs: Identifying Rare and Overlooked Issues in CodeWentao Liang, Yanjun Wu, Xiang Ling, Tianyue Luo et al.FSE 2026
  5. SpecAuditor: Generating Audit Specifications for LLM-Driven Bug DetectionMiaoqian Lin, Hao ChenS&P 2026 · 3 citations
Dusk over the sea between two cliffs drawn in fine vertical lines