RFR: 8354057: Odd debug output in -Xlog:os+container=debug on certain systems
Thomas Fitzsimmons
duke at openjdk.org
Thu Apr 10 13:49:31 UTC 2025
On Thu, 10 Apr 2025 02:18:02 GMT, David Holmes <dholmes 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.
Thank you for reviewing @dholmes-ora. Adding to @jerboaa's latest comment, here is output from a `RHEL 8` system which is unaffected by JDK-8354057 because it does not issue the `controller %s is not enabled` message:
[0.000s][trace][os,container] OSContainer::init: Initializing Container Support
[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] Adjusting controller path for memory: /sys/fs/cgroup/memory/user.slice/user-1000.slice/session-99.scope
[...]
This output is unchanged by the patch I am proposing in this pull request. I probably should have included a note about this in the description.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/24533#issuecomment-2793203752
More information about the hotspot-runtime-dev
mailing list