-
Bug
-
Resolution: Fixed
-
P4
-
21, 22
-
b14
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8317574 | 21.0.2 | Aleksey Shipilev | P4 | Resolved | Fixed | b03 |
This is a follow up to the discussion at https://github.com/async-profiler/async-profiler/issues/779
When DoJVMTIVirtualThreadTransitions option is off as recommended for profiling, slowdebug build crashes with the following error:
#
# Internal Error (/home/andrei/jdk/src/hotspot/share/prims/jvm.cpp:3953), pid=737, tid=765
# assert(!JvmtiExport::can_support_virtual_threads()) failed: sanity check
#
# JRE version: OpenJDK Runtime Environment (22.0) (slowdebug build 22-internal-adhoc.andrei.jdk)
# Java VM: OpenJDK 64-Bit Server VM (slowdebug 22-internal-adhoc.andrei.jdk, mixed mode, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# V [libjvm.so+0xf36710] JVM_VirtualThreadMount+0xa9
=== Command line ===
java -XX:+UnlockExperimentalVMOptions -XX:-DoJVMTIVirtualThreadTransitions -ag
entpath:/path/to/emptyagent.so HelloVirtualThread
=== HelloVirtualThread.java ===
public class HelloVirtualThread {
public static void main(String[] args) throws Exception {
Thread.startVirtualThread(() -> System.out.println("hello")).join();
}
}
=== emptyagent.c ===
#include <jvmti.h>
int Agent_OnLoad(JavaVM* vm, char* options, void* reserved) {
jvmtiEnv* jvmti;
(*vm)->GetEnv(vm, (void**)&jvmti, JVMTI_VERSION_21);
jvmtiCapabilities capabilities = {0};
(*jvmti)->AddCapabilities(jvmti, &capabilities);
return 0;
}
===
Note that the agent calls AddCapabilities() with no capabilities set, but according to the triggered assertion JvmtiExport::can_support_virtual_threads() is true.
When DoJVMTIVirtualThreadTransitions option is off as recommended for profiling, slowdebug build crashes with the following error:
#
# Internal Error (/home/andrei/jdk/src/hotspot/share/prims/jvm.cpp:3953), pid=737, tid=765
# assert(!JvmtiExport::can_support_virtual_threads()) failed: sanity check
#
# JRE version: OpenJDK Runtime Environment (22.0) (slowdebug build 22-internal-adhoc.andrei.jdk)
# Java VM: OpenJDK 64-Bit Server VM (slowdebug 22-internal-adhoc.andrei.jdk, mixed mode, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# V [libjvm.so+0xf36710] JVM_VirtualThreadMount+0xa9
=== Command line ===
java -XX:+UnlockExperimentalVMOptions -XX:-DoJVMTIVirtualThreadTransitions -ag
entpath:/path/to/emptyagent.so HelloVirtualThread
=== HelloVirtualThread.java ===
public class HelloVirtualThread {
public static void main(String[] args) throws Exception {
Thread.startVirtualThread(() -> System.out.println("hello")).join();
}
}
=== emptyagent.c ===
#include <jvmti.h>
int Agent_OnLoad(JavaVM* vm, char* options, void* reserved) {
jvmtiEnv* jvmti;
(*vm)->GetEnv(vm, (void**)&jvmti, JVMTI_VERSION_21);
jvmtiCapabilities capabilities = {0};
(*jvmti)->AddCapabilities(jvmti, &capabilities);
return 0;
}
===
Note that the agent calls AddCapabilities() with no capabilities set, but according to the triggered assertion JvmtiExport::can_support_virtual_threads() is true.
- backported by
-
JDK-8317574 assert(!JvmtiExport::can_support_virtual_threads()) with -XX:-DoJVMTIVirtualThreadTransitions
- Resolved