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

JCMD and attach fail to work across Linux Container boundary

    Details

    • Type: Bug
    • Status: Open
    • Priority: P3
    • Resolution: Unresolved
    • Affects Version/s: 14
    • Fix Version/s: tbd
    • Component/s: core-svc
    • Labels:

      Description

      Use the latest version of tests from 8195809: [TESTBUG] jps and jcmd -l support for Docker containers is not tested

      1. jcmd -l works across container boundaries. That is, if JCMD runs on the host system outside of the container, while the observed JVM process runs inside a container, the JCMD will see that process and report its PID. Important to note that for this to work, both UserName and UID of the JCMD and the observed process must match, which the test strives to do.

      2. However, any other JCMD commands to the process running inside a container fails.
      The test uses simple "jcmd <PID> help", and that fails.

      It seems that the signal is sent to the observed process, the process receives the signal, but JCMD and observed process fail to establish the communication.

      ================= Failure:
      STDERR:
       stdout: [19761:
      ];
       stderr: [com.sun.tools.attach.AttachNotSupportedException: Unable to open socket file /proc/19761/root/tmp/.java_pid1: target process 19761 doesn't respond within 10500ms or HotSpot VM not loaded
      at jdk.attach/sun.tools.attach.VirtualMachineImpl.<init>(VirtualMachineImpl.java:100)
      at jdk.attach/sun.tools.attach.AttachProviderImpl.attachVirtualMachine(AttachProviderImpl.java:58)
      at jdk.attach/com.sun.tools.attach.VirtualMachine.attach(VirtualMachine.java:207)
      at jdk.jcmd/sun.tools.jcmd.JCmd.executeCommandForPid(JCmd.java:115)
      at jdk.jcmd/sun.tools.jcmd.JCmd.main(JCmd.java:99)
      ]
       exitValue = 1

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                mseledtsov Mikhailo Seledtsov
              • Votes:
                0 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated: