mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8272124: Cgroup v1 initialization causes NullPointerException when cgroup path contains colon
Reviewed-by: mseledtsov, sgehwolf
This commit is contained in:
parent
30b0f820ce
commit
4d6593ce02
2 changed files with 57 additions and 3 deletions
|
@ -196,9 +196,10 @@ public class CgroupSubsystemFactory {
|
|||
if (isCgroupsV2) {
|
||||
action = (tokens -> setCgroupV2Path(infos, tokens));
|
||||
}
|
||||
selfCgroupLines.map(line -> line.split(":"))
|
||||
.filter(tokens -> (tokens.length >= 3))
|
||||
.forEach(action);
|
||||
// The limit value of 3 is because /proc/self/cgroup contains three
|
||||
// colon-separated tokens per line. The last token, cgroup path, might
|
||||
// contain a ':'.
|
||||
selfCgroupLines.map(line -> line.split(":", 3)).forEach(action);
|
||||
}
|
||||
|
||||
CgroupTypeResult result = new CgroupTypeResult(isCgroupsV2,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue