-
Bug
-
Resolution: Fixed
-
P3
-
8, 11, 17, 21, 23
-
b08
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8334074 | 21.0.5-oracle | Tobias Hartmann | P3 | Resolved | Fixed | b01 |
JDK-8334309 | 21.0.5 | Martin Doerr | P3 | Resolved | Fixed | b01 |
The synchronized statements result in BoxLockNodes in C2, which require a stack slot and corresponding RegMask. When there is no more space on the stack (or, rather, when the RegMask cannot represent the too large stack slot), the assert triggers.
# Original description
C2 fails to compile deeply nested synchronized statements (see also related javac bug
java -XX:CompileCommand=compileonly,C2Bug::* -XX:CompileCommand=quiet -XX:-TieredCompilation -Xcomp C2Bug.java
# A fatal error has been detected by the Java Runtime Environment:
#
# Internal Error (/workspace/open/src/hotspot/share/opto/regmask.hpp:298), pid=3564487, tid=3564501
# assert(reg < CHUNK_SIZE) failed: sanity
#
# JRE version: Java(TM) SE Runtime Environment (23.0+1) (fastdebug build 23-cpu+1-1)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 23-cpu+1-1, compiled mode, sharing, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# V [libjvm.so+0x124767b] BoxLockNode::BoxLockNode(int)+0x86b
Current CompileTask:
C2:1461 82 !b C2Bug::test (1909 bytes)
Stack: [0x00007fda0e5a5000,0x00007fda0e6a6000], sp=0x00007fda0e6a2610, free space=1013k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V [libjvm.so+0x124767b] BoxLockNode::BoxLockNode(int)+0x86b (regmask.hpp:298)
V [libjvm.so+0xd981de] GraphKit::shared_lock(Node*)+0x8e
V [libjvm.so+0x150a0a6] Parse::do_one_bytecode()+0x2ca6
V [libjvm.so+0x14f54af] Parse::do_one_block()+0x23f
V [libjvm.so+0x14f6975] Parse::do_all_blocks()+0x135
V [libjvm.so+0x14fab3d] Parse::Parse(JVMState*, ciMethod*, float)+0xb2d
V [libjvm.so+0x840d29] ParseGenerator::generate(JVMState*)+0x169
V [libjvm.so+0x9f1b9e] Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*)+0x163e
V [libjvm.so+0x83e5d7] C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x1e7
V [libjvm.so+0x9fd92c] CompileBroker::invoke_compiler_on_method(CompileTask*)+0x92c
V [libjvm.so+0x9fe5b8] CompileBroker::compiler_thread_loop()+0x468
V [libjvm.so+0xeb8eec] JavaThread::thread_main_inner()+0xcc
V [libjvm.so+0x179e4d6] Thread::call_run()+0xb6
V [libjvm.so+0x14a87a7] thread_native_entry(Thread*)+0x127
- backported by
-
JDK-8334074 BoxLockNode creation fails with assert(reg < CHUNK_SIZE) failed: sanity
- Resolved
-
JDK-8334309 BoxLockNode creation fails with assert(reg < CHUNK_SIZE) failed: sanity
- Resolved
- relates to
-
JDK-8310844 [AArch64] C1 compilation fails because monitor offset in OSR buffer is too large for immediate
- Resolved
-
JDK-8322992 Javac fails with StackOverflowError when compiling deeply nested synchronized blocks
- Resolved
-
JDK-8324839 Return address mask creation fails with assert(reg < CHUNK_SIZE) failed: sanity
- Closed
- links to
-
Commit openjdk/jdk21u-dev/8ca5280c
-
Commit openjdk/jdk/69586e7b
-
Review openjdk/jdk21u-dev/698
-
Review openjdk/jdk/17370