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

[Containers] SubSystem.java out of sync with osContainer_linux.cpp

    Details

    • Resolved In Build:
      b13
    • CPU:
      generic
    • OS:
      linux

      Backports

        Description

        Setting the path for subsystems visible via -XshowSettings (Metrics.java/SubSystem.java) is out-of-sync with the logic in Hotspot's osContainer_linux.cpp

        Around line 87 in osContainer_linux.cpp function set_subsystem_path() has this:

                  if (strcmp(cgroup_path,"/") != 0) {
                    buflen = strlen(buf);
                    if ((buflen + strlen(cgroup_path)) > (MAXPATHLEN-1)) {
                      return;
                    }
                    strncat(buf, cgroup_path, MAXPATHLEN-buflen);
                    buf[MAXPATHLEN-1] = '\0';
                  }
                  _path = os::strdup(buf);

        The same piece of code in SubSystem.java method setPath has:

                        if (cgroupPath.equals("/")) {
                            path = mountPoint + cgroupPath;
                        }
                        else {
                            path = mountPoint;
                        }

        So the native code uses "'/' != cgroupPath" while the Java code has "'/' == cgroupPath".

        This is an issue for implementing Metrics.java bits for JDK-8217338

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  sgehwolf Severin Gehwolf
                  Reporter:
                  sgehwolf Severin Gehwolf
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: