一句话:提出 PL4SA,用细粒度全程序指向信息渐进地选择相关库方法,兼顾静态分析的效率与召回率。
现代软件依赖大量外部库:全程序静态分析开销大易超时,仅分析应用代码又会漏掉库引入的缺陷,已有部分包含库方案难以精确刻画相关性。本文提出 PL4SA,用细粒度全程序指向信息建立客户端分析与库方法的精确相关性,并以渐进扩展方式融合指向分析与库方法选择:每轮按相关性排序指针,选取最相关指针及其库方法,并展开依赖指针以揭示更多指向信息;扩展指针抽象概括方法调用与数组访问的额外信息流作为扩展锚点。分析分三步组织,并借助摘要技术复用库内过程内指向分析结果。实验表明,仅纳入 12% 与 17% 库方法,PL4SA 在变量类型与空指针分析上较全程序分析加速 24.6 倍和 9.0 倍,召回率 99.0%,精度均 100%,显著优于基线。
With the rapid advancements in modern software engineering practices, software applications have become increasingly dependent on external libraries, making the choice between whole-program and application-only analysis more critical: the former often leads to timeouts due to high computational overhead, while the latter risks missing library-induced bugs. Recent research has explored a compromise path, i.e., partial inclusion of libraries to balance analysis efficiency and recall. However, achieving a more precise relevance analysis that enables a more balanced and accurate library selection while minimizing the associated overhead remains a significant challenge. This paper proposes PL4SA, a novel partial library selection approach that establishes precise relevance between client analyses and library methods using fine-grained whole-program points-to information. The key point of PL4SA lies in integrating points-to analysis with the partial library selection process in a progressively expanding manner. During this process, pointers are ranked according to their relevance to the client analysis; in each iteration, the most relevant pointer as well as its corresponding library is selected, while pointers dependent on the selected pointer are further expanded to reveal their points-to information. To support this analysis, extended pointers, a pointer-based abstraction that summarizes additional information flows into/out of method invocations and array accesses, serve as anchors for the progressive expansion of points-to information. Furthermore, PL4SA organizes this analysis in three steps, leveraging summarization techniques to enable the reuse of time-critical intra-procedural points-to analysis results within libraries across different projects, due to the inherent stability of library code. Collectively, these design choices contribute to PL4SA’s high efficiency. Our experimental results demonstrate that by including only 12% and 17% library methods, PL4SA achieves 24.6x, 9.0x speedup, and 99.0% recall, and both 100% precision for variable-type analysis and null-pointer analysis compared to whole-program analysis, significantly outperforming existing baselines.