Open andrew-m-leonard opened 3 years ago
To recreate standalone with Win32 JDK: Create a OnJcmdTest.java:
class OnJcmdTest {
public static void main(String[] args) {
try {
System.out.println("OnJcmdTest: sleeping 200 seconds ...");
Thread.sleep(200000);
System.out.println("Finished!");
} catch(Exception e) {
e.printStackTrace();
}
}
}
Start it with:
start java --add-exports java.base/jdk.internal.vm=ALL-UNNAMED -agentlib:jdwp=transport=dt_socket,address=localhost:0,onjcmd=y,server=y OnJcmdTest
Find its "process id" from Task Manager
Then run:
jcmd <process_id> VM.start_java_debugging
I think this is an upstream bug, I believe this line that gets called to resolve the OnJcmd jdwp.dll entry fails on Win32 https://github.com/adoptium/jdk11u/blob/815d3e1c6cd8272f962eaec80758cafa97c1dda5/src/hotspot/share/runtime/os.cpp#L591 It calls GetProcAddress, on Windows which I guess may not work the same as Win64
it's called from here as part of the DebugOnCmdStartDCmd flow: https://github.com/adoptium/jdk11u/blob/815d3e1c6cd8272f962eaec80758cafa97c1dda5/src/hotspot/share/services/diagnosticCommand.cpp#L1098
Same for jdk16+. Will exclude it.
Describe the bug Triage of jdk-11.0.12+7 shows a repeatable failure for com/sun/jdi/OnJcmdTest.java https://github.com/adoptium/adoptium/issues/62#issuecomment-907259150 I'm not sure this test has ever passed on Win32 jdk-11.
To Reproduce Steps to reproduce the behavior (or Grinder rerun link): https://ci.adoptopenjdk.net/view/Test_grinder/job/Grinder/1316/console
Rerun in Grinder link
Expected behavior A clear and concise description of what you expected to happen. Test should Pass like all the other platforms, eg.Win64: