RFR: 8272124: Cgroup v1 initialization causes NullPointerException when path contains colon

Harold Seigel hseigel at openjdk.java.net
Tue Aug 17 17:39:49 UTC 2021


On Mon, 16 Aug 2021 17:25:57 GMT, Harold Seigel <hseigel at openjdk.org> wrote:

> Please review this small fix for JDK-8272124.  The fix puts a limit of 3 when splitting self cgroup lines by ':' so that Cgroup paths won't get truncated if they contain embedded ':'s.  For example, an entry of "11:memory:/user.sli:ce" in a /proc/self/cgroup file will now result in a Cgroup path of "/user.sli:ce" instead of "/user.sli".
> 
> The fix was tested with Mach5 tiers 1 and 2, and Mach5 tiers 3-5 on Linux x64 and Linux aarch64.
> 
> Thanks, Harold

Thanks Misha and Severin for looking at this change!

Please review this updated commit that tries to address Severin's comments.  A new test case was added to TestCgroupSubsystemFactory.java for the multiple ':'s case and comments were added to CgroupSubsystemFactory.java.

The ".filter(tokens -> (tokens.length >= 3))" code was removed but can be restored if need be.

Thanks, Harold

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

PR: https://git.openjdk.java.net/jdk/pull/5127


More information about the serviceability-dev mailing list