# HG changeset patch # User bobv # Date 1512053385 18000 # Node ID fed0e4b11604d5f5658959b644cf3b0a3da73742 # Parent bef902d8fef1457b727658c1658dd851ca6c5fd0 8192154: JVM crashes inside some chroot environments on linux Reviewed-by: dholmes, sgehwolf, glaubitz diff -r bef902d8fef1 -r fed0e4b11604 src/hotspot/os/linux/osContainer_linux.cpp --- a/src/hotspot/os/linux/osContainer_linux.cpp Wed Nov 29 10:30:51 2017 -0800 +++ b/src/hotspot/os/linux/osContainer_linux.cpp Thu Nov 30 09:49:45 2017 -0500 @@ -323,7 +323,12 @@ } } - if (mntinfo != NULL) fclose(mntinfo); + fclose(mntinfo); + + if (memory == NULL || cpuset == NULL || cpu == NULL || cpuacct == NULL) { + log_debug(os, container)("Required cgroup subsystems not found"); + return; + } /* * Read /proc/self/cgroup and map host mount point to @@ -383,12 +388,7 @@ } } - if (cgroup != NULL) fclose(cgroup); - - if (memory == NULL || cpuset == NULL || cpu == NULL) { - log_debug(os, container)("Required cgroup subsystems not found"); - return; - } + fclose(cgroup); // We need to update the amount of physical memory now that // command line arguments have been processed.