HeteroFuzz: fuzz testing to detect platform dependent divergence for heterogeneous applications

HeteroFuzz: fuzz testing to detect platform dependent divergence for heterogeneous applications
复制标题

DOI:
10.1145/3468264.3468610
复制
发表时间:
2021-08
期刊:
Proceedings of the 29th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering
影响因子:
--
通讯作者:
Qian Zhang;Jiyuan Wang;Miryung Kim
Qian Zhang;Jiyuan Wang;Miryung Kim
中科院分区:
其他
文献类型:
--
作者:
Qian Zhang;Jiyuan Wang;Miryung Kim

文献摘要

被引文献

相似文献

随着FPGA等专用硬件加速器成为当前计算领域的重要组成部分,越来越多的软件应用程序被构建为利用异构架构。这种趋势已经发生在机器学习和基于边缘设备的物联网(IoT)系统领域。然而,目前缺乏针对异构应用程序的调试和测试方法。这些应用程序可能看起来类似于常规C/C++代码,但包括预处理器指令方面的硬件合成细节。因此,它们在异构体系结构下的行为可能会因硬件合成细节而与CPU显著不同。此外,编译和硬件仿真周期需要大量的时间,禁止频繁调用所需的模糊测试。我们提出了一种新的模糊测试技术,称为HeteroFuzz,专门针对异构应用程序,并检测平台相关的分歧。HeteroFuzz的关键本质是它使用三管齐下的方法来减少在异构应用程序上重复调用硬件模拟器的长延迟。首先,除了监控代码覆盖率作为模糊指导机制,我们分析了内核代码中的合成杂注,并监控加速器相关的值谱。其次,我们设计了动态概率突变,以增加在不同平台下击中不同行为的机会。第三,我们记住所看到的内核输入的边界,如果HLS模拟器调用只能暴露冗余的发散行为,则跳过HLS模拟器调用。我们评估HeteroFuzz在七个现实世界的异构应用程序与FPGA内核。HeteroFuzz在暴露同一组不同的分歧症状方面比朴素模糊快754倍。概率突变比没有突变的加速17.5倍。有选择地调用HLS仿真比没有选择地调用HLS仿真的速度提高了8.8倍。
As specialized hardware accelerators like FPGAs become a prominent part of the current computing landscape, software applications are increasingly constructed to leverage heterogeneous architectures. Such a trend is already happening in the domain of machine learning and Internet-of-Things (IoT) systems built on edge devices. Yet, debugging and testing methods for heterogeneous applications are currently lacking. These applications may look similar to regular C/C++ code but include hardware synthesis details in terms of preprocessor directives. Therefore, their behavior under heterogeneous architectures may diverge significantly from CPU due to hardware synthesis details. Further, the compilation and hardware simulation cycle takes an enormous amount of time, prohibiting frequent invocations required for fuzz testing. We propose a novel fuzz testing technique, called HeteroFuzz, designed to specifically target heterogeneous applications and to detect platform-dependent divergence. The key essence of HeteroFuzz is that it uses a three-pronged approach to reduce the long latency of repetitively invoking a hardware simulator on a heterogeneous application. First, in addition to monitoring code coverage as a fuzzing guidance mechanism, we analyze synthesis pragmas in kernel code and monitor accelerator-relevant value spectra. Second, we design dynamic probabilistic mutations to increase the chance of hitting divergent behavior under different platforms. Third, we memorize the boundaries of seen kernel inputs and skip HLS simulator invocation if it can expose only redundant divergent behavior. We evaluate HeteroFuzz on seven real-world heterogeneous applications with FPGA kernels. HeteroFuzz is 754X faster in exposing the same set of distinct divergence symptoms than naive fuzzing. Probabilistic mutations contribute to 17.5X speed up than the one without. Selective invocation of HLS simulation contributes to 8.8X speed up than the one without.