Understanding and Finding Java']Java Decompiler Bugs

被引:1
|
作者
Lu, Yifei [1 ]
Hou, Weidong [1 ]
Pan, Minxue [1 ]
Li, Xuandong [1 ]
Su, Zhendong [1 ]
机构
[1] Nanjing Univ, Software Inst, State Key Lab Novel Software Technol, Nanjing, Peoples R China
来源
基金
中国国家自然科学基金;
关键词
Reverse Engineering; Decompiler; Differential Testing; FLOW;
D O I
10.1145/3649860
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Java decompilers are programs that perform the reverse process of Java compilers, i.e., they translate Java bytecode to Java source code. They are essential for reverse engineering purposes and have become more sophisticated and reliable over the years. However, it remains challenging for modern Java decompilers to reliably perform correct decompilation on real-world programs. To shed light on the key challenges of Java decompilation, this paper provides the first systematic study on the characteristics and causes of bugs in mature, widely-used Java decompilers. We conduct the study by investigating 333 unique bugs from three popular Java decompilers. Our key findings and observations include: (1) Although most of the reported bugs were found when decompiling large, real-world code, 40.2% of them have small test cases for bug reproduction; (2) Over 80% of the bugs manifest as exceptions, syntactic errors, or semantic errors, and bugs with source code artifacts are very likely semantic errors; (3) 57.7%, 39.0%, and 41.1% of the bugs respectively are attributed to three stages of decompilers-loading structure entities from bytecode, optimizing these entities, and generating source code from these entities; (4) Bugs in decompilers' type inference are the most complex to fix; and (5) Region restoration for structures like loop, sugaring for special structures like switch, and type inference of variables of generic types or indistinguishable types are the three most significant challenges in Java decompilation, which to some extent explains our findings in (3) and (4). Based on these findings, we present JD-Tester, a differential testing framework for Java decompilers, and our experience of using it in testing the three popular Java decompilers. JD-Tester utilizes different Java program generators to construct executable Java tests and finds exceptions, syntactic, and semantic inconsistencies (i.e. bugs) between a generated test and its compiled-decompiled version (through compilation and execution). In total, we have found 62 bugs in the three decompilers, demonstrating both the effectiveness of JD-Tester, and the importance of testing and validating Java decompilers.
引用
收藏
页数:27
相关论文
共 50 条
  • [1] Comments Recovery Approach for Java']Java Decompiler
    Sateanpattanakul, Siwadol
    2016 IEEE/ACIS 15TH INTERNATIONAL CONFERENCE ON COMPUTER AND INFORMATION SCIENCE (ICIS), 2016, : 621 - 626
  • [2] An Analysis on Java']Java Programming Language Decompiler Capabilities
    Gusarovs, Konstantins
    APPLIED COMPUTER SYSTEMS, 2018, 23 (02) : 109 - 117
  • [3] Finding and Preventing Bugs in Java']JavaScript Bindings
    Brown, Fraser
    Narayan, Shravan
    Wahby, Riad S.
    Engler, Dawson
    Jhala, Ranjit
    Stefan, Deian
    2017 IEEE SYMPOSIUM ON SECURITY AND PRIVACY (SP), 2017, : 559 - 578
  • [4] Adabot: Fault-Tolerant Java']Java Decompiler (Student Abstract)
    Li, Zhiming
    Wu, Qing
    Qian, Kun
    THIRTY-FOURTH AAAI CONFERENCE ON ARTIFICIAL INTELLIGENCE, THE THIRTY-SECOND INNOVATIVE APPLICATIONS OF ARTIFICIAL INTELLIGENCE CONFERENCE AND THE TENTH AAAI SYMPOSIUM ON EDUCATIONAL ADVANCES IN ARTIFICIAL INTELLIGENCE, 2020, 34 : 13861 - 13862
  • [5] Java']Java decompiler diversity and its application to meta-decompilation
    Harrand, Nicolas
    Soto-Valero, Cesar
    Monperrus, Martin
    Baudry, Benoit
    JOURNAL OF SYSTEMS AND SOFTWARE, 2020, 168
  • [6] How effective are existing Java']Java API specifications for finding bugs during runtime verification?
    Legunsen, Owolabi
    Al Awar, Nader
    Xu, Xinyue
    Ul Hassan, Wajih
    Rosu, Grigore
    Marinov, Darko
    AUTOMATED SOFTWARE ENGINEERING, 2019, 26 (04) : 795 - 837
  • [7] GITBUG-JAVA']JAVA: A Reproducible Benchmark of Recent Java']Java Bugs
    Silva, Andre
    Saavedra, Nuno
    Monperrus, Martin
    2024 IEEE/ACM 21ST INTERNATIONAL CONFERENCE ON MINING SOFTWARE REPOSITORIES, MSR, 2024, : 118 - 122
  • [8] Understanding Java']Java
    Currie, CC
    SOCIETY FOR TECHNICAL COMMUNICATION 44TH ANNUAL CONFERENCE, 1997 PROCEEDINGS, 1997, : 356 - 359
  • [9] Locating bugs in Java']Java programs - First results of the Java']Java diagnosis experiments project
    Mateis, C
    Stumptner, M
    Wotawa, F
    INTELLIGENT PROBLEM SOLVING: METHODOLOGIES AND APPROACHES, PRODEEDINGS, 2000, 1821 : 174 - 183
  • [10] GitBug-Java: A Reproducible Benchmark of Recent Java Bugs
    Silva, André
    Saavedra, Nuno
    Monperrus, Martin
    arXiv,