RFR: 8253435: Cgroup: 'stomping of _mount_path' crash if manually mounted cpusets exist

Severin Gehwolf sgehwolf at openjdk.java.net
Wed Sep 23 09:29:38 UTC 2020


On Wed, 23 Sep 2020 08:59:37 GMT, Volker Simonis <simonis at openjdk.org> wrote:

> > Did you run container tests with this?
> 
> Yes. It took me some time to find out that I have to set `-Djdk.test.docker.image.name=ubuntu` and
> `-Djdk.test.docker.image.version=18.04` on Ubuntu in order to run them :)

Yes, this is a bit painful. I should have said that.

> For release builds they all pass with and without the change (except `TestJFRWithJMX.java` which always fails, but I
> don' t think that's related to this issue). Fast- and slowdebug builds don't even start without the fix and pass all
> the tests with it (again except `TestJFRWithJMX.java`).

Hmm, which ones did you run? It seems odd that they fail to run in fastdebug config.

FWIW, I've crafted a regression test for this issue. Please include something like that if you can:
https://github.com/simonis/jdk/pull/1

A fix like this should make it pass (uses the `/sys/fs/cgroup` convention) - on top of your change:

diff --git a/src/hotspot/os/linux/cgroupSubsystem_linux.cpp b/src/hotspot/os/linux/cgroupSubsystem_linux.cpp
index 21be7a8260c..4c6ae541929 100644
--- a/src/hotspot/os/linux/cgroupSubsystem_linux.cpp
+++ b/src/hotspot/os/linux/cgroupSubsystem_linux.cpp
@@ -295,10 +295,10 @@ bool CgroupSubsystemFactory::determine_type(CgroupInfo* cg_infos,
         // Skip cgroup2 fs lines on hybrid or unified hierarchy.
         continue;
       }
-      if (strcmp("none", tmpsource) == 0) {
-        // Skip cpusets created manually or by cset/cpuset (https://github.com/lpechacek/cpuset)
-        // The "mount source" for these mounts is usually "none" while the source of "true" Cgroup
-        // controllers is usually "cgroup". But this is just another heuristic...
+      if (strcmp(tmpmount, "/sys/fs/cgroup") < 0) {
+        // Skip potentially duplicate, manually mounted cgroup controllers
+        // not on /sys/fs/cgroup
+        log_info(os, container)("%s not mounted at /sys/fs/cgroup, skipping!", tmpmount);

-------------

PR: https://git.openjdk.java.net/jdk/pull/295


More information about the hotspot-runtime-dev mailing list