JDK-8339700 : Test compiler/startup/StartupOutput.java intermittent fatal error: Initial size of CodeCache is too small
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 24
  • Priority: P3
  • Status: Open
  • Resolution: Unresolved
  • OS: linux
  • CPU: x86_64
  • Submitted: 2024-09-07
  • Updated: 2024-09-22
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
24Unresolved
Related Reports
Relates :  
Description
fail probability: 6/100

replay test command:
export test=test/hotspot/jtreg/compiler/startup/StartupOutput.java
function runJtreg() { jtreg -Xcomp -ea -esa -timeoutFactor:4 -v:fail,error,time,nopass -nr -w $dir/index-$1 $test &> $dir/$1.log ; if [[ 0 -ne $? ]] ; then echo -n "$1 " ; else rm -rf $dir/index-$1 $dir/$1.log ; fi ; } ; export -f runJtreg ; export dir="tmp-jtreg-"`basename ${test##* } .java | sed "s|#|_|"` ; rm -rf $dir ; mkdir -p $dir ; time seq 1000 | xargs -i -n 1 -P `nproc` bash -c "runJtreg {}" ; echo total fail number: `ls $dir/*.log 2> /dev/null | wc | awk '{print $1}'`

Test log snippet:
#  Internal Error (codeBlob.cpp:413), pid=325431, tid=325470
#  fatal error: Initial size of CodeCache is too small
#
# JRE version: OpenJDK Runtime Environment (24.0) (build 24)
# Java VM: OpenJDK 64-Bit Server VM (24, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# V  [libjvm.so+0x6491e3]  RuntimeStub::new_runtime_stub(char const*, CodeBuffer*, short, int, OopMapSet*, bool, bool)+0x293


jdk build configure:
bash configure --with-jobs=32 --prefix=/var/tmp/tone/run/jtreg/jdk-repo/install-release --verbose --with-debug-level=release --enable-unlimited-crypto --with-vendor-name=yansendao --with-vendor-url=https://github.com/sendaoYan --with-vendor-bug-url=mailto:yansendao.ysd@alibaba-inc.com --with-vendor-vm-bug-url=mailto:yansendao.ysd@alibaba-inc.com --with-jvm-variants=server --with-boot-jdk=/var/tmp/tone/run/jtreg/binary-download/jdk-24+12 --with-gtest=/var/tmp/tone/run/jtreg/googletest-v1.14.x --with-jtreg=/var/tmp/tone/run/jtreg/jtreg --with-jmh=build/jmh/jars    --with-version-pre='' --with-version-opt= --with-zlib=system --enable-ccache 
Comments
CPU: total 32 We initialized one C2 thread and start initializing C1 thread (which asserts): 0x00007f53581809e0 JavaThread "C2 CompilerThread0" daemon [_thread_blocked, id=325469, stack(0x00007f531a410000,0x00007f531a510000) (1024K)] =>0x00007f5358182180 JavaThread "C1 CompilerThread0" daemon [_thread_in_vm, id=325470, stack(0x00007f531a30f000,0x00007f531a40f000) (1024K)] With 32 cores we need a lot of space for C1 temp buffers. That why we hit assert. Note, compilation should be disabled based on CodeCache info: CodeCache: size=1200Kb used=1199Kb max_used=1199Kb free=0Kb bounds [0x00007f535dbb2000, 0x00007f535dcde000, 0x00007f535dcde000] total_blobs=282, nmethods=3, adapters=199, full_count=1 Compilation: disabled (not enough contiguous free space left), stopped_count=1, restarted_count=0 It seems we are missing/skip checks when we create compiler threads to check space for compilation. We should not create compiler threads if there is not space for them.
18-09-2024

ILW = Crash when creating new runtime stub, observed in single test, set higher InitialCodeCacheSize value = HLM = P3
11-09-2024

Also seen in our CI in tier6 on Windows
08-09-2024