一句话:提出 Jmvx,首个面向 Java 等托管语言的多线程多版本执行与记录-重放系统,开销低。
多版本执行(MVX)把同一程序的多个等价变体作为单个程序部署,可视为在线记录/重放(RR),但现有 MVX 只面向 C/C++,不支持当今占绝大多数的托管语言程序。本文提出 Jmvx:用新的动态分析自动识别并拦截非确定性方法,保证所有变体执行相同方法、获得相同数据;借助 JVM 间共享内存中的环形缓冲区实现变体间快速通信;并通过在一个变体中捕获同步操作、强制其他变体遵循相同顺序来支持多线程。作者在一组有代表性的 Java 基准上验证了 MVX 与 RR 支持,禁用/启用多线程时 MVX 平均开销为 5%/47%,记录为 8%/25%,重放为 13%/73%。
Multi-version execution (MVX) is a technique that deploys many equivalent versions of the same program — variants — as a single program, with direct application in important fields such as: security, reliability, analysis, and availability. MVX can be seen as “online Record/Replay (RR)”, as RR captures a program’s execution as a log stored on disk that can later be replayed to observe the same execution. Unfortunately, current MVX techniques target programs written in C/C++ and do not support programs written in managed languages, which are the vast majority of code written nowadays. This paper presents the design, implementation, and evaluation of Jmvx— a novel system for performing MVX and RR on programs written in managed languages. Jmvx supports programs written in Java by intercepting automatically identified non-deterministic methods, via a novel dynamic analysis technique, and ensuring that all variants execute the same methods and obtain the same data. Jmvx supports multi-threaded programs, by capturing synchronization operations in one variant, and ensuring all other variants follow the same ordering. We validated that Jmvx supports MVX and RR by applying it to a suite of benchmarks representative of programs written in Java. Internally, Jmvx uses a circular buffer located in shared memory between JVMs to enable fast communication between all variants, averaging 5% |47% performance overhead when performing MVX with multithreading support disabled|enabled, 8% |25% when recording, and 13% |73% when replaying.
@article{SchwartzKP24,
title = {Jmvx: Fast Multi-threaded Multi-version Execution and Record-Replay for Managed Languages},
author = {David Schwartz and Ankith Kowshik and Luís Pina},
journal = {Proceedings of the ACM on Programming Languages},
volume = {8},
number = {OOPSLA2},
year = {2024},
doi = {10.1145/3689769}
}