一句话:提出 ReCite 三阶段方法,检测并修复 Linux 内核注释中因函数重构或删除而过时的函数引用。
Linux 内核持续演化,注释中引用的函数可能被重构或删除,导致注释过时并误导维护者。已有代码-注释一致性工作主要针对 Javadoc 与其直接标注函数之间的语义错位,无法处理这类由外部代码演化引起的过时引用。本文提出 ReCite,包含三个阶段:检测注释中无法在当前代码库解析的函数形式符号;通过 Git 历史追踪每个未解析符号的演化过程;结合演化历史与当前代码上下文,利用 LLM 生成修复建议。在 Linux 内核 v6.18-rc1 上,ReCite 检测到 869 个过时引用并给出修复建议。对 200 个抽样修复的人工评估显示,178 个(89.0%)提供了有用指导,其中 85 个(42.5%)可直接应用;提交的 75 个补丁中已有 50 个被接受。作者还对所有未解析的函数形式符号进行了实证研究。
As the Linux kernel evolves, code comments may become outdated, as the functions they reference can be refactored or removed independently without corresponding updates to the comments. Such stale function references can mislead maintainers and thus hinder code comprehension. Prior work on detecting code-comment inconsistency mainly focused on addressing semantic misalignment between Javadoc comments and their directly annotated functions, making them inapplicable to this type of externally induced staleness in the Linux kernel. Therefore, we propose ReCite, a three-stage approach to identify and repair such stale references: (1) detecting unresolved function-form symbols—symbols in comments that appear to reference functions but for which no matching function can be found in the current codebase, (2) tracing the evolution history of each unresolved symbol through the Git history, and (3) generating LLM-based repair suggestions grounded in the evolution history and current code context. On Linux kernel v6.18-rc1, ReCite detects 869 stale references with generated repair suggestions. A manual evaluation on 200 sampled repairs shows that 178 (89.0%) provide useful repair guidance, with 85 (42.5%) directly applicable. Of our 75 submitted patches, 50 have been accepted. We also empirically study all unresolved function-form symbols.
@inproceedings{paperbot12494,
title = {We Must Have Missed This Comment: Detecting and Repairing Stale Function References in Linux Kernel Comments},
author = {Kexin Sun and Yunbo Lyu and Xutong Ma and Hongyu Kuang and Ratnadira Widyasari and He Zhang and Xiaoxing Ma and Julia Lawall and David Lo},
booktitle = {ASE},
year = {2026},
doi = {10.1145/3832783.3837474}
}