A program's exceptional behavior can substantially complicate its control flow, and hence accurately reasoning about the program's correctness. On the other hand, formally verifying realistic programs is likely to involve exceptions -- a ubiquitous feature in modern programming languages.
In this paper, we present a novel approach to verify the exceptional behavior of Java programs, which extends our previous work on ByteBack. ByteBack works on a program's bytecode, while providing means to specify the intended behavior at the source-code level; this approach sets ByteBack apart from most state-of-the-art verifiers that target source code. To explicitly model a program's exceptional behavior in a way that is amenable to formal reasoning, we introduce Vimp: a high-level bytecode representation that extends the Soot framework's Grimp with verification-oriented features, thus serving as an intermediate layer between bytecode and the Boogie intermediate verification language. Working on bytecode through this intermediate layer brings flexibility and adaptability to new language versions and variants: as our experiments demonstrate, ByteBack can verify programs involving exceptional behavior in all versions of Java, as well as in Scala and Kotlin (two other popular JVM languages).
Efficient and Expressive Bytecode-Level Instrumentation for Java Programs
我们提出了一个有效的和富有表现力的工具,在字节码级的Java程序的仪器。BISM(Bytecode-Level Instrumentation for Software Monitoring)是一个轻量级的Java字节码插装工具,它具有一种表达性高的高级控制流感知插装语言。该语言受到面向方面编程范例的启发,将插装模块化为单独的Transformers,封装连接点选择和内联建议。BISM允许捕获从字节码指令到方法执行的连接点,并提供全面的静态和动态上下文信息。它以两种检测模式运行:构建时和加载时。BISM还提供了一种机制来组合Transformers并自动检测它们在基本程序中的冲突。组合中的Transformers可以控制它们的通知和来自基本程序的其他指令的可见性。我们展示了BISM的几个示例应用程序,并使用三个实验证明其有效性:安全场景,金融交易系统和一般运行时验证案例。结果表明,BISM插装引起低的运行时间和内存开销。
JooFlux: Hijacking Java 7 InvokeDynamic To Support Live Code Modifications
在运行时更改功能性和非功能性软件实现在开发和生产环境中是有用的,有时甚至是至关重要的。JooFlux是一个JVM代理,它允许方法实现的动态替换和方面建议的应用。它通过字节码转换来利用Java SE 7中添加的新invokedynamic指令来帮助实现JVM的动态语言。JooFlux可以使用JMX代理进行管理,以便在运行时进行动态修改,而无需求助于专用的特定领域语言。我们将JooFlux与现有的AOP平台和动态语言进行了比较。结果表明,JooFlux的性能接近Java的--与大多数时间边际开销,有时增益--在AOP平台和动态语言提出显着的开销。这为JooFlux未来有趣的发展和应用铺平了道路。