Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In JUnit tests, J9 said can not find the definition of class which is actually found in previous tests? #9336

Closed
fuzzy000 opened this issue Apr 23, 2020 · 0 comments · Fixed by #9660

Comments

@fuzzy000
Copy link

Java -version output

The issue happened in following versions:

openjdk version "1.8.0_232"
OpenJDK Runtime Environment (build 1.8.0_232-b09)
Eclipse OpenJ9 VM (build openj9-0.17.0, JRE 1.8.0 Linux amd64-64-Bit Compressed References 20191017_442 (JIT enabled, AOT enabled)
OpenJ9   - 77c1cf708
OMR      - 20db4fbc
JCL      - 97b5ec8f383 based on jdk8u232-b09)
openjdk version "9.0.4-adoptopenjdk"
OpenJDK Runtime Environment (build 9.0.4-adoptopenjdk+12)
Eclipse OpenJ9 VM (build openj9-0.9.0, JRE 9 Linux amd64-64-Bit Compressed References 20180814_248 (JIT enabled, AOT enabled)
OpenJ9   - 24e53631
OMR      - fad6bf6e
JCL      - feec4d2ae based on jdk-9.0.4+12)
openjdk version "11.0.5" 2019-10-15
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.5+10)
Eclipse OpenJ9 VM AdoptOpenJDK (build openj9-0.17.0, JRE 11 Linux amd64-64-Bit Compressed References 20191016_358 (JIT enabled, AOT enabled)
OpenJ9   - 77c1cf708
OMR      - 20db4fbc
JCL      - 2a7af5674b based on jdk-11.0.5+10)

Summary of problem

We made some changes to a class file in the Apache Ant project (org.apache.tools.ant.launch.Locator), and let several JVMs use JUnit to run the corresponding test file (org.apache.tools.ant.launch.LocatorTest). Among all 8 tests in that test class, OpenJDK series report VerifyError for each test, while J9 series report VerifyError for the first test and NoClassDefFoundError for the other 7 tests.

It is obvious that the class org.apache.tools.ant.launch.Locator is invalid (can not pass the verification). All errors reported by J9 and OpenJDK are from the lines which call the static function of org.apache.tools.ant.launch.Locator. What is weird is that, for the first test J9 report VerifyError (which means J9 already successfully loaded the Locator class, at least found the class definition), but for other tests, J9 said it can not find the class definition of Locator, throwing a NoClassDefFoundError. Is that a defect or something?

In my view, the expected behavior for J9 is to report Verify error for each test here, since each JUnit test is independent, there is no reason to throw different errors for the same issue.

Diagnostic files

Verify4.zip

  1. Extract it.
  2. In directory Verify4, run command java -cp sootOutput/junit-ant/:hamcrest-core-1.3.jar:junit-4.12.jar org.junit.runner.JUnitCore org.apache.tools.ant.launch.LocatorTest

Execution environment

  • 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants