Details
-
Bug
-
Resolution: Fixed
-
P3
-
21, 22
-
b17
Backports
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8317787 | 21.0.2 | Aleksey Shipilev | P3 | Resolved | Fixed | b03 |
Description
Running into the following assert while testing some changes
# Internal Error (/home/albatem/ws/jdk/open/src/hotspot/share/opto/loopnode.cpp:5523), pid=2082704, tid=2082731
# assert(!in->is_CFG()) failed: CFG Node with no controlling input?
Current CompileTask:
C2: 1878 2115 4 java.lang.VirtualThread$VThreadContinuation$1::run (12 bytes)
Stack: [0x00007fde6d5f1000,0x00007fde6d6f1000], sp=0x00007fde6d6ebd30, free space=1003k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V [libjvm.so+0x12970c6] PhaseIdealLoop::build_loop_early(VectorSet&, Node_List&, Node_Stack&)+0x766 (loopnode.cpp:5523)
V [libjvm.so+0x12a2d10] PhaseIdealLoop::build_and_optimize()+0x5b0 (loopnode.cpp:4446)
V [libjvm.so+0x9f0209] PhaseIdealLoop::optimize(PhaseIterGVN&, LoopOptsMode)+0x3b9 (loopnode.hpp:1110)
V [libjvm.so+0x9eb1c0] Compile::Optimize()+0x820 (compile.cpp:2307)
V [libjvm.so+0x9eefd0] Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*)+0x1bb0 (compile.cpp:854)
V [libjvm.so+0x849feb] C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x13b (c2compiler.cpp:119)
V [libjvm.so+0x9faf40] CompileBroker::invoke_compiler_on_method(CompileTask*)+0x980 (compileBroker.cpp:2285)
V [libjvm.so+0x9fbd78] CompileBroker::compiler_thread_loop()+0x5f8 (compileBroker.cpp:1946)
V [libjvm.so+0xeb784c] JavaThread::thread_main_inner()+0xcc (javaThread.cpp:720)
V [libjvm.so+0x17a2fea] Thread::call_run()+0xba (thread.cpp:220)
V [libjvm.so+0x14a1bda] thread_native_entry(Thread*)+0x12a (os_linux.cpp:785)
The issue is duplicated by editing src/java.base/share/classes/java/lang/VirtualThread.java and remove @ChangesCurrentThread from the run(Runnable) method. This annotation is not needed on this method as it doesn't change the current thread.
With that change, run Skynet like this:
cd test/jdk/java/lang/Thread/virtual/stress
java -XX:NativeMemoryTracking=summary -XX:FlightRecorderOptions=preserve-repository=false -XX:StartFlightRecording=dumponexit=true,settings=profile Skynet.java 100
The assert goes away if the method is changed to have DontInline so this is something to do with the inlining of run(Runnable) into its caller.
# Internal Error (/home/albatem/ws/jdk/open/src/hotspot/share/opto/loopnode.cpp:5523), pid=2082704, tid=2082731
# assert(!in->is_CFG()) failed: CFG Node with no controlling input?
Current CompileTask:
C2: 1878 2115 4 java.lang.VirtualThread$VThreadContinuation$1::run (12 bytes)
Stack: [0x00007fde6d5f1000,0x00007fde6d6f1000], sp=0x00007fde6d6ebd30, free space=1003k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V [libjvm.so+0x12970c6] PhaseIdealLoop::build_loop_early(VectorSet&, Node_List&, Node_Stack&)+0x766 (loopnode.cpp:5523)
V [libjvm.so+0x12a2d10] PhaseIdealLoop::build_and_optimize()+0x5b0 (loopnode.cpp:4446)
V [libjvm.so+0x9f0209] PhaseIdealLoop::optimize(PhaseIterGVN&, LoopOptsMode)+0x3b9 (loopnode.hpp:1110)
V [libjvm.so+0x9eb1c0] Compile::Optimize()+0x820 (compile.cpp:2307)
V [libjvm.so+0x9eefd0] Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*)+0x1bb0 (compile.cpp:854)
V [libjvm.so+0x849feb] C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x13b (c2compiler.cpp:119)
V [libjvm.so+0x9faf40] CompileBroker::invoke_compiler_on_method(CompileTask*)+0x980 (compileBroker.cpp:2285)
V [libjvm.so+0x9fbd78] CompileBroker::compiler_thread_loop()+0x5f8 (compileBroker.cpp:1946)
V [libjvm.so+0xeb784c] JavaThread::thread_main_inner()+0xcc (javaThread.cpp:720)
V [libjvm.so+0x17a2fea] Thread::call_run()+0xba (thread.cpp:220)
V [libjvm.so+0x14a1bda] thread_native_entry(Thread*)+0x12a (os_linux.cpp:785)
The issue is duplicated by editing src/java.base/share/classes/java/lang/VirtualThread.java and remove @ChangesCurrentThread from the run(Runnable) method. This annotation is not needed on this method as it doesn't change the current thread.
With that change, run Skynet like this:
cd test/jdk/java/lang/Thread/virtual/stress
java -XX:NativeMemoryTracking=summary -XX:FlightRecorderOptions=preserve-repository=false -XX:StartFlightRecording=dumponexit=true,settings=profile Skynet.java 100
The assert goes away if the method is changed to have DontInline so this is something to do with the inlining of run(Runnable) into its caller.
Attachments
Issue Links
- backported by
-
JDK-8317787 Incorrect control in LibraryCallKit::inline_native_notify_jvmti_funcs
-
- Resolved
-
- relates to
-
JDK-8304303 implement VirtualThread class notifyJvmti methods as C2 intrinsics
-
- Resolved
-
- links to
-
Commit openjdk/jdk21u/1bcaff30
-
Commit openjdk/jdk/4b654839
-
Review openjdk/jdk21u/232
-
Review openjdk/jdk/15713
(1 links to)