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

defineHiddenClass/BasicTest.java fails on JDK15 with multiple errors #10345

Closed
adamfarley opened this issue Aug 6, 2020 · 17 comments
Closed

Comments

@adamfarley
Copy link
Contributor

Test only seems to fail on OpenJ9 JDK15 builds, and has done since we started testing them at adopt.

Including several issues here, as I'm presuming they're connected in some way.

Try looking into the first issue, and if it doesn't solve the rest, let me know and I'll raise more.

Failure link

Test_openjdk15_j9_sanity.openjdk_aarch64_linux #6/jdk_lang_j9_0
Test_openjdk15_j9_sanity.openjdk_x86-64_mac #5/jdk_lang_j9_0
Test_openjdk15_j9_sanity.openjdk_x86-64_windows_xl #5/jdk_lang_j9_0
(All platforms checked saw this bug, but only on j9)

  • test category: OpenJDK
  • test target name: jdk_lang_j9
  • OS/architecture: all
  • public build SHAs (i.e. java -version output), in Grinder provides JDK_VERSION/JDK_IMPL info and helps identify point at which regression introduced:
22:18:14  openjdk version "15" 2020-09-15
22:18:14  OpenJDK Runtime Environment AdoptOpenJDK (build 15+34-202008052036)
22:18:14  Eclipse OpenJ9 VM AdoptOpenJDK (build master-3dfa298c5, JRE 15 Linux aarch64-64-Bit Compressed References 20200805_58 (JIT enabled, AOT enabled)
22:18:14  OpenJ9   - 3dfa298c5
22:18:14  OMR      - ff55081e9
22:18:14  JCL      - 2f93015b23 based on jdk-15+34)

Optional info

  • intermittent failure: no
  • regression or new test: old test, but it appears to have failed 100% of the time on JDK15 on openj9 since we started testing it at Adopt

Failure output (captured from console output)

[2020-08-05T21:24:02.110Z] test BasicTest.badClassFile([B@48f34e83): failure
[2020-08-05T21:24:02.110Z] java.lang.IllegalArgumentException
[2020-08-05T21:24:02.110Z] 	at java.base/jdk.internal.org.objectweb.asm.ClassReader.<init>(ClassReader.java:290)
[2020-08-05T21:24:02.110Z] 	at java.base/jdk.internal.org.objectweb.asm.ClassReader.<init>(ClassReader.java:208)
[2020-08-05T21:24:02.110Z] 	at java.base/jdk.internal.org.objectweb.asm.ClassReader.<init>(ClassReader.java:194)
[2020-08-05T21:24:02.110Z] 	at java.base/java.lang.invoke.MethodHandles$Lookup.defineHiddenClass(MethodHandles.java:2018)
[2020-08-05T21:24:02.110Z] 	at BasicTest.badClassFile(BasicTest.java:416)
...

and

[2020-08-05T21:24:02.111Z] java.lang.ClassFormatError: JVMCFRE149 Unknown constant tag 19 in class file; class=module-info, offset=68
[2020-08-05T21:24:02.111Z] 	at java.base/java.lang.ClassLoader.defineClassInternal(ClassLoader.java:515)
[2020-08-05T21:24:02.111Z] 	at java.base/java.lang.Access.defineClass(Access.java:336)
[2020-08-05T21:24:02.111Z] 	at java.base/java.lang.invoke.MethodHandles$Lookup$ClassDefiner$1.run(MethodHandles.java:1995)
[2020-08-05T21:24:02.111Z] 	at java.base/java.lang.invoke.MethodHandles$Lookup$ClassDefiner$1.run(MethodHandles.java:1990)
[2020-08-05T21:24:02.111Z] 	at java.base/java.security.AccessController.doPrivileged(AccessController.java:678)
[2020-08-05T21:24:02.111Z] 	at java.base/java.lang.invoke.MethodHandles$Lookup$ClassDefiner.defineClass(MethodHandles.java:1990)
[2020-08-05T21:24:02.111Z] 	at java.base/java.lang.invoke.MethodHandles$Lookup.defineHiddenClass(MethodHandles.java:2030)
[2020-08-05T21:24:02.111Z] 	at BasicTest.cantDefineModule(BasicTest.java:374)
...

and

[2020-08-05T21:24:02.111Z] Method BasicTest.failToDeriveAsHiddenClass(java.lang.String)[pri:0, instance:BasicTest@98f582e5] should have thrown an exception of type class java.lang.NoClassDefFoundError
[2020-08-05T21:24:02.111Z] 	at org.testng.internal.ExpectedExceptionsHolder.noException(ExpectedExceptionsHolder.java:89)
[2020-08-05T21:24:02.111Z] 	at org.testng.internal.Invoker.handleInvocationResults(Invoker.java:1384)
[2020-08-05T21:24:02.111Z] 	at org.testng.internal.Invoker.invokeMethod(Invoker.java:677)
[2020-08-05T21:24:02.111Z] 	at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:821)
[2020-08-05T21:24:02.111Z] 	at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1131)
[2020-08-05T21:24:02.111Z] 	at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
[2020-08-05T21:24:02.111Z] 	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:108)
[2020-08-05T21:24:02.111Z] 	at org.testng.TestRunner.privateRun(TestRunner.java:773)
[2020-08-05T21:24:02.111Z] 	at org.testng.TestRunner.run(TestRunner.java:623)
...

etc.

@hangshao0
Copy link
Contributor

hangshao0 commented Aug 6, 2020

Known issue. The hidden class implementation is not complete yet.

@hangshao0
Copy link
Contributor

Linking this to #9328

@adamfarley
Copy link
Contributor Author

PR created to exclude the tests until the JEP is complete.

adoptium/aqa-tests#1934

@JasonFengJ9
Copy link
Member

Adding other hidden class failures:

https://ci.eclipse.org/openj9/job/Test_openjdk15_j9_sanity.openjdk_ppc64_aix_Nightly/26/consoleFull

01:22:01  ===============================================
01:22:01  Running test jdk_lang_j9_0 ...
01:22:01  ===============================================
01:29:57  ACTION: testng -- Failed. Execution failed: `main' threw exception: java.lang.Exception: failures: 1
01:29:57  REASON: User specified action: run testng/othervm --enable-preview UnreflectTest 
01:29:57  TIME:   0.77 seconds
01:29:57  messages:
01:29:57  command: testng --enable-preview UnreflectTest
01:29:57  reason: User specified action: run testng/othervm --enable-preview UnreflectTest 
01:29:57  Mode: othervm [/othervm specified]
01:29:57  elapsed time (seconds): 0.77
01:29:57  configuration:
01:29:57  STDOUT:
01:29:57  [TestNG] Running:
01:29:57    java/lang/invoke/unreflect/UnreflectTest.java
01:29:57  
01:29:57  test UnreflectTest.testFieldsInHiddenClass(): failure
01:29:57  java.lang.AssertionError: should fail to unreflect a setter for FINAL expected [true] but found [false]
01:29:57  	at org.testng.Assert.fail(Assert.java:94)
01:29:57  	at org.testng.Assert.failNotEquals(Assert.java:496)
01:29:57  	at org.testng.Assert.assertTrue(Assert.java:42)
01:29:57  	at UnreflectTest.readOnlyAccessibleObject(UnreflectTest.java:130)
01:29:57  	at UnreflectTest.testFieldsInHiddenClass(UnreflectTest.java:89)
01:29:57  	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
01:29:57  	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
01:29:57  	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
01:29:57  	at java.base/java.lang.reflect.Method.invoke(Method.java:564)
01:29:57  	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:85)
01:29:57  	at org.testng.internal.Invoker.invokeMethod(Invoker.java:639)
01:29:57  	at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:821)
01:29:57  	at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1131)
01:29:57  	at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
01:29:57  	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:108)
01:29:57  	at org.testng.TestRunner.privateRun(TestRunner.java:773)
01:29:57  	at org.testng.TestRunner.run(TestRunner.java:623)
01:29:57  	at org.testng.SuiteRunner.runTest(SuiteRunner.java:357)
01:29:57  	at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:352)
01:29:57  	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:310)
01:29:57  	at org.testng.SuiteRunner.run(SuiteRunner.java:259)
01:29:57  	at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
01:29:57  	at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
01:29:57  	at org.testng.TestNG.runSuitesSequentially(TestNG.java:1185)
01:29:57  	at org.testng.TestNG.runSuitesLocally(TestNG.java:1110)
01:29:57  	at org.testng.TestNG.run(TestNG.java:1018)
01:29:57  	at com.sun.javatest.regtest.agent.TestNGRunner.main(TestNGRunner.java:94)
01:29:57  	at com.sun.javatest.regtest.agent.TestNGRunner.main(TestNGRunner.java:54)
01:29:57  	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
01:29:57  	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
01:29:57  	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
01:29:57  	at java.base/java.lang.reflect.Method.invoke(Method.java:564)
01:29:57  	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
01:29:57  	at java.base/java.lang.Thread.run(Thread.java:851)
01:29:57  test UnreflectTest.testFieldsInNormalClass(): success

@pshipton
Copy link
Member

Created adoptium/aqa-tests#1942 to un-exclude the testing.

@pshipton pshipton added this to the Release 0.22 (Java 15) milestone Aug 26, 2020
@hangshao0
Copy link
Contributor

LambdaNestedInnerTest.java is problematic. There is a test case in that file saying it is testing an exception to be thrown, but I don't see the code checking for that exception. RI does not throw an exception for that case either.

@smlambert
Copy link
Contributor

@pshipton - based on @hangshao0 comment above, do you still want to proceed with adoptium/aqa-tests#1942 or adjust it to keep LambdaNestedInnerTest excluded?

@pshipton
Copy link
Member

pshipton commented Aug 27, 2020

@smlambert I think we should still proceed with adoptium/aqa-tests#1942. We can confirm if LambdaNestedInnerTest.java passes on Hotspot or not, it looks to me like it does https://ci.adoptopenjdk.net/job/Test_openjdk15_hs_sanity.openjdk_x86-64_mac/26/testReport/java_lang_invoke_defineHiddenClass_LambdaNestedInnerTest/

Even if the test is problematic for OpenJ9 and we decide to exclude it, it can be excluded via another PR which details the reason for exclusion.

@hangshao0
Copy link
Contributor

PR to exclude BasicTest and TypeDescriptorTest:
adoptium/aqa-tests#1944

@tajila
Copy link
Contributor

tajila commented Sep 8, 2020

@hangshao0 What is the status of this issue?

@hangshao0
Copy link
Contributor

The only failure left in our build is LambdaNestedInnerTest, which is fixed by #10531. Once it is merged, we can either

  1. Close this issue and open another one to remind us that BasicTest and TypeDescriptorTest have been excluded, or
  2. Keep this issue open to keep track of BasicTest and TypeDescriptorTest, but remove the v0.22.0 tag.

@tajila
Copy link
Contributor

tajila commented Sep 8, 2020

Thanks for the update @hangshao0. Just to clarify, the issue with BasicTest and TypeDescriptorTest is that we are missing 0x in the hidden class name?

@hangshao0
Copy link
Contributor

Just to clarify, the issue with BasicTest and TypeDescriptorTest is that we are missing 0x in the hidden class name?

  1. We do not have 0x in the class name.
  2. We are using upper case of A to F if they appear in the rom address. RI is using lower case.

hangshao0 added a commit to hangshao0/openj9 that referenced this issue Sep 10, 2020
Return the host class as nesthost if a hidden class cannot find its 
nest host.

Do not rethrown any exception if a class cannot find its nesthost 
in java 15 and up.

issue eclipse-openj9#10345

Signed-off-by: Hang Shao <hangshao@ca.ibm.com>
hangshao0 added a commit to hangshao0/openj9 that referenced this issue Sep 10, 2020
Return the host class as nesthost if a hidden class cannot find its 
nest host.

Do not rethrown any exception if a class cannot find its nesthost 
in java 15 and up.

issue eclipse-openj9#10345

Signed-off-by: Hang Shao <hangshao@ca.ibm.com>
@DanHeidinga
Copy link
Member

Moving this out of the 0.22.0 release and into 0.23.0 as I believe the last change for it went into 0.23.

@tajila can you confirm this is completely fixed now?

@tajila
Copy link
Contributor

tajila commented Sep 15, 2020

Yes, I've confirmed that those tests are passing, https://ci.adoptopenjdk.net/view/Test_grinder/job/Grinder/3884/testReport/

@tajila
Copy link
Contributor

tajila commented Sep 15, 2020

Test excludes are being removed, adoptium/aqa-tests#1960

@pshipton
Copy link
Member

There are still tests excluded under this issue on jdk16, which is out of support, but not on subsequent versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants