paperbot · PL 论文追踪

全部论文 待读 收藏

P2 CMakeSonar: A Static Approach to Detecting CMake Bugs with a Fine-Grained Type System

CMakeSonar:一种基于细粒度类型系统的 CMake 缺陷静态检测方法
OOPSLA 10(OOPSLA1)2026匹配度 3/10 · 论文属于静态分析与类型系统方向,方法上与用户对程序分析的关注有一定交集;但应用领域是 CMake 构建脚本,未涉及 LLM/Agent、ML 系统静态分析、浮点程序分析或贝叶斯程序分析等核心研究问题。引用 0 inbox
Haotian Han, Zihang Zhong, Qingan Li, Jingling Xue, Mengting Yuan
crossref: 2026-09-10

AI 速览

一句话:提出首个静态精准检测 CMake 脚本语义缺陷的方法,通过细粒度类型系统与流敏感分析发现构建配置错误。

构建系统及其脚本规模和复杂度不断增长,而构建脚本语言功能丰富且类型薄弱,使构建配置缺陷难以检测。本文提出 CMakeSonar,首个精确识别 CMake 脚本语义缺陷的静态方法。它设计细粒度类型系统刻画 CMake 值的运行时语义,并执行流敏感分析,通过求解类型约束检测不一致和类型错误的值使用,发现会悄然影响构建正确性、可移植性与部署安全的配置及使用错误。评估在 GitHub 上 36 个真实 CMake 项目中识别出 155 个缺陷,其中 23 个已被开发者接受并修复;假阳性率 4.32%,召回率 97.48%,表明精确静态分析能有效发现无类型构建系统中的高影响缺陷。

问题
构建脚本语言功能丰富但类型薄弱,CMake 脚本中的语义与配置缺陷难以被传统方法精确检测。
方法
设计细粒度类型系统以刻画 CMake 值的运行时语义,并进行流敏感分析,通过求解类型约束检测不一致与类型错误的值使用。
评估
在 GitHub 36 个真实 CMake 项目中识别 155 个缺陷,其中 23 个被开发者接受并修复,假阳性率 4.32%,召回率 97.48%。
原文摘要(Abstract)

As build systems and their scripts grow in size and complexity, detecting bugs in build configurations becomes increasingly challenging due to the rich functionality and weak typing of build scripting languages. This paper introduces CM ake S onar , the first static approach to precisely identifying semantic bugs in CMake scripts. CM ake S onar addresses this challenge by (1) designing a fine-grained type system that captures the runtime semantics of CMake values, and (2) performing a flow-sensitive analysis that detects inconsistent and ill-typed value usages by solving type constraints. Our approach identifies configuration and usage errors that can silently affect build correctness, portability, and deployment safety. In our evaluation, CM ake S onar identifies 155 bugs across 36 real-world CMake projects on GitHub, of which 23 have been accepted and fixed by developers. With a false positive rate of 4.32 % and a recall of 97.48 % , CM ake S onar demonstrates that precise static analysis can effectively uncover high-impact bugs in untyped build systems.

链接与引用

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

BibTeX
@article{paperbot3807,
  title = {CMakeSonar: A Static Approach to Detecting CMake Bugs with a Fine-Grained Type System},
  author = {Haotian Han and Zihang Zhong and Qingan Li and Jingling Xue and Mengting Yuan},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {10},
  number = {OOPSLA1},
  year = {2026},
  doi = {10.1145/3798218}
}