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

Thomas Fitzsimmons duke at openjdk.org
Wed Apr 9 15:51:56 UTC 2025


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*"

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

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

Changes: https://git.openjdk.org/jdk/pull/24533/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=24533&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8354057
  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/24533.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/24533/head:pull/24533

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


More information about the hotspot-runtime-dev mailing list