Historia:用消息历史逻辑反驳回调可达性(扩展版)
Historia: Refuting Callback Reachability with Message-History Logics (Extended Version)
AI总结:
本文针对事件驱动框架中回调控制流不透明导致的静态分析难题,提出基于消息历史逻辑的折中方案,通过解耦控制流规范与应用代码分析,开发了Historia验证器以证明开源Android应用中不存在多回调错误模式。
摘要:
本文确定在事件驱动框架中,回调是否会在意外状态下被调用。事件驱动编程框架在几乎所有现代平台上都被广泛用于创建用户交互式应用程序。回调之间的控制流由框架决定,对程序员来说在很大程度上是不透明的。回调控制流的这种不透明性不仅给程序员带来困难,也让开发静态分析的人员感到棘手。先前的静态分析技术要么假设任意框架实现,要么试图急切地指定所有可能的回调控制流,但这要么过于粗糙,要么负担太重且难以正确实现。相反,我们提出了一种折中方案,可以以有针对性的方式逐步细化回调控制流,以证明感兴趣的断言。实现这种折中方案的关键见解是对应用和框架代码边界处的方法调用历史进行推理——从而实现回调控制流的规范与应用代码的分析解耦。我们将此类边界方法调用的序列称为消息历史,并开发了消息历史逻辑来进行这种推理。具体而言,我们定义了带有边界转换的仅应用转换系统的概念、针对此类转换的消息历史程序逻辑,以及以有针对性和组合方式捕获回调控制流的时序规范逻辑。然后,为了在目标导向的验证器中使用这些逻辑,我们定义了一种事后将关于消息历史的断言与回调控制流规范相结合的方法。我们实现了一个名为Historia的原型消息历史验证器,它能够在真实世界的开源Android应用中证明不存在多回调错误模式。
英文摘要:
This paper determines if a callback can be called by an event-driven framework in an unexpected state.Event-driven programming frameworks are pervasive for creating user-interactive apps on just about every modern platform.Control flow between callbacks is determined by the framework and largely opaque to the programmer.This opacity of the callback control flow not only causes difficulty for the programmer but is also difficult for those developing static analysis.Previous static analysis techniques address this opacity either by assuming an arbitrary framework implementation or attempting to eagerly specify all possible callback control flow, but this is either too coarse or too burdensome and tricky to get right.Instead, we present a middle way where the callback control flow can be gradually refined in a targeted manner to prove assertions of interest.The key insight to get this middle way is by reasoning about the history of method invocations at the boundary between app and framework code - enabling a decoupling of the specification of callback control flow from the analysis of app code.We call the sequence of such boundary-method invocations message histories and develop message-history logics to do this reasoning.In particular, we define the notion of an application-only transition system with boundary transitions, a message-history program logic for programs with such transitions, and a temporal specification logic for capturing callback control flow in a targeted and compositional manner.Then to utilize the logics in a goal-directed verifier, we define a way to combine after-the-fact an assertion about message histories with a specification of callback control flow.We implemented a prototype message history-based verifier called Historia that enables proving the absence of multi-callback bug patterns in real-world open-source Android apps.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。