Openj9: JDK16 java/lang/invoke/lambda/superProtectedMethod/InheritedProtectedMethod.java IllegalAccessError: illegally accessing "package private" member of class java/lang/invoke/MethodHandles

Created on 3 Dec 2020  路  8Comments  路  Source: eclipse/openj9

Failure link

From an internal build Test_openjdknext_j9_sanity.openjdk_ppc64_aix_Nightly/286:

22:14:14  openjdk version "16-internal" 2021-03-16
22:14:14  OpenJDK Runtime Environment (build 16-internal+0-adhoc.jenkins.BuildJDKnextppc64aixNightly)
22:14:14  Eclipse OpenJ9 VM (build master-9f11871a18a, JRE 16 AIX ppc64-64-Bit Compressed References 20201202_402 (JIT enabled, AOT enabled)
22:14:14  OpenJ9   - 9f11871a18a
22:14:14  OMR      - a58cd2f5687
22:14:14  JCL      - f7021059fd3 based on jdk-16+26)

To rebuild the failed tests in =https://hyc-runtimes-jenkins.swg-devops.com/job/Grinder, use the following links:
23:51:29 https://hyc-runtimes-jenkins.swg-devops.com/job/Grinder/parambuild/?JDK_VERSION=16&JDK_IMPL=openj9&BUILD_LIST=openjdk&PLATFORM=ppc64_aix&TARGET=jdk_lang_j9_0

Optional info

Failure output (captured from console output)

22:25:38  TEST: java/lang/invoke/lambda/superProtectedMethod/InheritedProtectedMethod.java
22:25:38  java.lang.reflect.InvocationTargetException
22:25:38    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
22:25:38    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78)
22:25:38    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
22:25:38    at java.base/java.lang.reflect.Method.invoke(Method.java:567)
22:25:38    at InheritedProtectedMethod.run(InheritedProtectedMethod.java:73)
22:25:38    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
22:25:38    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78)
22:25:38    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
22:25:38    at java.base/java.lang.reflect.Method.invoke(Method.java:567)
22:25:38    at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:85)
22:25:38    at org.testng.internal.Invoker.invokeMethod(Invoker.java:639)
22:25:38    at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:821)
22:25:38    at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1131)
22:25:38    at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
22:25:38    at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:108)
22:25:38    at org.testng.TestRunner.privateRun(TestRunner.java:773)
22:25:38    at org.testng.TestRunner.run(TestRunner.java:623)
22:25:38    at org.testng.SuiteRunner.runTest(SuiteRunner.java:357)
22:25:38    at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:352)
22:25:38    at org.testng.SuiteRunner.privateRun(SuiteRunner.java:310)
22:25:38    at org.testng.SuiteRunner.run(SuiteRunner.java:259)
22:25:38    at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
22:25:38    at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
22:25:38    at org.testng.TestNG.runSuitesSequentially(TestNG.java:1185)
22:25:38    at org.testng.TestNG.runSuitesLocally(TestNG.java:1110)
22:25:38    at org.testng.TestNG.run(TestNG.java:1018)
22:25:38    at com.sun.javatest.regtest.agent.TestNGRunner.main(TestNGRunner.java:94)
22:25:38    at com.sun.javatest.regtest.agent.TestNGRunner.main(TestNGRunner.java:54)
22:25:38    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
22:25:38    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78)
22:25:38    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
22:25:38    at java.base/java.lang.reflect.Method.invoke(Method.java:567)
22:25:38    at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
22:25:38    at java.base/java.lang.Thread.run(Thread.java:853)
22:25:38  Caused by: java.lang.IllegalAccessError: Class MethodInvoker$$Lambda$211/0x000000002299d708 illegally accessing "package private" member of class java/lang/invoke/MethodHandles
22:25:38    at java.base/java.lang.invoke.MethodHandleResolver.getCPMethodHandleAt(Native Method)
22:25:38    at java.base/java.lang.invoke.MethodHandleResolver.resolveConstantDynamic(MethodHandleResolver.java:106)
22:25:38    at MethodInvoker$$Lambda$211/0x000000002299d708.invokeMethodReference(Unknown Source)
22:25:38    at MethodInvoker.invoke(MethodInvoker.java:29)
22:25:38    ... 34 more
22:25:38  
22:25:38  ===============================================
22:25:38  java/lang/invoke/lambda/superProtectedMethod/InheritedProtectedMethod.java
22:25:38  Total tests run: 1, Failures: 1, Skips: 0
22:25:38  ===============================================

jdk_lang_j9_0_FAILED
vm jdk16 MH test excluded test failure

Most helpful comment

Thanks for the investigation @sharon-wang

All 8 comments

@tajila fyi

@sharon-wang can you please take a look at this?

Yep! Taking a look

Added some custom error messages in my personal build to find out that the "package private" member being accessed here is MethodHandles.classData.

From https://github.com/eclipse/openj9/issues/11366#issuecomment-738940000, it seems that this issue will be alleviated by changes from the ongoing JSR 292 Work. Upon adding modifier public to the definition of MethodHandles.classData, this failure is no longer seen, which is also mentioned in this comment.

FYI @babsingh.

Thanks for the investigation @sharon-wang

Created a PR to exclude the tests in question at https://github.com/AdoptOpenJDK/openjdk-tests/pull/2168.

Fixed by #11699. @JasonFengJ9 This issue can be closed.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

AdamBrousseau picture AdamBrousseau  路  6Comments

DanHeidinga picture DanHeidinga  路  4Comments

ciplogic picture ciplogic  路  3Comments

JasonFengJ9 picture JasonFengJ9  路  3Comments

0xdaryl picture 0xdaryl  路  3Comments