An End-to-End Approach for Fixing Concurrency Bugs via SHB-Based Context Extractor PubID: pubid:
Zhuang Li, Qiuping Yi, Keyang Xiao, Zongcheng Ji, Hongliang Liang · 2026
Read An End-to-End Approach for Fixing Concurrency Bugs via SHB-Based Context Extractor PubID: pubid: by Zhuang Li, Qiuping Yi, Keyang Xiao, Zongcheng Ji, Hongliang Liang (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2604-05753.txt.
Introduction
Li and four colleagues fix concurrency bugs end to end with ConFixAgent, a language-model agent needing no prior bug information. Static happens-before graphs pinpoint bug-relevant code sections for repair. Tests across benchmark sets show it beats leading tools on diverse concurrency bugs, with context extraction markedly improving repair accuracy.
Catalog record
| CREATOR | Zhuang Li, Qiuping Yi, Keyang Xiao, Zongcheng Ji, Hongliang Liang |
|---|---|
| YEAR | 2026 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 88934 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2604.05753
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
An End-to-End Approach for Fixing Concurrency Bugs via SHB-Based Context Extractor PubID: pubid: Zhuang Li, Qiuping Yi, Keyang Xiao, Zongcheng Ji, Hongliang Liang Abstract With the rise of multi-core processors and distributed systems, concurrent programming has become essential yet challenging, primarily due to the non-deterministic nature of thread execution. Manually addressing concurrency bugs is time-consuming and error-prone. Automated Program Repair techniques provide a promising solution. However, developing an end-to-end concurrency bug repair tool is particularly challenging. Most existing tools rely on the assumption that bug-related information is readily available or that concurrency bug contexts are ideally extracted, which is often impractical in real-world scenarios. This paper introduces ConFixAgent , an LLM-driven agent capable of fixing various types of concurrency bugs in an end-to-end manner, eliminating the need for any prior bug-related information. Specifically, we propose a novel context extraction approach designed for concurrency bug repair, utilizing Static Happens-Before Graphs to identify bug-relevant sections. We implemented ConFixAgent and evaluated it across multiple benchmark sets. Our extensive experiments demonstrate that ConFixAgent significantly outperforms state-of-the-art tools in addressing diverse types of concurrency bugs, with its context extraction method markedly enhancing the accuracy of LLM-generated repair solutions. I Introduction With the rise of multi-core processors and distributed systems, concurrent programming has become essential in modern software development [ 61 , 1 ] . However, writing concurrent code is challenging due to the non-deterministic nature of thread execution, making concurrency bugs common in real-world applications and difficult to detect and resolve [ 62 , 45 , 3 , 1 ] . Studies have shown that the software industry spends over $100 billion on failure diagnosis and repair [ 86 ] , and programmers spend more than 50% of their time resolving bugs [ 87 ] . Manual bug fixing is not only time-consuming [ 1 ] but also prone to errors [ 4 , 1 , 17 ] . To address these issues, Automated Program Repair (APR) techniques have been developed to streamline the repair process, minimize manual intervention, and ensure higher software quality [ 47 ] . While various methods for fixing concurrency bugs already exist [ 19 , 20 , 21 , 22 , 23 , 24 ] , our investigation into APR for concurrency bugs has revealed three key challenges: First, gathering concurrency bug information is inherently challenging. In practice, some tools [ 21 , 19 , 24 ] focus exclusively on repair techniques. They do not address the prior problems of bug detection and localization 1 1 1 Bug detection refers to identifying deviations from expected behavior—i.e., determining whether a bug exists (often via crashes, or runtime exceptions). Bug localization refers to precisely identifying the code locations responsible for faulty behavior. —a primary challenge in concurrency bug handling, as noted in prior studies [ 4 , 29 ] . Other tools employ various detection methods to gather bug information, including run-time analysis, bounded model checking, or static analysis [ 20 , 17 , 25 , 6 , 30 ] . However, these methods frequently encounter effectiveness limitations. For instance, HIPPODROME, a state-of-the-art static analysis-based tool, establishes correctness criteria focused on resolving data races detected by RacerD [ 17 ] . Nevertheless, these criteria suffer from significant limitations: empirical studies show most data races are benign and do not require fixes [ 65 , 66 ] , and concurrency bugs frequently stem from other issues beyond data races, particularly atomicity violations [ 7 , 8 , 1 ] . In contrast, dynamic analysis approaches align better with developers’ intentions, as they ground bug detection in actual runtime behaviors [ 7 , 8 ] . However, they face challenges in accurately localizing concurrency bugs under dynamic conditions. For example, PFIX —a state-of-the-art dynamic analysis-based tool [ 6 ] —struggles with precisely identifying the root causes of concurrency bugs. Due to the complexity of the thread interleaving space, it remains difficult to pinpoint the exact factors that trigger such bugs [ 35 ] . Second, existing tools typically specialize in repairing specific types of concurrency bugs, such as atomicity violations [ 21 , 19 ] , deadlocks [ 26 , 27 ] , or data races [ 17 ] . Even PFIX [ 6 ] — while effective at addressing all types of concurrency bugs caused by memory interleavings, remains unable to handle deadlocks. Third, accurately fixing concurrency bugs is a significant challenge. Solutions must address bugs across all potential scheduling scenarios without introducing new issues. This requires comprehensive global reasoning within the entire program, which is a complex and difficult task [ 6 , 17 ] . The rise of Large Language Models (LLMs) and their advanced code comprehension capabilities has led to their widespread adoption in various software development tasks, including APR [ 56 , 58 , 59 ] . However, existing LLM-based APR approaches [ 69 , 70 , 71 , 72 , 73 , 74 , 75 , 76 , 77 , 78 , 79 , 59 , 58 , 80 , 81 , 82 , 111 ] still cannot fully automate the entire workflow of concurrency bug detection, localization, and repair on raw code as traditional tools like PFIX [ 6 ] and HIPPODROME [ 17 ] do. They require active developer involvement: developers must manually identify buggy code segments, annotate lines needing fixes, and even explicitly state the known causes of the bugs [ 70 , 69 , 77 ] . This indicates that such approaches generally operate under the assumption that relevant bug information is already at hand, allowing them to concentrate predominantly on patch generation while overlooking the crucial preceding step of acquiring that information. In practice, however, such information is often unavailable [ 4 , 1 , 17 ] , making the acquisition of bug-related information a critical challenge in concurrency bug repair [ 4 ] . In this paper, we present ConFixAgent , an end-to-end LLM-driven automated repair agent designed to address various types of concurrency bugs in Java programs without relying on manually provided bug information. Its scope comprehensively covers all non-deadlock concurrency bugs—including data races, order violations, and atomicity violations [ 10 ] —as well as deadlock concurrency bugs, including both resource deadlocks, which arise from cyclic competition for locks or other tangible resources, and communication deadlocks, which arise from threads waiting for undelivered intangible signals (e.g., wait()/notify() on condition variables) and are unrelated to lock acquisition order [ 63 ] . The process begins with the bug detector generating diverse thread interleavings to expose concurrency bugs. Once a bug is found, bug reports together with code snippets extracted by the context extractor are sent to the LLM for localization and repair. This iterative process continues until no bugs are detected or the maximum iteration limit is reached. A key challenge for ConFixAgent lies in designing effective context extraction methods. Unlike non-concurrent programs, where extraction focuses on code near the bug, concurrency bugs stem from interleaved executions, necessitating a global perspective for accurate localization and repair. The most similar recent work, Inferfix [ 82 ] , utilizes Infer [ 85 ] to extract bug-related code. However, its approach is limited to interleavings between two shared memory accesses. To achieve effective context code