JDK-8254104 : MethodCounters must exist before nmethod is installed
Type:Bug
Component:hotspot
Sub-Component:compiler
Affected Version:11,16
Priority:P2
Status:Closed
Resolution:Fixed
Submitted:2020-10-07
Updated:2021-02-05
Resolved:2020-10-08
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.
Seems like I might have broken one of the Graal tests. It doesn't seem to be switching to an OSR method for some reason.
Comments
Fix request (11u)
I would like to downport this for parity with 11.0.10-oracle.
I'll bring this to 11.0.11, I think it is not critical enough for
jdk11u.
I had to adapt the change:
http://mail.openjdk.java.net/pipermail/jdk-updates-dev/2020-December/004478.html
ILW = OSR compilation not triggered, regression from JDK-8253118, no workaround = MHH = P2
07-10-2020
The root cause of the problem (which has always been there but had been exposed by JDK-8253118) is that the process of nmethod installation does not check if MethodCounters exist. If a method doesn't have the counters structure it causes problem for the compilation policy.
07-10-2020
[2020-10-07T00:18:07,250Z] java.lang.AssertionError: Unexpected exception expected null, but was:<java.lang.Error: Must be part of compiled code>
[2020-10-07T00:18:07,250Z] at org.junit.Assert.fail(Assert.java:88)
[2020-10-07T00:18:07,250Z] at org.junit.Assert.failNotNull(Assert.java:755)
[2020-10-07T00:18:07,250Z] at org.junit.Assert.assertNull(Assert.java:737)
[2020-10-07T00:18:07,250Z] at org.graalvm.compiler.hotspot.test.GraalOSRTestBase.checkResult(GraalOSRTestBase.java:126)
[2020-10-07T00:18:07,250Z] at org.graalvm.compiler.hotspot.test.GraalOSRTestBase.testOSR(GraalOSRTestBase.java:74)
[2020-10-07T00:18:07,250Z] at org.graalvm.compiler.hotspot.test.GraalOSRTestBase.testOSR(GraalOSRTestBase.java:66)
[2020-10-07T00:18:07,250Z] at org.graalvm.compiler.hotspot.test.GraalOSRTestBase.testOSR(GraalOSRTestBase.java:61)
[2020-10-07T00:18:07,250Z] at org.graalvm.compiler.hotspot.test.GraalOSRLockTest.lambda$testLockOSRRecursive$11(GraalOSRLockTest.java:337)
[2020-10-07T00:18:07,250Z] at org.graalvm.compiler.hotspot.test.GraalOSRLockTest.run(GraalOSRLockTest.java:119)
[2020-10-07T00:18:07,250Z] at org.graalvm.compiler.hotspot.test.GraalOSRLockTest.testLockOSRRecursive(GraalOSRLockTest.java:325)
[2020-10-07T00:18:07,250Z] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[2020-10-07T00:18:07,250Z] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[2020-10-07T00:18:07,250Z] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[2020-10-07T00:18:07,251Z] at java.base/java.lang.reflect.Method.invoke(Method.java:566)
[2020-10-07T00:18:07,251Z] at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
[2020-10-07T00:18:07,251Z] at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
[2020-10-07T00:18:07,251Z] at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
[2020-10-07T00:18:07,251Z] at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
[2020-10-07T00:18:07,251Z] at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
[2020-10-07T00:18:07,252Z] at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
[2020-10-07T00:18:07,252Z] at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
[2020-10-07T00:18:07,252Z] at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
[2020-10-07T00:18:07,252Z] at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
[2020-10-07T00:18:07,252Z] at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
[2020-10-07T00:18:07,252Z] at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
[2020-10-07T00:18:07,252Z] at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
[2020-10-07T00:18:07,252Z] at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
[2020-10-07T00:18:07,252Z] at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
[2020-10-07T00:18:07,252Z] at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
[2020-10-07T00:18:07,253Z] at org.junit.runners.Suite.runChild(Suite.java:128)
[2020-10-07T00:18:07,253Z] at org.junit.runners.Suite.runChild(Suite.java:27)
[2020-10-07T00:18:07,253Z] at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
[2020-10-07T00:18:07,253Z] at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
[2020-10-07T00:18:07,253Z] at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
[2020-10-07T00:18:07,253Z] at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
[2020-10-07T00:18:07,253Z] at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
[2020-10-07T00:18:07,253Z] at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
[2020-10-07T00:18:07,253Z] at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
[2020-10-07T00:18:07,253Z] at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
[2020-10-07T00:18:07,254Z] at com.oracle.mxtool.junit.MxJUnitWrapper.runRequest(MxJUnitWrapper.java:280)
[2020-10-07T00:18:07,254Z] at com.oracle.mxtool.junit.MxJUnitWrapper.main(MxJUnitWrapper.java:196)