Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 878991 - sys-cluster/slurm: cgroup v2 doesn't parse /sys/fs/cgroup/cgroup.controllers as it should
Summary: sys-cluster/slurm: cgroup v2 doesn't parse /sys/fs/cgroup/cgroup.controllers ...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Alexey Shvetsov
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2022-11-01 09:22 UTC by foufou33
Modified: 2022-11-03 06:52 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
patch (fix-cgroup-controller-parsing.patch,415 bytes, patch)
2022-11-01 09:25 UTC, foufou33
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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]
patch

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
Thanks!