Constructing exception handling chains for testing Java']Java virtual machine implementations

被引:0
作者
Chen, Bochuan [1 ,2 ]
Guo, Xiao [1 ,2 ]
Chen, Yuting [3 ]
Yu, Xiaofeng [4 ]
Bu, Lei [2 ,5 ]
机构
[1] Nanjing Univ, State Key Lab Novel Software Technol, Nanjing, Peoples R China
[2] Nanjing Univ, Dept Comp Sci & Technol, Nanjing, Peoples R China
[3] Shanghai Jiao Tong Univ, Dept Comp Sci & Engn, Shanghai, Peoples R China
[4] Nanjing Univ, Sch Business, Nanjing, Peoples R China
[5] Nanjing Univ, Software Inst, Nanjing, Peoples R China
基金
中国国家自然科学基金;
关键词
chain; exception handling; !text type='Java']Java[!/text] virtual machine; mutation;
D O I
10.1002/smr.2562
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
The Java virtual machine (JVM) is the cornerstone of the Java platforms. A JVM's exception handling implementation interrupts, when the objective application encounters an exception (or an error), the normal execution of the application and performs specific handling tasks. However, little research has been done in systematically validating JVMs' exception handling implementations-test programs or even applications need to be carefully designed for throwing/catching exceptions at runtime; a JVM's exception handling implementation is also complicated, making it challenging to design tests for testing all of its functionalities. Inspired by the recent success of fuzz testing of compilers and JVM implementations, we introduce EHCBuilder, the first technique for fuzzing JVMs' exception handling implementations. The key idea is to construct exception handling chains, each of which abstracts a program's execution into a sequence of exception throwings, catchings, and/or handlings. A classfile seed can then be mutated into test programs with diverse exception handling chains, enabling (1) exceptions to be continuously thrown and caught at runtime, and (2) JVMs' exception handling implementations to be much more thoroughly tested. We have implemented EHCBuilder and evaluated EHCBuilder on popular JVM implementations including OpenJDK's HotSpot, Eclipse's OpenJ9, Azul's Zulu, and Oracle's GraalVM. Our results show that EHCBuilder can generate programs with very intricate exception handling chains and reveal differences among JVMs' exception handling implementations: Up to thousands of lines of source code in HotSpot's exception handling implementation are covered more than the original benchmarks; during 39 K iterations, EHCBuilder generates exception handling chains of different lengths, revealing 258 runtime differences. We classify the differences into four categories, and reveal a fast throw issue confirmed by HotSpot developers and another initCause issue confirmed by the OpenJ9 community.
引用
收藏
页数:17
相关论文
共 33 条
  • [1] Authority RF., 2018, FUZZING RUST CODE AM
  • [2] The DaCapo benchmarks: Java']Java benchmarking development and analysis
    Blackburn, Stephen M.
    Garner, Robin
    Hoffmann, Chris
    Khan, Asjad M.
    McKinley, Kathryn S.
    Bentzur, Rotem
    Diwan, Amer
    Feinberg, Daniel
    Frampton, Daniel
    Guyer, Samuel Z.
    Hirzel, Martin
    Hosking, Antony
    Jump, Maria
    Lee, Han
    Moss, J. Eliot B.
    Phansalkar, Aashish
    Stefanovic, Darko
    VanDrunen, Thomas
    von Dincklage, Daniel
    Wiedermann, Ben
    [J]. ACM SIGPLAN NOTICES, 2006, 41 (10) : 169 - 190
  • [3] Automated Conformance Testing of Java']Java Virtual Machines
    Calvagna, Andrea
    Tramontana, Emiliano
    [J]. 2013 SEVENTH INTERNATIONAL CONFERENCE ON COMPLEX, INTELLIGENT, AND SOFTWARE INTENSIVE SYSTEMS (CISIS), 2013, : 547 - 552
  • [4] Changbing Ji, 2009, 2009 33rd Annual IEEE International Computer Software and Applications Conference (COMPSAC 2009), P556, DOI 10.1109/COMPSAC.2009.192
  • [5] Deep Differential Testing of JVM Implementations
    Chen, Yuting
    Su, Ting
    Su, Zhendong
    [J]. 2019 IEEE/ACM 41ST INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING (ICSE 2019), 2019, : 1257 - 1268
  • [6] Chen YT, 2016, ACM SIGPLAN NOTICES, V51, P85, DOI [10.1145/2980983.2908095, 10.1145/2908080.2908095]
  • [7] Assessing the correctness of JVM implementations
    Fornaia, Andrea
    Calvagna, Andrea
    Tramontana, Emiliano
    [J]. 2014 IEEE 23RD INTERNATIONAL WETICE CONFERENCE (WETICE), 2014, : 390 - 395
  • [8] Fu C, 2007, PROC INT CONF SOFTW, P230
  • [9] Gosling J., 2018, JAVA LANGUAGE SPECIF
  • [10] Haghighat MR., 2016, JAVA FUZZER ANDROID