JDK-8371053 : diagnostic command Thread.dump_to_file crash
  • Type: Bug
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 25
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2025-10-28
  • Updated: 2025-11-03
  • Resolved: 2025-10-31
Related Reports
Duplicate :  
Description
A DESCRIPTION OF THE PROBLEM :
With many virtual threads and intense GC pressure, Thread.dump_to_file crashes the VM.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
$ java Test.java


---------- BEGIN SOURCE ----------
import java.io.IOException;

class Test {
  public static void main() throws InterruptedException, IOException {
    for (var i = 0; i < 10000; i++) {
      Thread.startVirtualThread(
          () -> {
            while (true) {
              var unused = new byte[1024];
              Thread.yield();
            }
          });
    }
    while (true) {
      new ProcessBuilder(
              System.getProperty("java.home") + "/bin/jcmd",
              Long.toString(ProcessHandle.current().pid()),
              "Thread.dump_to_file",
              "-overwrite",
              "/dev/null")
          .start()
          .waitFor();
    }
  }
}
---------- END SOURCE ----------


Comments
ILW = MML => P4
31-10-2025

The issue is replicated on JDK 25.0.1 and mac m1 pro
31-10-2025

Likely a dup of JDK-8364343.
29-10-2025