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

OpenJDK 21 java/lang/invoke/defineHiddenClass/BasicTest BasicTest.hasInnerClassesOrEnclosingMethodAttribute NoClassDefFoundError: Outer #17725

Closed
pshipton opened this issue Jun 30, 2023 · 10 comments · Fixed by #17766

Comments

@pshipton
Copy link
Member

Failing everywhere https://openj9-jenkins.osuosl.org/job/Pipeline-OpenJDK21-Acceptance/3/

https://openj9-jenkins.osuosl.org/job/Test_openjdk21_j9_sanity.openjdk_aarch64_linux_OpenJDK21_testList_0/1/
java/lang/invoke/defineHiddenClass/BasicTest.java

23:56:13  test BasicTest.hasInnerClassesOrEnclosingMethodAttribute("Outer$Inner", "Outer"): failure
23:56:13  java.lang.NoClassDefFoundError: Outer
23:56:13  	at java.base/java.lang.Class.getDeclaringClassImpl(Native Method)
23:56:13  	at java.base/java.lang.Class.getDeclaringClass(Class.java:1249)
23:56:13  	at java.base/java.lang.Class.isUnnamedClass(Class.java:5096)
23:56:13  	at java.base/java.lang.Class.getCanonicalName(Class.java:3726)
23:56:13  	at BasicTest.hiddenClassWithBadAttribute(BasicTest.java:457)
23:56:13  	at BasicTest.hasInnerClassesOrEnclosingMethodAttribute(BasicTest.java:433)

Changes a52a0b8...cb8f7a3

@pshipton
Copy link
Member Author

@tajila @hangshao0 fyi, I expect this is caused by #17710

@pshipton
Copy link
Member Author

pshipton commented Jun 30, 2023

I tried a grinder on the head stream and it passed.
https://openj9-jenkins.osuosl.org/view/Test/job/Grinder/2551/

Maybe it's related to the jdk21 changes in the acceptance build
ibmruntimes/openj9-openjdk-jdk21@5b63a9e...74bc2cc

@pshipton
Copy link
Member Author

Sorry, ignore the previous comment. That was a useless grinder because the test didn't fail in the nightly build. I need to re-build the head stream JVM since it doesn't contain #17710

@pshipton
Copy link
Member Author

Failed a grinder on a updated head stream build, which includes #17710, but not the jdk21 updates.
This problem is NOT related to the new jdk21 changes (I will promote them).
I expect this is caused by #17710

@hangshao0
Copy link
Contributor

I will look at this.

@hangshao0
Copy link
Contributor

Unnamed class is for JEP 445 which is a preview feature of Java 21. Will try running this test specifying --enable-preview on RI.

@pshipton
Copy link
Member Author

pshipton commented Jul 6, 2023

It would be nice to have this fixed, or exclude the test since it's failing on every platform in every build.

pshipton added a commit to pshipton/openjdk-tests that referenced this issue Jul 6, 2023
Issue eclipse-openj9/openj9#17725

Signed-off-by: Peter Shipton <Peter_Shipton@ca.ibm.com>
@pshipton
Copy link
Member Author

pshipton commented Jul 6, 2023

Created adoptium/aqa-tests#4661 to exclude the test.

smlambert pushed a commit to adoptium/aqa-tests that referenced this issue Jul 6, 2023
@hangshao0
Copy link
Contributor

RI is able to pass this test with --enable-preview.

However, if I modify the test case to explicitly call getDeclaringClass(), RI also failed on the same error:
java.lang.NoClassDefFoundError: Outer

For Class.isUnnamedClass(), the documentation says:
The Class object representing an unnamed class is top-level, synthetic, and final.

The call of getDeclaringClass() is part of top-level class check. I believe RI is doing these checks in a different order than the documentation (i.e. RI is not checking top-level first). The condition is already false before reaching the call of getDeclaringClass() in this case.

hangshao0 added a commit to hangshao0/openj9 that referenced this issue Jul 11, 2023
Change the order of the checks to do modifier check first

Closes eclipse-openj9#17725

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

@TobiAjila @hangshao0 when an issue with the test excluded label is closed and the test is re-enabled, pls remove the test excluded label once unexcluding the test has been confirmed.

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.

2 participants