Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8038099

some jcmd may fail when started several instances at the same time

XMLWordPrintable

    • b01

      error is:
      java.io.IOException: File exists
      at sun.tools.attach.BsdVirtualMachine.createAttachFile(Native Method)
      at sun.tools.attach.BsdVirtualMachine.<init>(BsdVirtualMachine.java:74)
      at sun.tools.attach.BsdAttachProvider.attachVirtualMachine(BsdAttachProvider.java:63)
      at com.sun.tools.attach.VirtualMachine.attach(VirtualMachine.java:214)
      at sun.tools.jcmd.JCmd.executeCommandForPid(JCmd.java:139)
      at sun.tools.jcmd.JCmd.main(JCmd.java:128)

      reason is race condition, 2 or more threads see that no .java_pid file exists and then try call createAttachFile, but only one process succeeds, other fails

      for the moment reproduced only on macos

        1. check.sh
          0.2 kB
          Anton Ivanov
        2. EndlessLoop.java
          2 kB
          Anton Ivanov

            ykantser Yekaterina Kantserova (Inactive)
            aaivanov Anton Ivanov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: