JDK-8351382 : New test containers/docker/TestMemoryWithSubgroups.java is failing
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 25
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux
  • CPU: x86_64,aarch64
  • Submitted: 2025-03-07
  • Updated: 2025-06-02
  • Resolved: 2025-03-18
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 24 JDK 25
24.0.2Fixed 25 b15Fixed
Related Reports
Causes :  
Description
Test: containers/docker/TestMemoryWithSubgroups.java

[STDERR]
Resource limits are not supported and ignored on cgroups V1 rootless systems

[STDOUT]
mkdir: cannot create directory '/sys/fs/cgroup/memory/test': Permission denied
sh: /sys/fs/cgroup/memory/test/memory.limit_in_bytes: No such file or directory
sh: /sys/fs/cgroup/memory/test/cgroup.procs: No such file or directory
[0.000s][trace][os,container] OSContainer::init: Initializing Container Support
[0.000s][debug][os,container] Detected optional cpuset controller entry in /proc/cgroups
[0.000s][debug][os,container] Detected optional pids controller entry in /proc/cgroups
[0.001s][debug][os,container] Detected cgroups hybrid or legacy hierarchy, using cgroups v1 controllers
[0.001s][trace][os,container] total physical memory: 24891109376
[0.001s][trace][os,container] Path to /memory.limit_in_bytes is /sys/fs/cgroup/memory/memory.limit_in_bytes
[0.001s][trace][os,container] Memory Limit is: 9223372036854771712
[0.001s][debug][os,container] container memory limit ignored: 9223372036854771712, using host value 24891109376
[0.001s][trace][os,container] Path to /cpu.cfs_quota_us is /sys/fs/cgroup/cpu,cpuacct/cpu.cfs_quota_us
[0.001s][trace][os,container] CPU Quota is: -1
[0.001s][trace][os,container] Path to /cpu.cfs_period_us is /sys/fs/cgroup/cpu,cpuacct/cpu.cfs_period_us
[0.001s][trace][os,container] CPU Period is: 100000
[0.001s][trace][os,container] OSContainer::active_processor_count: 12
[0.001s][debug][os,container] OSContainer::init: is_containerized() = false because no cpu or memory limit is present
Comments
[jdk24u-fix-request] Approval Request from Sergey Chernyshev This fixes the newly added test in rootless docker/podman environments.
18-03-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk24u/pull/141 Date: 2025-03-18 14:39:23 +0000
18-03-2025

Changeset: 46b3d1d8 Branch: master Author: Sergey Chernyshev <schernyshev@openjdk.org> Committer: Severin Gehwolf <sgehwolf@openjdk.org> Date: 2025-03-18 09:37:45 +0000 URL: https://git.openjdk.org/jdk/commit/46b3d1d8cfd03e01d993be19d725cdbcafef7865
18-03-2025

I updated the PR to work with Podman, that is rootless in the default setting. The corresponding podman info node is {{.Host.Security.Rootless}}. Platform.isRoot() would be sufficient with podman too, but this won't work with the docker. The latter depends on the mode in which the dockerd runs, rather than on whether the container is started with root privileges like in podman.
11-03-2025

The test TestMemoryWithSubgroups.java uses --privileged mode to modify process' cgroup, that has no effect in rootless mode. The test has to be skiped. The fix is to query 'info -f {{println .SecurityOptions}}' and check whether it has 'name=rootless' in the output.
07-03-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/23948 Date: 2025-03-07 20:14:05 +0000
07-03-2025

It looks to me that in rootless docker mode SkippedException should be thrown. I am working on the fix.
07-03-2025