JDK-8339542 : compiler/codecache/CheckSegmentedCodeCache.java fails
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 24
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux
  • Submitted: 2024-09-04
  • Updated: 2024-10-07
  • Resolved: 2024-09-26
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 24
24 b18Fixed
Related Reports
Relates :  
Relates :  
Description
From JDK-8326615, [~mbaesken]'s comment:
We see now errors in the test compiler/codecache/CheckSegmentedCodeCache.java on platform linuxppc64le , fastdebug . Is this related ?

stdout: [Error occurred during initialization of VM
Not enough space in non-nmethod code heap to run VM: 5120K < 5226K
];
stderr: []
exitValue = 1
 
java.lang.RuntimeException: 'Invalid code heap sizes' missing from stdout/stderr
       at jdk.test.lib.process.OutputAnalyzer.shouldContain(OutputAnalyzer.java:252)
       at compiler.codecache.CheckSegmentedCodeCache.failsWith(CheckSegmentedCodeCache.java:81)
       at compiler.codecache.CheckSegmentedCodeCache.main(CheckSegmentedCodeCache.java:186)
       at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
       at java.base/java.lang.reflect.Method.invoke(Method.java:573)
       at com.sun.javatest.regtest.agent.MainWrapper$MainTask.run(MainWrapper.java:138)
       at java.base/java.lang.Thread.run(Thread.java:1575)
Comments
Changeset: 777c20cb Branch: master Author: Lutz Schmidt <lucy@openjdk.org> Date: 2024-09-26 11:45:09 +0000 URL: https://git.openjdk.org/jdk/commit/777c20cb14010b6726834246ae4c61bc4ccb3f9b
26-09-2024

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/21179 Date: 2024-09-25 10:37:59 +0000
26-09-2024

Thanks for looking into this [~lucy]]. I've assigned it to you.
25-09-2024

Due to a previous fix, 5M is no longer sufficiently large for NonNMethodCodeHeapSize. There is a draft PR currently being tested.
25-09-2024

I attached the output of this command: $ build/linux-aarch64-server-fastdebug/images/jdk/bin/java -XX:+SegmentedCodeCache -XX:ReservedCodeCacheSize=10M -XX:NonNMethodCodeHeapSize=5M -XX:ProfiledCodeHeapSize=5M -XX:NonProfiledCodeHeapSize=5M -XX:+PrintFlagsInitial > ~/aarch64-initial.txt Without -XX:+PrintFlagsInitial, it fails with the same message as the test.
12-09-2024

Thanks for the details [~shade]. I think there is actually an issue with the fix for JDK-8326615 at line 251 (https://github.com/openjdk/jdk/blob/master/src/hotspot/share/code/codeCache.cpp#L251) when calculating 'size_t non_nmethod_min_size = min_cache_size + compiler_buffer_size;' (min_cache_size already includes the compiler_buffer_size). I wanted to check if that was the case but unfortunately I cannot find a way to reproduce your issue. Could you add the -XX:+PrintFlagsInitial flag to the failing test and attach it to this bug please? Thanks a lot!
12-09-2024

I have seen this test failure while running `all` tests. The only test that was failing is compiler/codecache/CheckSegmentedCodeCache.java. Retested on current tip (d9fdf69c34c20e0f2d526c2f04450acb904c3e80), test fails without any additional flags. % CONF=linux-x86_64-server-fastdebug make images test TEST=compiler/codecache/CheckSegmentedCodeCache.java STDERR: stdout: [Error occurred during initialization of VM Not enough space in non-nmethod code heap to run VM: 5120K < 5226K ]; stderr: [] exitValue = 1 java.lang.RuntimeException: 'Invalid code heap sizes' missing from stdout/stderr % CONF=linux-aarch64-server-fastdebug make images test TEST=compiler/codecache/CheckSegmentedCodeCache.java STDERR: stdout: [Error occurred during initialization of VM Not enough space in non-nmethod code heap to run VM: 5120K < 5226K ]; stderr: [] exitValue = 1 java.lang.RuntimeException: 'Invalid code heap sizes' missing from stdout/stderr
11-09-2024

Yes, it is important since each platform has own limits. An other question: which tests and with what flags failed for you?
11-09-2024

Similar to reported above: "Not enough space in non-nmethod code heap to run VM: XXXXK < YYYYK". I have not captured the exact XXXX and YYYY, can re-run, if that is important.
11-09-2024

[~shade] What is your error outputs?
11-09-2024

Seeing this in local testing on linux-aarch64-server-fastdebug and linux-x86_64-server-fastdebug as well.
11-09-2024

ILW = Test fails due to out of code cache space (test bug), single test on ppc, no workaround = MLH = P4
05-09-2024

-XX:NonNMethodCodeHeapSize=5M is a bit too small for the (fast)debug build. Using 6M seems to help.
04-09-2024