[jdk21u-dev] RFR: 8261242: [Linux] OSContainer::is_containerized() returns true when run outside a container [v3]

Jan Kratochvil jkratochvil at openjdk.org
Fri Jun 13 04:44:40 UTC 2025


> A patch 3 of 6 for: [[21u] Backport intention of 8322420: [Linux] cgroup v2: Limits in parent nested control groups are not detected](https://mail.openjdk.org/pipermail/jdk-updates-dev/2025-April/043206.html)
> 
> It has a patch dependency on PR 2 of 6: https://github.com/openjdk/jdk21u-dev/pull/1660
> 
> This backport is not clean as noticed by @MBaesken - `test/hotspot/jtreg/ProblemList.txt` was removing `containers/cgroup/PlainRead.java` but that testcase is missing in JDK21 so there is nothing to remove.
> 
> The backport also contains an additional oneliner (by Yuri Nesterenko):
> 
> make/data/hotspot-symbols/symbols-linux:
> +JVM_IsContainerized
> 
> as otherwise the build would fail with:
> 
> src/java.base/linux/native/libjava/CgroupMetrics.c:42:(.text+0x11): undefined reference to `JVM_IsContainerized'
> 
> This oneliner was not needed in JDK24 as there is [JDK-8017234: Hotspot should stop using mapfiles](https://bugs.openjdk.org/browse/JDK-8017234).
> 
> The whole patchset has been tested on CentOS-7.9 (for cgroup v1) and on Fedora 40 (for cgroup v2) for test/hotspot/jtreg/containers.

Jan Kratochvil has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains five additional commits since the last revision:

 - Merge branch 'devmaster' into devmaster-cgroup2reduced123-conflict
 - 8261242: [Linux] OSContainer::is_containerized() returns true when run outside a container
   
   Reviewed-by: stuefe, iklam
 - src/java.base/linux/native/libjava/CgroupMetrics.c:42:(.text+0x11): undefined reference to `JVM_IsContainerized'
    - a patch by Yuri Nesterenko
 - 8333326: Linux Alpine build fails after 8302744
   
   Reviewed-by: sgehwolf, clanger, stuefe
 - 8302744: Refactor Hotspot container detection code
   
   Reviewed-by: jsjolen, stuefe

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

Changes:
  - all: https://git.openjdk.org/jdk21u-dev/pull/1661/files
  - new: https://git.openjdk.org/jdk21u-dev/pull/1661/files/0aaf6294..b6ce753f

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk21u-dev&pr=1661&range=02
 - incr: https://webrevs.openjdk.org/?repo=jdk21u-dev&pr=1661&range=01-02

  Stats: 46046 lines in 2305 files changed: 25085 ins; 7291 del; 13670 mod
  Patch: https://git.openjdk.org/jdk21u-dev/pull/1661.diff
  Fetch: git fetch https://git.openjdk.org/jdk21u-dev.git pull/1661/head:pull/1661

PR: https://git.openjdk.org/jdk21u-dev/pull/1661


More information about the jdk-updates-dev mailing list