paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Mining Resource-Operation Knowledge to Support Resource Leak Detection

挖掘资源操作知识以支持资源泄漏检测
FSE Proceedings of the 31st ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering2023匹配度 3/10 · 该论文属于程序分析与代码挖掘,涉及资源泄漏检测和规则/学习结合,但与用户核心关注的 LLM/Agent 与静态分析交叉、浮点程序分析或贝叶斯程序分析均无直接关系;仅可算作广义静态分析/ML+PL 的邻近工作。引用 10 inbox
Chong Wang, Yiling Lou, Xin Peng, Jianan Liu, Baihan Zou
crossref: 2026-09-12dblp: 2026-09-12

AI 速览

一句话:提出MiROK,从大规模代码中挖掘抽象资源获取/释放对并实例化为具体RAR对,提升资源泄漏检测覆盖率。

资源泄漏由获取的资源未被释放导致,现有检测技术依赖资源获取与释放(RAR)API对,但其配对池往往由人工预定义或仅从项目特定语料挖掘,覆盖库/API有限,容易漏检。本文将资源操作知识表示为抽象资源获取/释放操作对(Abs-RAR对),提出MiROK方法:在大规模代码语料上,先以规则扩展和基于学习的识别策略挖掘Abs-RAR对,再将其实例化为具体RAR对,构建更完善的RAR配对池。作者在包含1,454,224个Java方法和20,000个Maven库的语料上评估,MiROK挖掘出1,313个新Abs-RAR对,实例化为6,314个RAR对,精度达93.3%;将这些RAR对输入现有方法后,在线代码示例和开源项目中检测到更多资源泄漏缺陷。

问题
现有资源泄漏检测依赖的RAR API配对池不完整,通常来自人工预定义或项目特定语料,导致跨库/API覆盖不足并可能漏检潜在泄漏。
方法
将资源操作知识抽象为Abs-RAR对,使用规则扩展与基于学习的两类策略从大规模代码语料中挖掘这些抽象对,再实例化为具体RAR API对。
评估
在包含1,454,224个Java方法和20,000个Maven库的代码语料上挖掘RAR对并开展评估,结果显示挖掘精度达93.3%,且能帮助现有方法发现更多资源泄漏缺陷。
原文摘要(Abstract)

Resource leaks, which are caused by acquired resources not being released, often result in performance degradation and system crashes. Resource leak detection relies on two essential components: identifying potential Resource Acquisition and Release (RAR) API pairs, and subsequently analyze code to uncover instances where the corresponding release API call is absent after an acquisition API call. Yet, existing techniques confine themselves to an incomplete pair pool, either pre-defined manually or mined from project-specific code corpus, thus limiting coverage across libraries/APIs and po- tentially overlooking latent resource leaks. In this work, we propose to represent resource-operation knowledge as abstract resource acquisition/release operation pairs (Abs-RAR pairs for short), and present a novel approach called MiROK to mine such Abs-RAR pairs to construct a better RAR pair pool. Given a large code corpus, MiROK first mines Abs-RAR pairs with rule-based pair expansion and learning-based pair identification strategies, and then instantiates these Abs-RAR pairs into concrete RAR pairs. We implement MiROK and apply it to mine RAR pairs from a large code corpus of 1,454,224 Java methods and 20,000 Maven libraries. We then perform an extensive evaluation to investigate the mining effectiveness of MiROK and the practical usage of its mined RAR pairs for supporting resource leak detection. Our results show that MiROK mines 1,313 new Abs-RAR pairs and instantiates them into 6,314 RAR pairs with a high precision (i.e., 93.3%). In addition, by feeding our mined RAR pairs, existing approaches detect more resource leak defects in both online code examples and open-source projects

链接与引用

DOI 原文 · PDF(开放获取) · DBLP

BibTeX
@inproceedings{WangL0LZ23,
  title = {Mining Resource-Operation Knowledge to Support Resource Leak Detection},
  author = {Chong Wang and Yiling Lou and Xin Peng and Jianan Liu and Baihan Zou},
  booktitle = {FSE},
  year = {2023},
  doi = {10.1145/3611643.3616315}
}