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

CgroupSubsystemFactory.setCgroupV2Path asserts with freezer controller

XMLWordPrintable

    • b25
    • linux_ubuntu

        A number of tests fail with Assertion Error on Ubuntu 22.04 (which uses cgroups v2 by default), in the HotSpot cgroups code. This occurs in a specific configuration where the host has mixed cgroup configuration similar to:
        -------------
        cat /proc/self/cgroup
        1:freezer:/
        0::/user.slice/user-1001.slice/session-85.scope
        -------------

        (See comments below for setting up such an environment).

        Reproducible: always (or almost always)
        Tests that fail: a variety of tests in tier1 (details below)
        Failure type: Assertion

        ---------------- sample call stack
        Caused by: java.lang.AssertionError
        at java.base/jdk.internal.platform.CgroupSubsystemFactory.setCgroupV2Path(CgroupSubsystemFactory.java:226)
        at java.base/jdk.internal.platform.CgroupSubsystemFactory.lambda$determineType$1(CgroupSubsystemFactory.java:195)
        at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
        at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
        at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133)
        at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1921)
        at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
        at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
        at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
        at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
        at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
        at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
        at java.base/jdk.internal.platform.CgroupSubsystemFactory.determineType(CgroupSubsystemFactory.java:200)
        at java.base/jdk.internal.platform.CgroupSubsystemFactory.create(CgroupSubsystemFactory.java:84)
        at java.base/jdk.internal.platform.CgroupMetrics.getInstance(CgroupMetrics.java:177)
        at java.base/jdk.internal.platform.SystemMetrics.instance(SystemMetrics.java:29)
        at java.base/jdk.internal.platform.Metrics.systemMetrics(Metrics.java:58)
        at java.base/jdk.internal.platform.Container.metrics(Container.java:43)
        at jdk.management/com.sun.management.internal.OperatingSystemImpl.<init>(OperatingSystemImpl.java:183)
        at jdk.management/com.sun.management.internal.PlatformMBeanProviderImpl.getOperatingSystemMXBean(PlatformMBeanProviderImpl.java:280)
        ...

        ==========================================
        Simple reproducer:

        $ cat ManagementFactoryTest.java
        public class ManagementFactoryTest {
            public static void main(String args[]) {
                System.out.println(java.lang.management.ManagementFactory.getOperatingSystemMXBean());
            }
        }

        $ ./jdk/bin/java -esa ManagementFactoryTest.java
         

              iklam Ioi Lam
              mseledtsov Mikhailo Seledtsov
              Votes:
              0 Vote for this issue
              Watchers:
              10 Start watching this issue

                Created:
                Updated:
                Resolved: