一句话:PCA 通过部分调用路径分析实现可扩展的跨过程数据依赖计算,并用于 C 程序内存泄漏检测。
跨过程数据依赖分析是众多软件质量保障任务的基础,但现有框架与工具在真实程序上普遍面临可扩展性瓶颈。本文提出 PCA,一个面向真实 C 程序的静态跨过程数据依赖分析器。PCA 采用轻量级设计完成跨过程指向分析与数据流分析,其核心是部分调用路径(partial call-path,PCA)分析,并提供若干优化选项以进一步加速数据依赖计算。作为该分析的一个应用实例,PCA 可直接支持内存泄漏检测。在与基于最先进值流分析(value flow analysis)的同类应用对比中,PCA 取得了相当甚至更好的性能与精度,并在一个工业级系统中额外发现了 4 个内存泄漏,且均已被开发者修复。此外,PCA 计算出的数据依赖还可支撑影响分析与污点分析等其他应用。
Data dependence analysis underlies various applications in software quality assurance, yet existing frameworks/tools for this analysis commonly suffer scalability challenges. We present PCA, a static interprocedural data dependence analyzer for real-world C programs. PCA performs interprocedural points-to and data-flow analyses with a lightweight design. Most of all, it features a partial call-path (PCA) analysis that consists of optimization options to further speed up data dependence computation. As an example application of it, PCA readily supports memory leak detection, for which it helps achieve close or better performance and precision relative to the same application based on a state-of-the-art value flow analysis. In particular, it found four more memory leaks in an industry-scale system which have been fixed by the developers. Through the data dependence it computes, PCA can enable other applications (e.g., impact analysis and taint analysis).