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

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



    • 15
    • b18
    • generic
    • linux



        If a tool like cpuset (https://github.com/lpechacek/cpuset) is used to manually create and manage cpusets (https://man7.org/linux/man-pages/man7/cpuset.7.html) the cgroups detections will be confused and crash in a debug build (see below) or behave unexpectedly in a product build.

        The problem is that the additionally mounted cpuset will be interpreted as if it was belonging to Cgroup controller:

        $ grep cgroup /proc/self/mountinfo
        36 25 0:30 / /sys/fs/cgroup ro,nosuid,nodev,noexec shared:9 - tmpfs tmpfs ro,mode=755
        49 36 0:43 / /sys/fs/cgroup/memory rw,nosuid,nodev,noexec,relatime shared:23 - cgroup cgroup rw,memory
        50 36 0:44 / /sys/fs/cgroup/rdma rw,nosuid,nodev,noexec,relatime shared:24 - cgroup cgroup rw,rdma
        43 36 0:37 / /sys/fs/cgroup/cpuset rw,nosuid,nodev,noexec,relatime shared:17 - cgroup cgroup rw,cpuset
        121 32 0:37 / /cpusets rw,relatime shared:69 - cgroup none rw,cpuset

        # A fatal error has been detected by the Java Runtime Environment:
        # Internal Error (/priv/simonisv/OpenJDK/Git/jdk/src/hotspot/os/linux/cgroupSubsystem_linux.cpp:305), pid=1583, tid=1601
        # assert(cg_infos[0]._mount_path == __null) failed: stomping of _mount_path
        # JRE version: (16.0) (slowdebug build )
        # Java VM: OpenJDK 64-Bit Server VM (slowdebug 16-internal+0-adhoc.simonisv.jdk, mixed mode, sharing, tiered, unknown gc, linux-amd64)
        # No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again

        --------------- S U M M A R Y ------------

        Command Line:

        Host: xxx, Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz, 8 cores, 31G, Ubuntu 18.04.5 LTS
        Time: Mon Sep 21 17:35:18 2020 CEST elapsed time: 0.006970 seconds (0d 0h 0m 0s)

        --------------- T H R E A D ---------------

        Current thread is native thread

        Stack: [0x00007ffff7ed0000,0x00007ffff7fd1000], sp=0x00007ffff7fc92a0, free space=996k
        Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
        V [libjvm.so+0x1217bf8] VMError::report_and_die(int, char const*, char const*, __va_list_tag*, Thread*, unsigned char*, void*, void*, char const*, int, unsigned long)+0x7aa
        V [libjvm.so+0x12173eb] VMError::report_and_die(Thread*, void*, char const*, int, char const*, char const*, __va_list_tag*)+0x57
        V [libjvm.so+0x74bda5] report_vm_error(char const*, int, char const*, char const*, ...)+0x205
        V [libjvm.so+0x620736] CgroupSubsystemFactory::determine_type(CgroupInfo*, char const*, char const*, char const*, unsigned char*)+0xc62
        V [libjvm.so+0x61f5fb] CgroupSubsystemFactory::create()+0xbf
        V [libjvm.so+0xeeccb3] OSContainer::init()+0xb7
        V [libjvm.so+0xef9275] os::pd_init_container_support()+0x9
        V [libjvm.so+0x464e65] os::init_container_support()+0x9
        V [libjvm.so+0x45e095] Arguments::parse_vm_init_args(JavaVMInitArgs const*, JavaVMInitArgs const*, JavaVMInitArgs const*, JavaVMInitArgs const*)+0x147
        V [libjvm.so+0x4628e8] Arguments::parse(JavaVMInitArgs const*)+0x3fe
        V [libjvm.so+0x1191a69] Threads::create_vm(JavaVMInitArgs*, bool*)+0xb3
        V [libjvm.so+0xade81d] JNI_CreateJavaVM_inner(JavaVM_**, void**, void*)+0xda
        V [libjvm.so+0xadeb25] JNI_CreateJavaVM+0x32
        C [libjli.so+0x735a] InitializeJVM+0x13a
        C [libjli.so+0x3f3c] JavaMain+0xdc
        C [libjli.so+0xaca2] ThreadJavaMain+0x27


          Issue Links



                simonis Volker Simonis
                simonis Volker Simonis
                0 Vote for this issue
                8 Start watching this issue