JDK-8279573 : compiler/codecache/CodeCacheFullCountTest.java fails with "RuntimeException: the value of full_count is wrong."
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 19
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: os_x
  • CPU: x86_64
  • Submitted: 2022-01-06
  • Updated: 2024-09-19
  • Resolved: 2022-03-01
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 19
19 b12Fixed
Related Reports
Relates :  
Relates :  
Description
The following test failed in the JDK19 CI:

compiler/codecache/CodeCacheFullCountTest.java

Here's a snippet from the log file:

----------System.out:(7/2278)----------
Command line: [/System/Volumes/Data/mesos/work_dir/jib-master/install/jdk-19+4-134/macosx-x64-debug.jdk/jdk-19/fastdebug/bin/java -cp /System/Volumes/Data/mesos/work_dir/slaves/c82600aa-2448-475c-8c08-6f02a5b3f3af-S1576/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/f6e14629-997c-45a5-9d53-3dcd9a6dd92b/runs/509bbce6-5325-4d8d-aee2-c88cca151a31/testoutput/test-support/jtreg_open_test_hotspot_jtreg_hotspot_compiler_all_gcs/classes/0/compiler/codecache/CodeCacheFullCountTest.d:/System/Volumes/Data/mesos/work_dir/jib-master/install/jdk-19+4-134/src.full/open/test/hotspot/jtreg/compiler/codecache:/System/Volumes/Data/mesos/work_dir/slaves/c82600aa-2448-475c-8c08-6f02a5b3f3af-S1576/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/f6e14629-997c-45a5-9d53-3dcd9a6dd92b/runs/509bbce6-5325-4d8d-aee2-c88cca151a31/testoutput/test-support/jtreg_open_test_hotspot_jtreg_hotspot_compiler_all_gcs/classes/0/test/lib:/System/Volumes/Data/mesos/work_dir/jib-master/install/jtreg/6.1/1/bundles/jtreg-6.1+1.zip/jtreg/lib/javatest.jar:/System/Volumes/Data/mesos/work_dir/jib-master/install/jtreg/6.1/1/bundles/jtreg-6.1+1.zip/jtreg/lib/jtreg.jar:/System/Volumes/Data/mesos/work_dir/jib-master/install/jtreg/6.1/1/bundles/jtreg-6.1+1.zip/jtreg/lib/junit.jar:/System/Volumes/Data/mesos/work_dir/jib-master/install/jtreg/6.1/1/bundles/jtreg-6.1+1.zip/jtreg/lib/hamcrest.jar:/System/Volumes/Data/mesos/work_dir/jib-master/install/jtreg/6.1/1/bundles/jtreg-6.1+1.zip/jtreg/lib/testng.jar:/System/Volumes/Data/mesos/work_dir/jib-master/install/jtreg/6.1/1/bundles/jtreg-6.1+1.zip/jtreg/lib/jcommander.jar:/System/Volumes/Data/mesos/work_dir/jib-master/install/jtreg/6.1/1/bundles/jtreg-6.1+1.zip/jtreg/lib/guice.jar -XX:ReservedCodeCacheSize=2496k -XX:-UseCodeCacheFlushing CodeCacheFullCountTest WasteCodeCache ]
[2022-01-05T23:38:13.088302Z] Gathering output for process 15346
[2022-01-05T23:38:28.543683Z] Waiting for completion for process 15346
[2022-01-05T23:38:28.543939Z] Waiting for completion finished for process 15346
Output and diagnostic info for process 15346 was saved into 'pid-15346-output.log'
[2022-01-05T23:38:28.580547Z] Waiting for completion for process 15346
[2022-01-05T23:38:28.581348Z] Waiting for completion finished for process 15346
----------System.err:(11/619)----------
java.lang.RuntimeException: the value of full_count is wrong.
	at CodeCacheFullCountTest.runTest(CodeCacheFullCountTest.java:68)
	at CodeCacheFullCountTest.main(CodeCacheFullCountTest.java:43)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
	at java.base/java.lang.reflect.Method.invoke(Method.java:577)
	at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:312)
	at java.base/java.lang.Thread.run(Thread.java:833)

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

result: Failed. Execution failed: `main' threw exception: java.lang.RuntimeException: the value of full_count is wrong.
Comments
Changeset: 76398c84 Author: Coleen Phillimore <coleenp@openjdk.org> Date: 2022-03-01 15:28:21 +0000 URL: https://git.openjdk.java.net/jdk/commit/76398c84007862bdf07cea6be792eca50eec9edd
01-03-2022

A pull request was submitted for review. URL: https://git.openjdk.java.net/jdk/pull/7629 Date: 2022-02-26 13:14:57 +0000
26-02-2022

This test relies on -XX:-UseCodeCacheFlushing to not remove code in the code cache via the sweeper but in fact nmethods can be swept depending on the timing and number of methods included. This option looks completely useless to me, especially to force a code cache full situation. In the loom repository, an additional jar file is compiled and this allows the code cache to be flushed, and the test doesn't get a code cache full failure.
25-02-2022

This fixes the loom test but I don't know if this fixes the number of full_count. diff --git a/src/hotspot/share/runtime/sweeper.cpp b/src/hotspot/share/runtime/sweeper.cpp index 2861918b16c..aee7613c0af 100644 --- a/src/hotspot/share/runtime/sweeper.cpp +++ b/src/hotspot/share/runtime/sweeper.cpp @@ -499,9 +499,11 @@ NMethodSweeper::MethodStateChange NMethodSweeper::process_compiled_method(Compil // All inline caches that referred to this nmethod were cleaned in the // previous sweeper cycle. Now flush the nmethod from the code cache. assert(!cm->is_locked_by_vm(), "must not flush locked Compiled Methods"); - cm->flush(); - assert(result == None, "sanity"); - result = Flushed; + if (UseCodeCacheFlushing) { + cm->flush(); + assert(result == None, "sanity"); + result = Flushed; + } } else if (cm->is_not_entrant()) { // If there are no current activations of this method on the // stack we can safely convert it to a zombie method
24-02-2022

The problem probably exists in 18 as well, but so far we have only seen the failure in 19.
06-01-2022

The test fails if full_count is 2. This sounds like a test bug to me. stderr: Java HotSpot(TM) 64-Bit Server VM warning: CodeCache is full. Compiler has been disabled. Java HotSpot(TM) 64-Bit Server VM warning: Try increasing the code cache size using -XX:ReservedCodeCacheSize= Java HotSpot(TM) 64-Bit Server VM warning: CodeCache is full. Compiler has been disabled. Java HotSpot(TM) 64-Bit Server VM warning: Try increasing the code cache size using -XX:ReservedCodeCacheSize= Java HotSpot(TM) 64-Bit Server VM warning: C1 initialization failed. Shutting down all compilers Java HotSpot(TM) 64-Bit Server VM warning: C2 initialization failed. Shutting down all compilers stdout: [5.571s][warning][codecache] CodeCache is full. Compiler has been disabled. [5.571s][warning][codecache] Try increasing the code cache size using -XX:ReservedCodeCacheSize= [5.571s][warning][codecache] CodeCache is full. Compiler has been disabled. [5.571s][warning][codecache] Try increasing the code cache size using -XX:ReservedCodeCacheSize= CodeCache: size=2496Kb used=2494Kb max_used=2494Kb free=1Kb bounds [0x000000010e427000, 0x000000010e697000, 0x000000010e697000] total_blobs=1751 nmethods=1013 adapters=660 compilation: disabled (not enough contiguous free space left) stopped_count=0, restarted_count=0 full_count=2 CodeCache: size=2496Kb used=1931Kb max_used=2494Kb free=564Kb bounds [0x000000010e427000, 0x000000010e697000, 0x000000010e697000] total_blobs=1750 nmethods=1013 adapters=660 compilation: disabled (not enough contiguous free space left) stopped_count=0, restarted_count=0 full_count=2
06-01-2022

ILW = intermittent test failure with ZGC = MMH = P3
06-01-2022