Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 878991

Summary: sys-cluster/slurm: cgroup v2 doesn't parse /sys/fs/cgroup/cgroup.controllers as it should
Product: Gentoo Linux Reporter: foufou33
Component: Current packagesAssignee: Alexey Shvetsov <alexxy>
Status: UNCONFIRMED ---    
Severity: normal CC: cluster
Priority: Normal Keywords: PATCH
Version: unspecified   
Hardware: All   
OS: Linux   
See Also:
Package list:
Runtime testing required: ---
Attachments: patch

Description foufou33 2022-11-01 09:22:52 UTC
while parsing /sys/fs/cgroup/cgroup.controllers to get the list of controller _get_controllers (src/plugins/cgroup/v2/cgroup_v2.c) doesn't trim the \n at the end. as a result it fails if any of the cgroups controller the plugin is intereseted in happens to be last.

#cat /sys/fs/cgroup/cgroup.controllers
cpuset cpu io memory

Reproducible: Always

Steps to Reproduce:
1. install and configure slurmd
2. enable cgroup_V2 plugin 
3. start slurmd 

Actual Results:  
slurmd fails to detect the last cgroup controller in /sys/fs/cgroup/cgroup.controllers (in my case it was the memory controller). and complains in logs 

Expected Results:  
said cgroup detected une used

the probleme stems from th4e fact that theres a new line in /sys/fs/cgroup/cgroup.controllers and at no point _get_controllers tries to get rid of it!
Comment 1 foufou33 2022-11-01 09:25:20 UTC
Created attachment 826279 [details, diff]

adding '\n' to delimitiers of strtok() solves the problem
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-11-03 01:33:38 UTC
Could you send the patch upstream to slurm please?
Comment 3 foufou33 2022-11-03 06:47:04 UTC
just did!
(I did open a bug report there before doing it here though, I just omitted the patch)
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-11-03 06:52:37 UTC