paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Ares: Inferring Error Specifications through Static Analysis

Ares:通过静态分析推断错误规约
ASE 2019 34th IEEE/ACM International Conference on Automated Software Engineering (ASE)2019匹配度 2/10 · 该论文是纯静态分析工作,自动推断 C API 错误规约以检测错误处理缺陷,不涉及 LLM/Agent、浮点程序分析或贝叶斯程序分析,与用户画像中 PL 与 AI 交叉的核心方向不匹配。引用 4 inbox
Chi Li, Min Zhou, Zuxing Gu, Ming Gu, Hongyu Zhang
crossref: 2026-09-12

AI 速览

一句话:提出 Ares,通过静态分析自动推断 C API 的错误规约并辅助发现错误处理缺陷。

API 语义理解不足与文档缺失常导致误用,错误处理缺陷会带来安全与可靠性问题;检测此类缺陷需要 API 错误规约,即函数如何失败。手工编写规约耗时枯燥。本文提出 Ares,一个针对 C 代码的静态分析工具,利用多种启发式识别错误处理块,并通过分析相应条件逻辑自动推断错误规约。作者在 19 个真实项目上评估,精度比先进工具 APEx 高 37%,并能识别更多错误规约;推断出的规约还帮助在 OpenSSL 等知名项目中发现数十个 API 相关缺陷,其中 10 个被开发者确认。

问题
API 错误处理缺陷的静态检测依赖错误规约,但手工编写 API 错误规约耗时且易错。
方法
Ares 使用多种启发式识别 C 代码中的错误处理块,并分析其条件逻辑来自动推断 API 的错误规约。
评估
在 19 个真实项目上与 APEx 比较,精度提升 37%,识别更多规约,并在 OpenSSL 等项目中发现数十个缺陷,其中 10 个被确认。
原文摘要(Abstract)

Misuse of APIs happens frequently due to misunderstanding of API semantics and lack of documentation. An important category of API-related defects is the error handling defects, which may result in security and reliability flaws. These defects can be detected with the help of static program analysis, provided that error specifications are known. The error specification of an API function indicates how the function can fail. Writing error specifications manually is time-consuming and tedious. Therefore, automatic inferring the error specification from API usage code is preferred. In this paper, we present Ares, a tool for automatic inferring error specifications for C code through static analysis. We employ multiple heuristics to identify error handling blocks and infer error specifications by analyzing the corresponding condition logic. Ares is evaluated on 19 real world projects, and the results reveal that Ares outperforms the state-of-the-art tool APEx by 37% in precision. Ares can also identify more error specifications than APEx. Moreover, the specifications inferred from Ares help find dozens of API-related bugs in well-known projects such as OpenSSL, among them 10 bugs are confirmed by developers. Video: https://youtu.be/nf1QnFAmu8Q. Repository: https://github.com/lc3412/Ares.

链接与引用

DOI 原文 ·

BibTeX
@inproceedings{paperbot5228,
  title = {Ares: Inferring Error Specifications through Static Analysis},
  author = {Chi Li and Min Zhou and Zuxing Gu and Ming Gu and Hongyu Zhang},
  booktitle = {ASE},
  year = {2019},
  doi = {10.1109/ase.2019.00130}
}