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

JTReg Test Failure: java/lang/reflect/Proxy/ProxyForMethodHandle.java #7741

Closed
M-Davies opened this issue Nov 11, 2019 · 11 comments · Fixed by #12716
Closed

JTReg Test Failure: java/lang/reflect/Proxy/ProxyForMethodHandle.java #7741

M-Davies opened this issue Nov 11, 2019 · 11 comments · Fixed by #12716
Assignees
Labels
comp:vm project:MH Used to track Method Handles related work test failure

Comments

@M-Davies
Copy link

Failure link

https://github.com/ibmruntimes/openj9-openjdk-jdk11/blob/5961cb4f17facbc7824e7550ca475916ebe93f38/test/jdk/java/lang/reflect/Proxy/ProxyForMethodHandle.java#L1 and https://github.com/ibmruntimes/openj9-openjdk-jdk13/blob/5555cfa6ef8926f0c30ea9fe14aa41c9e7b3cd96/test/jdk/java/lang/reflect/Proxy/ProxyForMethodHandle.java#L1 consistantly fail for JDK11/13-openj9

  • test category, openjdk
  • OS/architecture, openjdk_x86-64_linux, openjdk_x86-64_windows, openjdk_x86-64_mac

Optional info

Failure output (captured from console output)

JDK11
16:08:37  Eclipse OpenJ9 VM AdoptOpenJDK (build master-59fcbec6f, JRE 11 Linux amd64-64-Bit Compressed References 20191108_360 (JIT enabled, AOT enabled)
16:08:37  OpenJ9   - 59fcbec6f
16:08:37  OMR      - d8a74ca74
16:08:37  JCL      - e7da16be04 based on jdk-11.0.5+10)

16:10:56  STDOUT:
16:10:56  [TestNG] Running:
16:10:56    java/lang/reflect/Proxy/ProxyForMethodHandle.java
16:10:56  
16:10:56  test ProxyForMethodHandle.testRunnableMethodHandle(): failure
16:10:56  java.lang.InternalError: java.lang.IllegalAccessException: Caller-sensitive method cannot be looked up using a restricted lookup object
16:10:56  	at java.base/java.lang.invoke.MethodHandleImpl$BindCaller.<clinit>(MethodHandleImpl.java:1284)
16:10:56  	at java.base/java.lang.invoke.MethodHandleImpl.bindCaller(MethodHandleImpl.java:1190)
16:10:56  	at java.base/java.lang.invoke.MethodHandleProxies.bindCaller(MethodHandleProxies.java:230)
16:10:56  	at java.base/java.lang.invoke.MethodHandleProxies.asInterfaceInstance(MethodHandleProxies.java:164)
16:10:56  	at ProxyForMethodHandle.testRunnableMethodHandle(ProxyForMethodHandle.java:52)
16:10:56  	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
16:10:56  	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
16:10:56  	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
16:10:56  	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
16:10:56  	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:85)
16:10:56  	at org.testng.internal.Invoker.invokeMethod(Invoker.java:639)
16:10:56  	at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:821)
16:10:56  	at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1131)
16:10:56  	at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
16:10:56  	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:108)
16:10:56  	at org.testng.TestRunner.privateRun(TestRunner.java:773)
16:10:56  	at org.testng.TestRunner.run(TestRunner.java:623)
16:10:56  	at org.testng.SuiteRunner.runTest(SuiteRunner.java:357)
16:10:56  	at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:352)
16:10:56  	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:310)
16:10:56  	at org.testng.SuiteRunner.run(SuiteRunner.java:259)
16:10:56  	at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
16:10:56  	at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
16:10:56  	at org.testng.TestNG.runSuitesSequentially(TestNG.java:1185)
16:10:56  	at org.testng.TestNG.runSuitesLocally(TestNG.java:1110)
16:10:56  	at org.testng.TestNG.run(TestNG.java:1018)
16:10:56  	at com.sun.javatest.regtest.agent.TestNGRunner.main(TestNGRunner.java:94)
16:10:56  	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
16:10:56  	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
16:10:56  	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
16:10:56  	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
16:10:56  	at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:298)
16:10:56  	at java.base/java.lang.Thread.run(Thread.java:832)

JDK13
16:08:15  OpenJDK Runtime Environment AdoptOpenJDK (build 13.0.1+9-201911081205)
16:08:15  Eclipse OpenJ9 VM AdoptOpenJDK (build master-59fcbec6f, JRE 13 Linux amd64-64-Bit Compressed References 20191108_98 (JIT enabled, AOT enabled)
16:08:15  OpenJ9   - 59fcbec6f
16:08:15  OMR      - d8a74ca74
16:08:15  JCL      - 12bdd06298 based on jdk-13.0.1+9)

16:10:26  STDOUT:
16:10:26  [TestNG] Running:
16:10:26    java/lang/reflect/Proxy/ProxyForMethodHandle.java
16:10:26  
16:10:26  test ProxyForMethodHandle.testRunnableMethodHandle(): failure
16:10:26  java.lang.InternalError: java.lang.IllegalAccessException: Caller-sensitive method cannot be looked up using a restricted lookup object
16:10:26  	at java.base/java.lang.invoke.MethodHandleImpl$BindCaller.<clinit>(MethodHandleImpl.java:1236)
16:10:26  	at java.base/java.lang.invoke.MethodHandleImpl.bindCaller(MethodHandleImpl.java:1142)
16:10:26  	at java.base/java.lang.invoke.MethodHandleProxies.bindCaller(MethodHandleProxies.java:230)
16:10:26  	at java.base/java.lang.invoke.MethodHandleProxies.asInterfaceInstance(MethodHandleProxies.java:164)
16:10:26  	at ProxyForMethodHandle.testRunnableMethodHandle(ProxyForMethodHandle.java:52)
16:10:26  	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
16:10:26  	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
16:10:26  	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
16:10:26  	at java.base/java.lang.reflect.Method.invoke(Method.java:567)
16:10:26  	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:85)
16:10:26  	at org.testng.internal.Invoker.invokeMethod(Invoker.java:639)
16:10:26  	at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:821)
16:10:26  	at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1131)
16:10:26  	at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
16:10:26  	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:108)
16:10:26  	at org.testng.TestRunner.privateRun(TestRunner.java:773)
16:10:26  	at org.testng.TestRunner.run(TestRunner.java:623)
16:10:26  	at org.testng.SuiteRunner.runTest(SuiteRunner.java:357)
16:10:26  	at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:352)
16:10:26  	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:310)
16:10:26  	at org.testng.SuiteRunner.run(SuiteRunner.java:259)
16:10:26  	at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
16:10:26  	at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
16:10:26  	at org.testng.TestNG.runSuitesSequentially(TestNG.java:1185)
16:10:26  	at org.testng.TestNG.runSuitesLocally(TestNG.java:1110)
16:10:26  	at org.testng.TestNG.run(TestNG.java:1018)
16:10:26  	at com.sun.javatest.regtest.agent.TestNGRunner.main(TestNGRunner.java:94)
16:10:26  	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
16:10:26  	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
16:10:26  	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
16:10:26  	at java.base/java.lang.reflect.Method.invoke(Method.java:567)
16:10:26  	at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:298)
16:10:26  	at java.base/java.lang.Thread.run(Thread.java:832)

Rerun JDK11 job: https://ci.adoptopenjdk.net/job/Grinder/parambuild/?JDK_VERSION=11&JDK_IMPL=openj9&BUILD_LIST=openjdk&JenkinsFile=openjdk_x86-64_linux&CUSTOM_TARGET=test/jdk/java/lang/reflect/Proxy/ProxyForMethodHandle.java&TARGET=jdk_custom_0

@tajila
Copy link
Contributor

tajila commented Jan 5, 2021

I ran a grinder on this, https://ci.adoptopenjdk.net/job/Grinder/5773/ and https://ci.adoptopenjdk.net/job/Grinder/5772/ show that this test is now passing.

@M-Davies I believe these tests can be included again

pshipton added a commit to pshipton/openjdk-tests that referenced this issue Jan 5, 2021
Issue eclipse-openj9/openj9#7741

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

pshipton commented Jan 5, 2021

@tajila your grinder isn't configured correctly and runs java/math/BigInteger/BigIntegerTest.java

I tried it myself using the last nightly build, but the test is still failing.
https://ci.eclipse.org/openj9/view/Test/job/Grinder/1333

13:57:07  java.lang.InternalError: java.lang.IllegalAccessException: Caller-sensitive method cannot be looked up using a restricted lookup object
13:57:07  	at java.base/java.lang.invoke.MethodHandleImpl$BindCaller.<clinit>(MethodHandleImpl.java:1284)
13:57:07  	at java.base/java.lang.invoke.MethodHandleImpl.bindCaller(MethodHandleImpl.java:1190)
13:57:07  	at java.base/java.lang.invoke.MethodHandleProxies.bindCaller(MethodHandleProxies.java:230)
13:57:07  	at java.base/java.lang.invoke.MethodHandleProxies.asInterfaceInstance(MethodHandleProxies.java:164)
13:57:07  	at ProxyForMethodHandle.testRunnableMethodHandle(ProxyForMethodHandle.java:52)

@tajila
Copy link
Contributor

tajila commented Jan 5, 2021

Thanks Peter, I used the rerun job link above. Ill continue to investigate this.

@tajila
Copy link
Contributor

tajila commented Jan 19, 2021

Will be addressed with new MH implementation

@tajila tajila added the project:MH Used to track Method Handles related work label Jan 19, 2021
@babsingh
Copy link
Contributor

fyi @tajila @fengxue-IS: With OJDK MHs, ProxyForMethodHandle.testRunnableMethodHandle() fails due to another error, which is shown below.

test ProxyForMethodHandle.testRunnableMethodHandle(): failure
java.lang.InternalError: java.lang.InternalError: found java.lang.invoke.LambdaForm$DMH/0x0000000000000000, expected java.lang.invoke.MethodHandleImpl$BindCaller
        at java.base/java.lang.invoke.MethodHandleImpl$BindCaller.<clinit>(MethodHandleImpl.java:1233)
        at java.base/java.lang.invoke.MethodHandleImpl.bindCaller(MethodHandleImpl.java:1126)
        at java.base/java.lang.invoke.MethodHandleProxies.bindCaller(MethodHandleProxies.java:229)
        at java.base/java.lang.invoke.MethodHandleProxies.asInterfaceInstance(MethodHandleProxies.java:163)
        at ProxyForMethodHandle.testRunnableMethodHandle(ProxyForMethodHandle.java:52)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:567)
        at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:85)
        at org.testng.internal.Invoker.invokeMethod(Invoker.java:639)
        at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:821)
        at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1131)
        at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
        at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:108)
        at org.testng.TestRunner.privateRun(TestRunner.java:773)
        at org.testng.TestRunner.run(TestRunner.java:623)
        at org.testng.SuiteRunner.runTest(SuiteRunner.java:357)
        at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:352)
        at org.testng.SuiteRunner.privateRun(SuiteRunner.java:310)
        at org.testng.SuiteRunner.run(SuiteRunner.java:259)
        at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
        at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
        at org.testng.TestNG.runSuitesSequentially(TestNG.java:1185)
        at org.testng.TestNG.runSuitesLocally(TestNG.java:1110)
        at org.testng.TestNG.run(TestNG.java:1018)
        at com.sun.javatest.regtest.agent.TestNGRunner.main(TestNGRunner.java:94)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:567)
        at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:298)
        at java.base/java.lang.Thread.run(Thread.java:853)
Caused by: java.lang.InternalError: found java.lang.invoke.LambdaForm$DMH/0x0000000000000000, expected java.lang.invoke.MethodHandleImpl$BindCaller
        at java.base/java.lang.invoke.MethodHandleImpl$BindCaller.checkCallerClass(MethodHandleImpl.java:1243)
        at java.base/java.lang.invoke.LambdaForm$DMH/0x0000000000000000.invokeStatic(LambdaForm$DMH)
        at java.base/java.lang.invoke.LambdaForm$MH/0x0000000000000000.invokeExact_MT(LambdaForm$MH)
        at java.base/java.lang.invoke.MethodHandleImpl$BindCaller.<clinit>(MethodHandleImpl.java:1231)
        ... 32 more

@babsingh
Copy link
Contributor

babsingh commented Mar 16, 2021

Update: As of 16 Mar 21, ProxyForMethodHandle passes with both OpenJ9 and OJDK MHs. I verified this using JDK16.

@M-Davies
Copy link
Author

Grinders are still failing for me on JDK11 and JDK16

@babsingh
Copy link
Contributor

Grinders are still failing for me on JDK11 and JDK16

I verified that the test passes by running it directly using jtreg on my local machine:

jtreg/bin/jtreg -jdk:$PWD/build/linux-x86_64-server-release/images/jdk -va test/jdk/java/lang/reflect/Proxy/ProxyForMethodHandle.java

With jtreg, the reference implementation and OpenJ9 have the same output where the test passes.

The grinders use the make framework:

make test TEST="java/lang/reflect/Proxy/ProxyForMethodHandle.java"

The test still fails with the make framework. Let's keep the issue unresolved until the above discrepancy is fixed.

@gacholio @tajila Can you confirm if the following PRs will fix this issue? #12148 and #12194

@gacholio
Copy link
Contributor

I see no reason the indicated PRs have anything to do with this issue.

fengxue-IS added a commit to fengxue-IS/aqa-tests that referenced this issue Feb 12, 2022
Fixed tests:
java/lang/reflect/Proxy/ProxyForMethodHandle.java
eclipse-openj9/openj9#7741

java/lang/invoke/MethodHandles/classData/ClassDataTest.java
eclipse-openj9/openj9#11366

Signed-off-by: Jack Lu <Jack.S.Lu@ibm.com>
@fengxue-IS
Copy link
Contributor

Verified this is fixed for Java 17/18, opened PR to re-enable testing. I got the same issue as Babneet during testing for Java11, maybe should revisit this once OJDK MH is enabled for Java 11

sophia-guo pushed a commit to adoptium/aqa-tests that referenced this issue Feb 14, 2022
Fixed tests:
java/lang/reflect/Proxy/ProxyForMethodHandle.java
eclipse-openj9/openj9#7741

java/lang/invoke/MethodHandles/classData/ClassDataTest.java
eclipse-openj9/openj9#11366

Signed-off-by: Jack Lu <Jack.S.Lu@ibm.com>
@babsingh
Copy link
Contributor

The test was re-enabled via adoptium/aqa-tests#3349.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:vm project:MH Used to track Method Handles related work test failure
Projects
None yet
6 participants