Integrated: 8300645: Handle julong values in logging of GET_CONTAINER_INFO macros

Severin Gehwolf sgehwolf at openjdk.org
Thu Feb 16 10:11:38 UTC 2023


On Tue, 24 Jan 2023 13:16:31 GMT, Severin Gehwolf <sgehwolf at openjdk.org> wrote:

> Please review this change to Hotspot's container detection code. It adjusts the `GET_CONTAINER_INFO` macro to account for the fact that the return type, and thus the format for logging, being unsigned. Thanks to @iklam for the suggestion. 
> 
> This fixes an oddity where on error, i.e. a file doesn't exist a negative number is being returned from the `GET_CONTAINER_INFO` macro, which potentially logs values. This results in incorrect log output as `-2` gets converted to `unsigned long` and printed according to that format.
> 
> Testing:
> - [x] Container tests on x86_64 fastdebug with cgroup v1 (legacy), with and without `swapaccount=0`.
> - [x] Container tests on x86_64 fastdebug with cgroup v2 (unified), with and without `swapaccount=0`.
> - [x] Added regression test. Fails on cg v1 with `swappaccount=0` on unpatched. Passes after this patch.
> - [x] GHA

This pull request has now been integrated.

Changeset: 53ae4c07
Author:    Severin Gehwolf <sgehwolf at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/53ae4c07fda69358fc0b2edadf8dbfe6428de619
Stats:     51 lines in 5 files changed: 29 ins; 0 del; 22 mod

8300645: Handle julong values in logging of GET_CONTAINER_INFO macros

Reviewed-by: iklam

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

PR: https://git.openjdk.org/jdk/pull/12166


More information about the hotspot-runtime-dev mailing list