JDK-8234923 : Missed call_site_target nmethod dependency for non-fully initialized ConstantCallSite instance
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 14
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2019-11-27
  • Updated: 2020-05-28
  • Resolved: 2019-12-03
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 14
14 b26Fixed
Related Reports
Relates :  
Relates :  
Description
Test failed java/lang/invoke/CallSiteTest.java

----------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:131)
	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

Comments
After discussing with [~eosterlund] and [~dholmes], it seems like there needs to be a LoadLoad or acquire barrier between the read of isFrozen and the read of target. The thread-state transition VM_ENTRY_MARK in is_fully_initialized_constant_call_site seems to be the only thing saving us.
28-05-2020

URL: https://hg.openjdk.java.net/jdk/jdk/rev/138b0f3fe18c User: vlivanov Date: 2019-12-03 17:14:06 +0000
03-12-2019

[~vlivanov]: Possibly related to JDK-8234401 or JDK-8234403.
27-11-2019