"[" (fscanf) Matches ONLY a nonempty sequence of characters from the specified set. This is good enough for cgroups version 1 but when you are in a pure cgroups version 2 environment probably you need to be able to parse the "0::/some_path" chain. This chain should be parseable by the scanf line but it is not due to the reason exposed early: int scanResult = fscanf(cgroupControllerFile, "%*u:%" STRINGIFY(CGROUP_NAME_BUFFER_SIZE) "[^:]:%" STRINGIFY(PATH_MAX) "[^\n]", name, path); From cgroups man page: The colon-separated fields are, from left to right: 1. For cgroups version 1 hierarchies, this field contains a unique hierarchy ID number that can be matched to a hierar‐ chy ID in /proc/cgroups. For the cgroups version 2 hierar‐ chy, this field contains the value 0. 2. For cgroups version 1 hierarchies, this field contains a comma-separated list of the controllers bound to the hier‐ archy. For the cgroups version 2 hierarchy, this field is empty. 3. This field contains the pathname of the control group in the hierarchy to which the process belongs. This pathname is relative to the mount point of the hierarchy.
Created attachment 402865 [details] patch
Comment on attachment 402865 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=402865&action=review > Source/WebKit/UIProcess/linux/MemoryPressureMonitor.cpp:220 > + // cgroupv2 You can remove this comment because the comparisong with the CGROUP_V2_HIERARCHY constant in the line right above is self-explanatory—which is why we like using constants with meaningful names, of course :)
Created attachment 402900 [details] patch
(In reply to Adrian Perez from comment #2) > Comment on attachment 402865 [details] > patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=402865&action=review > > > Source/WebKit/UIProcess/linux/MemoryPressureMonitor.cpp:220 > > + // cgroupv2 > > You can remove this comment because the comparisong with > the CGROUP_V2_HIERARCHY constant in the line right above > is self-explanatory—which is why we like using constants > with meaningful names, of course :) done.
Committed r263589: <https://trac.webkit.org/changeset/263589> All reviewed patches have been landed. Closing bug and clearing flags on attachment 402900 [details].
Debug build fixed in https://trac.webkit.org/changeset/263632/webkit ...