paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Detecting Exception Handling Bugs in C++ Programs

检测 C++ 程序中的异常处理缺陷
ICSE 2023 IEEE/ACM 45th International Conference on Software Engineering (ICSE)2023匹配度 3/10 · 这是一篇经典的静态分析论文(扩展控制流图 + 符号执行 + 在 Clang Static Analyzer 上实现工具),与画像中的“静态分析”方法论层面有交集,工具工程实现和与 SOTA 工具对比也符合偏好;但它既没有涉及 LLM/Agent 与静态分析的交叉,也不属于浮点程序分析或贝叶斯程序分析,目标场景(C++ 异常处理缺陷)与画像中明确的四个追题方向均不重合。引用 13 inbox
Hao Zhang, Ji Luo, Mengze Hu, Jun Yan, Jian Zhang, Zongyan Qiu
crossref: 2026-09-12dblp: 2026-09-12

AI 速览

一句话:扩展控制流图与符号执行框架,在 Clang Static Analyzer 上实现 C++ 异常处理缺陷静态检测工具,精度达 84%。

异常处理是现代编程语言的重要机制,但异常处理代码容易出错,针对 C++ 程序的异常处理缺陷检测研究仍然有限。本文旨在精确刻画 C++ 程序的异常控制流并据此检测缺陷。作者首先扩展控制流图,引入五类不同的基本块来表示异常控制流;随后改造经典符号执行框架,将程序状态扩展为四元组,并专门处理 try、throw 与 catch 语句。基于上述技术,在 Clang Static Analyzer 之上实现了静态分析工具。作者在 GitHub 高星项目上运行该工具,在 8 个项目中发现了 36 个异常处理缺陷,精确率为 84%。与 Cppcheck、Clang Static Analyzer、Facebook Infer 和 IKOS 四个先进静态分析工具在 GitHub 项目及手工基准上的对比表明,其他工具未能发现本文工具所发现的任何异常处理缺陷,而在手工基准上本文工具的召回率显著更高。

问题
异常处理代码容易出错,但现有研究对异常处理缺陷的检测仍不充分,尤其是 C++ 程序。
方法
扩展控制流图以引入五类基本块来精确表示异常控制流,并改造经典符号执行框架,将程序状态扩展为四元组并专门处理 try、throw、catch 语句,最终在 Clang Static Analyzer 上实现静态检测工具。
评估
在 GitHub 高星项目和手工基准上运行工具,并与 Cppcheck、Clang Static Analyzer、Facebook Infer、IKOS 对比;在 8 个项目中发现 36 个缺陷,精确率 84%,且其他工具未能发现这些缺陷,手工基准上召回率显著更高。
原文摘要(Abstract)

Exception handling is a mechanism in modern programming languages. Studies have shown that the exception handling code is error-prone. However, there is still limited research on detecting exception handling bugs, especially for C++ programs. To tackle the issue, we try to precisely represent the exception control flow in C++ programs and propose an analysis method that makes use of the control flow to detect such bugs. More specifically, we first extend control flow graph by introducing the concepts of five different kinds of basic blocks, and then modify the classic symbolic execution framework by extending the program state to a quadruple and properly processing try, throw and catch statements. Based on the above techniques, we develop a static analysis tool on the top of Clang Static Analyzer to detect exception handling bugs. We run our tool on projects with high stars from GitHub and find 36 exception handling bugs in 8 projects, with a precision of 84%. We compare our tool with four state-of-the-art static analysis tools (Cppcheck, Clang Static Analyzer, Facebook Infer and IKOS) on projects from GitHub and handmade benchmarks. On the GitHub projects, other tools are not able to detect any exception handling bugs found by our tool. On the handmade benchmarks, our tool has a significant higher recall.

链接与引用

DOI 原文 · DBLP

BibTeX
@inproceedings{ZhangLHYZQ23,
  title = {Detecting Exception Handling Bugs in C++ Programs},
  author = {Hao Zhang and Ji Luo and Mengze Hu and Jun Yan and Jian Zhang and Zongyan Qiu},
  booktitle = {ICSE},
  year = {2023},
  doi = {10.1109/icse48619.2023.00098}
}