paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Repairing Leaks in Resource Wrappers

修复资源包装器中的泄漏
ASE 2025 40th IEEE/ACM International Conference on Automated Software Engineering (ASE)2025匹配度 3/10 · 论文研究资源泄漏自动修复,属于静态分析与程序修复领域,但未涉及用户核心关注的LLM/Agent与静态分析交叉、浮点程序分析或贝叶斯程序分析,方向匹配度较低。引用 0 inbox
Sanjay Malakar, Michael D. Ernst, Martin Kellogg, Manu Sridharan
crossref: 2026-09-12

AI 速览

一句话:通过集成规范推断、程序变换、字段包含分析与新修复模式,自动修复资源包装器中的资源泄漏。

资源泄漏指程序未释放套接字、文件描述符或数据库连接等有限资源。已有修复工作通常只处理硬编码库资源类型,无法覆盖将资源存入字段并需自行关闭的资源包装器。本文提出四项改进:将资源管理规范推断集成到修复流水线,使既有修复方法能推理包装器;将程序变换为更易分析的变体,让检测、推断与修复更有效并更接近根因;提出字段包含分析以推理资源生命周期;引入新的修复模式与更精确推理以处理非 final 字段中的资源。在 NJR 基准上,先前工作修复 41% 的泄漏警告,Arodnap 修复 68%。

问题
自动修复资源泄漏,尤其是涉及资源包装器(将资源存入字段并需关闭自身)的泄漏,现有方法受限于硬编码资源类型。
方法
将资源管理规范推断集成到修复流水线,进行程序变换,并引入字段包含分析与新修复模式/精确推理来处理字段资源。
评估
在 NJR 基准上评估,Arodnap 修复 68% 的泄漏警告,优于先前工作的 41%。
原文摘要(Abstract)

A resource leak occurs when a program fails to release a finite resource like a socket, file descriptor or database connection. While sound static analysis tools can detect all leaks, automatically repairing them remains challenging. Prior work took the output of a detection tool and attempted to repair only leaks from a hard-coded list of library resource types. That approach limits the scope of repairable leaks: real-world code uses resource wrappers that store a resource in a field and must themselves be closed.This paper makes four key contributions to improve resource leak repair in the presence of wrappers. (1) It integrates inference of resource management specifications into the repair pipeline, enabling extant fixing approaches to reason about wrappers. (2) It transforms programs into variants that are easier to analyze, making inference, detection, and fixing tools more effective; for instance, it makes detection tools report problems closer to the root cause, often in a client of a resource wrapper rather than within the wrapper class itself. (3) A novel field containment analysis reasons about resource lifetimes, enabling repair of more leaks involving resources stored in fields. (4) It introduces a new repair pattern and more precise reasoning to better handle resources stored in non-final fields.Prior work fixed 41% of resource leak warnings in the NJR benchmark suite; our implementation Arodnap fixes 68%.

链接与引用

DOI 原文 ·

BibTeX
@inproceedings{paperbot9323,
  title = {Repairing Leaks in Resource Wrappers},
  author = {Sanjay Malakar and Michael D. Ernst and Martin Kellogg and Manu Sridharan},
  booktitle = {ASE},
  year = {2025},
  doi = {10.1109/ase63991.2025.00074}
}