Details
-
Bug
-
Resolution: Fixed
-
P4
-
openjdk8u, 11, 13
-
b13
-
generic
-
linux
Backports
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8229936 | 11.0.6-oracle | Severin Gehwolf | P4 | Resolved | Fixed | b01 |
JDK-8229294 | 11.0.5 | Severin Gehwolf | P4 | Resolved | Fixed | b03 |
JDK-8257430 | openjdk8u282 | Severin Gehwolf | P4 | Resolved | Fixed | b04 |
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 forJDK-8217338
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
Attachments
Issue Links
- backported by
-
JDK-8229294 [Containers] SubSystem.java out of sync with osContainer_linux.cpp
- Resolved
-
JDK-8229936 [Containers] SubSystem.java out of sync with osContainer_linux.cpp
- Resolved
-
JDK-8257430 [Containers] SubSystem.java out of sync with osContainer_linux.cpp
- Resolved
- blocks
-
JDK-8217338 [Containers] Improve systemd slice memory limit support
- Resolved
- relates to
-
JDK-8221340 [TESTBUG] TestCgroupMetrics.java fails after fix for JDK-8219562
- Resolved