paperbot · PL 论文追踪

全部论文 待读 收藏

P2 SPrinter: A Static Checker for Finding Smart Pointer Errors in C++ Programs

SPrinter:一种用于发现 C++ 程序中智能指针错误的静态检查器
ASE 2019 34th IEEE/ACM International Conference on Automated Software Engineering (ASE)2019匹配度 2/10 · 该论文属于静态程序分析与抽象解释,但其目标是检测 C++ 智能指针错误,未涉及用户核心关注的 LLM/Agent 与静态分析交叉、ML/Agentic 程序分析、浮点程序分析或贝叶斯程序分析。仅在广义程序分析上与研究方向相邻,匹配度较低。引用 3 inbox
Xutong Ma, Jiwei Yan, Yaqi Li, Jun Yan, Jian Zhang
crossref: 2026-09-12

AI 速览

一句话:提出编译期静态检查器 SPrinter,检测 C++ 智能指针的不良用法并提示易错行为。

智能指针在现代 C++ 中被广泛用于防止内存错误,但其不当使用同样会引发常见的内存错误,使代码并不像预期那样安全。为尽早发现此类问题,作者提出了编码风格检查器 SPrinter,在编译期检测可能有害的智能指针用法,并向程序员提示易出错的写法。评估表明,现有最先进的静态代码检查器在 116 个人工注入的错误中仅能检出 25 个,而 SPrinter 能够全部检出;此外,作者在 8 个开源项目中发现了 521 个缺陷,且仅有 4 个误报。

问题
智能指针的不当使用仍会导致内存错误,而现有最先进的静态检查器对这类错误的检测能力十分有限。
方法
实现编译期编码风格检查器 SPrinter,静态识别有风险的智能指针用法并向程序员告警。
评估
在 116 个手工注入错误上与现有最先进检查器对比检出率,并在 8 个开源项目上实测所发现的缺陷数与误报数。
原文摘要(Abstract)

Smart pointers are widely used to prevent memory errors in modern C++ code. However, improper usage of smart pointers may also lead to common memory errors, which makes the code not as safe as expected. To avoid smart pointer errors as early as possible, we present a coding style checker to detect possible bad smart pointer usages during compile time, and notify programmers about bug-prone behaviors. The evaluation indicates that the currently available state-of-the-art static code checkers can only detect 25 out of 116 manually inserted errors, while our tool can detect all these errors. And we also found 521 bugs among 8 open source projects with only 4 false positives.

链接与引用

DOI 原文 ·

BibTeX
@inproceedings{paperbot5268,
  title = {SPrinter: A Static Checker for Finding Smart Pointer Errors in C++ Programs},
  author = {Xutong Ma and Jiwei Yan and Yaqi Li and Jun Yan and Jian Zhang},
  booktitle = {ASE},
  year = {2019},
  doi = {10.1109/ase.2019.00117}
}