RFR: 8286212: Cgroup v1 initialization causes NPE on some systems [v2]

Severin Gehwolf sgehwolf at openjdk.java.net
Tue May 17 08:15:40 UTC 2022


On Tue, 17 May 2022 07:14:34 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

>> src/hotspot/os/linux/cgroupV1Subsystem_linux.cpp line 92:
>> 
>>> 90:           }
>>> 91:           ss.print_raw(_root, last_matching_slash_pos);
>>> 92:           _path = os::strdup(ss.base());
>> 
>> Do you mean `Find the longest common prefix`? Maybe give an example in the comments? Text parsing in C code is really difficult to understand.
>
> Maybe factor out the search like this
> 
> // Return length of common starting substring. E.g. "cat" for ("cattle", "catnip");
> static int find_common_starting_substring(const char* s1, const char* s2) {
> ...
> }
> 
> That way its clearer and we can find and move this to utilities if we ever need this in other places.

OK.

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

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


More information about the serviceability-dev mailing list