RFR: 8354057: Odd debug output in -Xlog:os+container=debug on certain systems

David Holmes dholmes at openjdk.org
Thu Apr 10 02:21:34 UTC 2025


On Wed, 9 Apr 2025 02:05:15 GMT, Thomas Fitzsimmons <duke at openjdk.org> wrote:

> The issue was a trailing newline in a message argument to:
> 
> 
> log_debug(os, container)(...)
> 
> 
> `log_debug` implicitly appends a newline to the message, so the extra newline resulted in empty lines in the trace output.
> 
> The old vs new output on my `Alpine Linux v3.21` virtual machine is:
> 
> 
> --- tt-old-alpine-legacy.txt	2025-04-08 21:49:31.847415499 -0400
> +++ tt-new-alpine-legacy.txt	2025-04-08 21:48:51.486322068 -0400
> @@ -1,10 +1,8 @@
>  [0.000s][trace][os,container] OSContainer::init: Initializing Container Support
>  [0.000s][debug][os,container] Detected optional pids controller entry in /proc/cgroups
>  [0.000s][debug][os,container] controller cpuset is not enabled
> -[                           ] 
>  [0.000s][debug][os,container] controller memory is not enabled
> -[                           ] 
>  [0.000s][debug][os,container] One or more required controllers disabled at kernel level.
>  openjdk version "25-internal" 2025-09-16
> -OpenJDK Runtime Environment (fastdebug build 25-internal-adhoc.fitzsim.jdk-old)
> -OpenJDK 64-Bit Server VM (fastdebug build 25-internal-adhoc.fitzsim.jdk-old, mixed mode)
> +OpenJDK Runtime Environment (fastdebug build 25-internal-adhoc.fitzsim.jdk)
> +OpenJDK 64-Bit Server VM (fastdebug build 25-internal-adhoc.fitzsim.jdk, mixed mode)
> 
> 
> Regression-tested with:
> 
> 
> make exploded-test TEST="test/hotspot/jtreg/containers test/jdk/jdk/internal/platform/cgroup gtest:cgroupTest*"

Hold on a minute! If only _some_ systems have this problem then only some systems generate their own newline, which implies the other systems need the newline added by UL!

Maybe we need to check the actual return value and see if it ends with a newline. Or change the parsing code so that is strips any newline.

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

PR Comment: https://git.openjdk.org/jdk/pull/24533#issuecomment-2791381380


More information about the hotspot-runtime-dev mailing list