SafeCheck: Safety Enhancement of Java Unsafe API
Title | SafeCheck: Safety Enhancement of Java Unsafe API |
Publication Type | Conference Paper |
Year of Publication | 2019 |
Authors | Huang, Shiyou, Guo, Jianmei, Li, Sanhong, Li, Xiang, Qi, Yumin, Chow, Kingsum, Huang, Jeff |
Conference Name | 2019 IEEE/ACM 41st International Conference on Software Engineering (ICSE) |
Date Published | May 2019 |
Publisher | IEEE |
ISBN Number | 978-1-7281-0869-8 |
Keywords | application program interfaces, bytecode, bytecode verification, Collaboration, Computer bugs, dynamic analysis, Human Behavior, human factors, Java, Java core library, Java runtime, Java unsafe API, JVM crash, Libraries, low- level system code, Memoey Safety, memory checker, Memory Protection, memory safety, Metrics, openJDK bug system, policy-based governance, program debugging, programming language, pubcrawl, resilience, Resiliency, Runtime, Safe Coding, Safety, safety enhancement, security of data, storage management, Tools, unsafe crash patterns |
Abstract | Java is a safe programming language by providing bytecode verification and enforcing memory protection. For instance, programmers cannot directly access the memory but have to use object references. Yet, the Java runtime provides an Unsafe API as a backdoor for the developers to access the low- level system code. Whereas the Unsafe API is designed to be used by the Java core library, a growing community of third-party libraries use it to achieve high performance. The Unsafe API is powerful, but dangerous, which leads to data corruption, resource leaks and difficult-to-diagnose JVM crash if used improperly. In this work, we study the Unsafe crash patterns and propose a memory checker to enforce memory safety, thus avoiding the JVM crash caused by the misuse of the Unsafe API at the bytecode level. We evaluate our technique on real crash cases from the openJDK bug system and real-world applications from AJDK. Our tool reduces the efforts from several days to a few minutes for the developers to diagnose the Unsafe related crashes. We also evaluate the runtime overhead of our tool on projects using intensive Unsafe operations, and the result shows that our tool causes a negligible perturbation to the execution of the applications. |
URL | https://ieeexplore.ieee.org/document/8811920 |
DOI | 10.1109/ICSE.2019.00095 |
Citation Key | huang_safecheck_2019 |
- Resiliency
- memory safety
- Metrics
- openJDK bug system
- policy-based governance
- program debugging
- Programming Language
- pubcrawl
- resilience
- Memory Protection
- Runtime
- Safe Coding
- Safety
- safety enhancement
- security of data
- storage management
- tools
- unsafe crash patterns
- Java core library
- bytecode
- bytecode verification
- collaboration
- Computer bugs
- dynamic analysis
- Human behavior
- Human Factors
- Java
- application program interfaces
- Java runtime
- Java unsafe API
- JVM crash
- Libraries
- low- level system code
- Memoey Safety
- memory checker