一句话:通过定性分析 Emscripten 的 146 个缺陷与定量分析三个 WebAssembly 编译器的 1054 个缺陷,刻画其缺陷特征并给出测试与调试启示。
WebAssembly 是面向 Web 的新型可移植字节码格式,主要作为 C、C++、Rust 等高级语言的编译目标,其二进制通常由编译器而非人工生成。为把原生代码移植到 Web,WebAssembly 编译器必须处理源语言与目标语言之间、以及两者执行环境之间的差异,因此其缺陷具有不同于传统编译器的独特成因。深入理解这些缺陷有助于编译器开发者确定开发与测试的投入重点。本文开展了两项实证研究:首先对使用最广的 WebAssembly 编译器 Emscripten 中与 WebAssembly 特有挑战相关的 146 个缺陷报告进行定性分析;其次对 AssemblyScript、Emscripten 与 Rustc/Wasm-Bindgen 三个开源编译器的 1054 个缺陷进行定量分析,从缺陷生命周期、影响以及触发输入与修复补丁的规模三个维度加以考察。研究加深了对 WebAssembly 编译器缺陷的理解,并为设计实用的测试与调试工具提供了方向。
WebAssembly is the newest programming language for the Web. It defines a portable bytecode format for use as a compilation target for programs developed in high-level languages such as C, C++, and Rust. As a result, WebAssembly binaries are generally created by WebAssembly compilers rather than being written manually. To port native code to the Web, WebAssembly compilers need to address the differences between the source and target languages and dissimilarities in their execution environments. A deep understanding of the bugs in WebAssembly compilers can help compiler developers determine where to focus development and testing efforts. In this paper, we conduct two empirical studies to understand the characteristics of the bugs found in WebAssembly compilers. First, we perform a qualitative analysis of bugs in Emscripten, the most widely-used WebAssembly compiler. We investigate 146 bug reports in Emscripten related to the unique challenges WebAssembly compilers encounter compared with traditional compilers. Second, we provide a quantitative analysis of 1,054 bugs in three open-source WebAssembly compilers, AssemblyScript, Emscripten, and Rustc/Wasm-Bindgen. We analyze these bugs along three dimensions: lifecycle, impact, and sizes of bug-inducing inputs and bug fixes. These studies deepen our understanding of WebAssembly compiler bugs. We hope that the findings of our study will shed light on opportunities to design practical tools for testing and debugging WebAssembly compilers.
DOI 原文 ·
@inproceedings{paperbot6532,
title = {An Empirical Study of Bugs in WebAssembly Compilers},
author = {Alan Romano and Xinyue Liu and Yonghwi Kwon and Weihang Wang},
booktitle = {ASE},
year = {2021},
doi = {10.1109/ase51524.2021.9678776}
}