JDK-8242352 : openjdk1.8.0_232 did not report ClassFormatError when class name is illegal
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: openjdk8u232
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: linux
  • CPU: x86_64
  • Submitted: 2020-04-07
  • Updated: 2020-04-13
  • Resolved: 2020-04-13
Related Reports
Duplicate :  
Description
ADDITIONAL SYSTEM INFORMATION :
openjdk version "1.8.0_232"
OpenJDK Runtime Environment (build 1.8.0_232-b09)
OpenJDK 64-Bit Server VM (build 25.232-b09, mixed mode)

OS and version: Ubuntu 16.04.6 LTS
CPU model: Intel(R) Xeon(R) CPU E5-4610 v4 @ 1.80GHz
Number of CPU cores: 4CPUs, each has 10 cores
Size of physical memory: 16384 MB * 20
Inside Linux container? No

A DESCRIPTION OF THE PROBLEM :
We are doing fuzz testing on JVMs. We generated a class file with an illegal class name "L...LLLorg/apache/tools/ant/launch/Launcher;;;...;"(... indicates there are lots of L and ;) in the constant pool. According to ����4.2.1 and ����4.2.2 of The Java Language Specification, Java SE 8 Edition, it is an illegal class name. But openjdk1.8.0_232 can run it successfully while OpenJ9(1.8.0_232) openjdk9.0.4 and openjdk11.0.5 throw a ClassFormatError.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Downloadand extract it.
2. In "ant" directory, run command "java -cp ant-launcher/ org.apache.tools.ant.launch.Launcher compile jar run"

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Throw a ClassFormatError because of the illegal class name.
ACTUAL -
Run it with no error or exception.

---------- BEGIN SOURCE ----------
The class file is in, the file path is "ant-launcher/org/apache/tools/ant/launch/Launcher.class".
---------- END SOURCE ----------

FREQUENCY : always



Comments
Test Result =========== 8u232:run with no exception:Fail 8u242:run with no exception:Fail 9.0.3: java.lang.ClassFormatError: Illegal class name:Pass build 9+181:java.lang.ClassFormatError: Illegal class name:Pass build 13+33:java.lang.ClassFormatError: Illegal class name:Pass build 14+36: java.lang.ClassFormatError: Illegal class name:Pass build 15ea15: java.lang.ClassFormatError: Illegal class name:Pass =================
10-04-2020