CMind: An AI Agent for Localizing C Memory Bugs DOI: XXXXXXX.XXXXXXX Conference: 34th IEEE/ACM International Conference on Program Comprehension; April 2026; Rio de Janeiro, Brazil ISBN: 978-1-4503-XXXX-X/2018/06 CCS: Computing methodologies Bio-inspired approaches CCS: Software and its engineering

Chia-Yi Su, Collin McMillan · 2026

Read CMind: An AI Agent for Localizing C Memory Bugs DOI: XXXXXXX.XXXXXXX Conference: 34th IEEE/ACM International Conference on Program Comprehension; April 2026; Rio de Janeiro, Brazil ISBN: 978-1-4503-XXXX-X/2018/06 CCS: Computing methodologies Bio-inspired approaches CCS: Software and its engineering by Chia-Yi Su, Collin McMillan (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-2601-14434.txt.

Introduction

Chia-Yi Su and Collin McMillan present a demo system in this 2026 paper. CMind is an AI agent for localizing memory bugs in C programs. Memory bugs are a classic source of crashes and security holes in C. Finding the exact faulty line can take hours of human work.

What sets CMind apart is its method. It follows the steps human programmers take when they hunt memory bugs. The authors drew those steps from an empirical study of programmers at work. The agent thus works like a person, not just a static checker. The paper was written for the International Conference on Program Comprehension. Readers get a tool that copies expert debugging moves.

Catalog record

CREATORChia-Yi Su, Collin McMillan
YEAR2026
COLLECTIONPAPERS
FORMATTXT
FILE SIZE25 KB
VERSION1.0
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2601-14434

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

CMind: An AI Agent for Localizing C Memory Bugs DOI: XXXXXXX.XXXXXXX Conference: 34th IEEE/ACM International Conference on Program Comprehension; April 2026; Rio de Janeiro, Brazil ISBN: 978-1-4503-XXXX-X/2018/06 CCS: Computing methodologies Bio-inspired approaches CCS: Software and its engineering Software libraries and repositories Chia-Yi Su, Collin McMillan Abstract . This demonstration paper presents CMind, an artificial intelligence agent for localizing C memory bugs. The novel aspect to CMind is that it follows steps that we observed human programmers perform during empirical study of those programmers finding memory bugs in C programs. The input to the tool is a C program’s source code and a bug report describing the problem. The output is the tool’s hypothesis about the reason for the bug and its location. CMind reads the bug report to find potential entry points to the program, then navigates the program’s source code, analyzes that source code, and generates a hypothesis location and rationale that fit a template. The tool combines large language model reasoning with guided decision making we encoded to mimic human behavior. The video demonstration is available at https://youtu.be/_vVd0LRvVHI . 1. Introduction Memory bugs are among the top concerns for code quality in C programs. Cotroneo et al. ( 5 ) state that “use of uninitialized data, buffer overflows, and memory leaks” are the preponderant types of bugs faced by C programmers – all three are related to memory management. At the same time memory bugs are among the most difficult to solve. Memory bugs can manifest as gradual performance degradation detected only in long running programs or as seemingly random crashes not clearly connected to a user input, and there is a tendency for repairs to only partially fix the problem or even introduce new memory bugs ( 32 ) . Automatic detection and repair of C memory bugs has long been categorized under automatic program repair generally, with approaches ranging from custom neural models trained on examples of buggy code, to prompts containing sections of source code input to pretrained large language models (LLMs), to fine-tuned LLMs, and most recently tool-augmented agents ( 4 ; 8 ; 31 ) . All hold promise, yet as Melo ( 19 ) points out, even with state-of-the-art LLMs “achieving reliable integration and maintaining code quality present significant technical and organizational challenges.” The reason, as Karpathy ( 11 ) describes, is essentially that LLMs have nearly unlimited range in possible answers and are likely to move off track quickly – and the answer is to design agents with “partial autonomy” that “keeps LLMs on a leash.” This demonstration paper introduces CMind, a tool-augmented AI agent for localizing C memory bugs. CMind is a partially autonomous systems that combines LLM reasoning with guided decision making. By “LLM reasoning” we mean that CMind uses an LLM to read and interpret code sections that we present to it. By “guided decision making” we mean that CMind presents the LLM with limited choices and provides access to specific tools’ output that we have evidence is useful in making those choices. A key novel aspect to CMind is we designed the “guided” component to mimic human behavior that was observed in empirical studies of programmers who were localizing C memory bugs. CMind is partially autonomous in that it uses recent LLM tools but keeps the LLM components “on a leash” by following patterns of human behavior for the specific task of localizing C memory bugs. The process we found that humans follow to find memory bugs essentially breaks into three steps ( 24 ) : 1) find entry points to the program relevant to the bug by reading the bug report, 2) follow code structure to find other relevant code based on the entry points, and 3) read code statements along the chain of relevant code structure to determine relevance to the bug report. We designed CMind to follow this same process but use an LLM at points requiring subjective decision making. Like a person, CMind reads bug reports, finds entry points, and explores programs based on those entry points. Then it generates a hypothesis about code relevance to the bug and describes that hypothesis in a template we provide. We make CMind available as a command-line Unix tool and via a web platform. By default CMind uses GPT-o4 for LLM interaction but this is configurable and in principle any LLM can be used. For the web platform, the user needs only to upload an archive snapshot of his or her code and the text of a bug report. For the command-line tool, the user needs only to point CMind to the source code folder (or archive file) and a text file containing the bug report. In a pilot evaluation we demonstrate how to use the tool on twenty actual memory bugs in C programs we found from public repositories. CMind is open-source and available via: https://github.com/apcl-research/CMIND 2. Background/Related Work The directions for bug localization fall into several categories: 1) spectrum-based fault localization 2) model-based fault localization 3) information-retrieval based 4) neural model-based 5) bio-based 6) LLMs-based, and 7) agentic based. Spectrum-based methods use run-time behaviors to localize bugs. For example, Jones et al. ( 10 ) proposed Tarantula that uses the coverage of the test data for bug localization. Model-based approaches use probabilistic models. Baah et al. uses probabilistic graphical models to find bugs in the program. Information retrieval-based methods use static information for bug localization. Mahmud et al. ( 18 ) proposed an information retrieval approach that retrieves files with bug based on GUI information. Zhou et al. ( 35 ) used bug reports to find the buggy code. Neural-based methods mean localize the bugs with neural network. Qian et al. ( 22 ) used graph convolution neural network for bug localization. Bio-based methods use clues from human behavior for bug localization such as the work by Muller et al. ( 20 ) that uses bio-metrics for bug localization. More recently, several LLMs and agentic-based approaches have been proposed. Stein et al. ( 26 ) used LLMs for bug localization by exploring the attention in LLMs. Chang et al. ( 2 ) proposed LLM-based hierarchical framework for bug localization. Qin et al. ( 23 ) proposed a multi-agent based method for bug localization. Due to page limit, several other papers along these lines are highlighted in different survey papers ( 21 ; 29 ) . Although LLMs have shown success in bug localization ( 26 ; 7 ; 2 ; 17 ; 23 ) , LLMs still struggle with hallucinations ( 16 ; 33 ) and understanding long contexts ( 14 ; 15 ) . To limit the range of possible answers, we developed our method based on a human study with human programmers ( 24 ) . Compared with other agentic based methods such as ( 23 ) , the key novelty of this paper is that we design our prompt based on a human study with human programmers. 3. Approach Figure 1 shows the process for CMind. The input of CMind is a bug report and source code and the output is the summary of the hypothesis. Area 1 collects the necessary information including the entry points and related methods based on

Read the complete text