JDK-8298947 : compiler/codecache/MHIntrinsicAllocFailureTest.java fails intermittently
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 20
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2022-12-16
  • Updated: 2023-01-03
  • Resolved: 2022-12-20
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 17 JDK 20 JDK 21
17.0.7-oracleFixed 20 b29Fixed 21Fixed
Related Reports
Relates :  
Description
Happens intermittently on all platforms. The stacktrace:

Java HotSpot(TM) 64-Bit Server VM warning: CodeHeap 'non-profiled nmethods' is full. Compiler has been disabled.
Java HotSpot(TM) 64-Bit Server VM warning: Try increasing the code heap size using -XX:NonProfiledCodeHeapSize=
java.lang.NullPointerException: Cannot invoke "java.lang.management.MemoryPoolMXBean.getUsage()" because "<local1>" is null
	at compiler.codecache.MHIntrinsicAllocFailureTest.fillCodeCacheSegment(MHIntrinsicAllocFailureTest.java:61)
	at compiler.codecache.MHIntrinsicAllocFailureTest.main(MHIntrinsicAllocFailureTest.java:71)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
	at java.base/java.lang.reflect.Method.invoke(Method.java:578)
	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:125)
	at java.base/java.lang.Thread.run(Thread.java:1623)

Slightly modified code snippet:

   // type is a BlobType.MethodProfiled
   MemoryPoolMXBean bean = type.getMemoryPool();
   int size = (int) (bean.getUsage().getMax() >> 7);

No usage object initialised for the said MemoryPool?
Comments
Fix Request Backported as part of JDK-8295724 (review and approval is there).
31-12-2022

Thanks for quickly fixing, [~mdoerr]. Just FYI, the `testbug` label is deprecated, `noreg-self` should be used: "The labels test, test-only, and testbug are deprecated and should no longer be used. Use noreg-self to indicate that an issue is a bug in test code." https://openjdk.org/guide/
21-12-2022

A pull request was submitted for review. URL: https://git.openjdk.org/jdk17u-dev/pull/951 Date: 2022-12-13 11:58:23 +0000
20-12-2022

Changeset: 3d4d9fd6 Author: Martin Doerr <mdoerr@openjdk.org> Date: 2022-12-20 22:02:34 +0000 URL: https://git.openjdk.org/jdk20/commit/3d4d9fd6e6de037950f94482d4e33f178eb15daa
20-12-2022

A pull request was submitted for review. URL: https://git.openjdk.org/jdk20/pull/55 Date: 2022-12-19 16:17:34 +0000
19-12-2022

Thanks for reporting and the investigation. I think we should fix it in JDK 20. PR is created.
19-12-2022

ILW = Test fails (probably test bug), intermittent with single test and TieredStopAtLevel=1, no workaround = MLH = P4
16-12-2022

Looks similar to the issue that Vladimir already reported in the PR but was subsequently fixed by disabling the test when TieredCompilation is off: https://github.com/openjdk/jdk/pull/10933#issuecomment-1338608466 In the failing cases, the test is executed with -XX:TieredStopAtLevel=1. That's probably the issue. I think a "& (vm.opt.TieredStopAtLevel == null | vm.opt.TieredStopAtLevel==4)" is missing.
16-12-2022

That looks like a regression / test bug from JDK-8295724 which introduced that test.
16-12-2022

[~mdoerr], could you please have a look?
16-12-2022