JDK-8236647 : java/lang/invoke/CallSiteTest.java failed with InvocationTargetException in Graal mode
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 11,14,15
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2020-01-03
  • Updated: 2024-10-17
  • Resolved: 2020-06-16
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11 JDK 15 JDK 16
11.0.9-oracleFixed 15 b28Fixed 16Fixed
Related Reports
Relates :  
Relates :  
Description
Test java/lang/invoke/CallSiteTest.java failed with

----------System.err:(35/2261)----------
patching test/java/lang/invoke/CallSiteTest.runMutableCallSite()I
11:invokestatic 162 INDY_mcs()L;...; 18:invokevirtual 166 => invokedynamic 261:InvokeDynamic[0, 259]
patching test/java/lang/invoke/CallSiteTest.runVolatileCallSite()I
11:invokestatic 169 INDY_vcs()L;...; 18:invokevirtual 166 => invokedynamic 262:InvokeDynamic[1, 259]
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
	at indify.Indify.run(Indify.java:130)
	at indify.Indify.main(Indify.java:106)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:564)
	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
	at java.base/java.lang.Thread.run(Thread.java:832)
Caused by: java.lang.reflect.InvocationTargetException
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:564)
	at indify.Indify.runApplication(Indify.java:158)
	at indify.Indify.run(Indify.java:127)
	... 7 more
Caused by: java.lang.AssertionError: should not throw
	at test.java.lang.invoke.CallSiteTest.test(CallSiteTest.java:88)
	at test.java.lang.invoke.CallSiteTest.testConstantCallSite(CallSiteTest.java:132)
	at test.java.lang.invoke.CallSiteTest.main(CallSiteTest.java:68)
	... 13 more
Caused by: java.lang.IllegalStateException: uninitialized call site
	at java.base/java.lang.invoke.CallSite.uninitializedCallSite(CallSite.java:261)
	at test.java.lang.invoke.CallSiteTest.test(CallSiteTest.java:82)
	... 15 more

JavaTest Message: Test threw exception: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
JavaTest Message: shutting down test

STATUS:Failed.`main' threw exception: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException

when running in Graal as JIT mode.

The issue seems is intermittent, for me the test failed on 12th iteration.

Comments
Changeset: d16ea55b Author: Bob Vandette <bobv@openjdk.org> Date: 2020-06-29 15:25:16 +0000 URL: https://git.openjdk.java.net/mobile/commit/d16ea55b
02-07-2020

Changeset: 02cec347 Author: Dean Long <dlong@openjdk.org> Date: 2020-06-15 17:17:28 +0000 URL: https://git.openjdk.java.net/lanai/commit/02cec347
02-07-2020

Changeset: 02cec347 Author: Dean Long <dlong@openjdk.org> Date: 2020-06-15 17:17:28 +0000 URL: https://git.openjdk.java.net/panama-foreign/commit/02cec347
02-07-2020

Changeset: 02cec347 Author: Dean Long <dlong@openjdk.org> Date: 2020-06-15 17:17:28 +0000 URL: https://git.openjdk.java.net/amber/commit/02cec347
02-07-2020

A fix to correct this change was pushed into JDK15 with wrong bug id JDK-8236647. The bug number should have been JDK-8248410. https://hg.openjdk.java.net/jdk/jdk15/rev/c7159850c3e9 Note, both backports to JDK 11u and 16 have correct id: 8248410.
29-06-2020

[~vlivanov] Do you think this needs to be backported to 11 or any other releases?
16-06-2020

URL: https://hg.openjdk.java.net/jdk/jdk15/rev/b9ec913f0afd User: dlong Date: 2020-06-16 00:21:00 +0000
16-06-2020

It can still fail with Graal, even with the Graal intrinsics disabled. I think ConstantCallSite may be missing some barriers.
28-05-2020

I can only reproduce this with -Xcomp. I think [~vlivanov] is right, I don't see support for the C1/C2 fix in Graal.
13-05-2020

Thank you Vladimir for the notes. Based on the comments, low likelihood of this case - for now editing ILW = HLM = P3.
07-01-2020

It looks like Graal has the same problem as C1/C2 which is fixed by JDK-8234923. Regarding ILW: it's not a regression in 14, but a long-standing bug with handling a corner case which went unnoticed for a long time. The failing test case was added by JDK-8234401.
06-01-2020

To reproduce run the test with "-Xmx512m -XX:MaxRAMPercentage=5 -ea -esa -server -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -XX:+UseJVMCICompiler -Djvmci.Compiler=graal -XX:+TieredCompilation" flags.
03-01-2020

This issue could be related to JDK-8234923 which has been fixed in b26. Perhaps the fix was incomplete.
03-01-2020