Skip to main content
QUICK REVIEW

[论文解读] Event-Flow Graphs for Efficient Path-Sensitive Analyses

Ahmed Tamrawi, Suresh Kothari|arXiv (Cornell University)|Apr 4, 2014
Software Testing and Debugging Techniques参考文献 22被引用 3
一句话总结

本文提出事件流图(EFGs),一种控制流图(CFGs)的紧凑型线性时间衍生图,通过基于共享事件轨迹(即相关事件与分支节点的序列)将路径分组为等价类,实现路径爆炸的显著减少。通过仅关注事件轨迹和相关分支,EFGs 将路径数量减少高达99%,并简化可行性检查,从而实现高效、准确的路径敏感分析,生成人类可读且最小化的图结构。

ABSTRACT

Efficient and accurate path-sensitive analyses pose the challenges of: (a) analyzing an exponentially-increasing number of paths in a control-flow graph (CFG), and (b) checking feasibility of paths in a CFG. We address these challenges by introducing an equivalence relation on the CFG paths to partition them into equivalence classes. It is then sufficient to perform analysis on these equivalence classes rather than on the individual paths in a CFG. This technique has two major advantages: (a) although the number of paths in a CFG can be exponentially large, the essential information to be analyzed is captured by a small number of equivalence classes, and (b) checking path feasibility becomes simpler. The key challenge is how to efficiently compute equivalence classes of paths in a CFG without examining each path in the CFG? In this paper, we present a linear-time algorithm to form equivalence classes without the need for examination of each path in a CFG. The key to this algorithm is construction of an event-flow graph (EFG), a compact derivative of the CFG, in which each path represents an equivalence class of paths in the corresponding CFG. EFGs are defined with respect to the set of events that are in turn defined by the analyzed property. The equivalence classes are thus guaranteed to preserve all the event traces in the original CFG. We present an empirical evaluation of the Linux kernel (v3.12). The EFGs in our evaluation are defined with respect to events of the spin safe-synchronization property. Evaluation results show that there are many fewer EFG-based equivalence classes compared to the corresponding number of paths in a CFG. This reduction is close to 99% for CFGs with a large number of paths. Moreover, our controlled experiment results show that EFGs are human comprehensible and compact compared to their corresponding CFGs.

研究动机与目标

  • 解决控制流图(CFGs)中路径数量指数级增长的问题,这是路径敏感静态分析的主要瓶颈。
  • 克服由于路径爆炸导致检查所有CFG路径可行性的计算不可行性。
  • 提出一种方法,仅分析代表性路径(等价类),而非CFG中的所有独立路径。
  • 通过保留所有相关事件轨迹和可行性条件,确保分析结果的正确性与完备性。
  • 构建一种紧凑、人类可理解且可高效计算的图结构(EFG),以实现对软件属性(如自旋锁安全性)的可扩展验证。

提出的方法

  • 将事件轨迹定义为CFG路径上事件与相关分支节点的序列,事件轨迹相同的路径被归入同一等价类。
  • 引入事件流图(EFG)作为CFG的衍生结构,每个等价类仅对应一条路径,且EFG路径与等价类之间存在一一对应且满射的关系。
  • 使用四步算法在O(n)时间内构建EFG:(1) 识别相关与无关分支节点,(2) 移除无关分支,(3) 压缩图结构,(4) 应用变换生成T-不可约、无环且最小化的EFG。
  • 利用无关分支节点的概念——即其分支通向相同事件或终止节点的节点——其存在不影响事件轨迹或可行性。
  • 证明仅需通过相关分支节点即可检查路径可行性,因为无关分支不影响等价类的可行性。
  • 利用图论性质(如边界节点、后继集)形式化证明EFG保留了事件轨迹与可行性,确保分析的正确性与完备性。

实验结果

研究问题

  • RQ1能否通过将分析路径数从指数级减少到可管理的等价类数量,使路径敏感分析实现可扩展性?
  • RQ2能否在O(n)时间内构建一种紧凑、人类可理解的图结构,同时保留CFG中的所有必要事件轨迹与可行性信息?
  • RQ3仅关注相关分支节点与事件轨迹,是否能保持验证如自旋锁安全性等属性的正确性与完备性?
  • RQ4在真实系统中,EFG相比原始CFG在路径数与分支节点数方面能减少多少?
  • RQ5EFG能否通过减少人工验证时间,提升静态分析的实用性并实现真实错误的检测?

主要发现

  • 在Linux内核v3.12的评估中,EFGs将CFG中的路径数量最多减少99%,尤其适用于路径数量庞大的CFG。
  • 与对应的CFG相比,EFG中的分支节点数量显著减少,仅保留相关分支节点。
  • EFG构建算法的时间复杂度为线性时间,可高效生成紧凑且具有代表性的图,适用于路径敏感分析。
  • EFGs具有人类可读性,且相比其对应的CFG显著更紧凑,大幅减少人工验证的时间与工作量。
  • 一项使用EFGs的受控实验揭示了Linux内核中此前未被发现的错误,该错误已被社区接受,验证了该方法的实际有效性。
  • 可行性检查可仅限于相关分支节点,因为无关分支不影响路径可行性,从而简化了分析过程。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。