mate-desktop / mate-system-monitor

Process viewer and system resource monitor for MATE
https://mate-desktop.org
GNU General Public License v2.0
45 stars 27 forks source link

check_cgroup_changed infinite loop #221

Open Prism019 opened 3 years ago

Prism019 commented 3 years ago

Expected behaviour

I'm unsure about the expected behaviour.

Actual behaviour

The program enters an infinite loop while checking to see if the cgroups of a process have changed. The bug is in the check_cgroup_changed function in src/cgroups.cpp found here

Steps to reproduce the behaviour

Start mate-system-monitor while a process exists that:

The "special case for root cgroup" block will be entered, where the tmp variable will be incremented by 0 on each loop, as the controller is an empty string. I am able to create a process that exhibits this behaviour by starting a QEMU virtual machine through virt-manager. The offending cgroup entry is 0::/ of the kvm-nx-lpage-re kernel module.

$ cat /proc/29363/cgroup
14:rdma:/
13:pids:/
12:hugetlb:/
11:net_prio:/
10:perf_event:/machine/qemu-4-devos.libvirt-qemu
9:net_cls:/machine/qemu-4-devos.libvirt-qemu
8:freezer:/machine/qemu-4-devos.libvirt-qemu
7:devices:/machine/qemu-4-devos.libvirt-qemu
6:memory:/machine/qemu-4-devos.libvirt-qemu
5:blkio:/machine/qemu-4-devos.libvirt-qemu
4:cpuacct:/machine/qemu-4-devos.libvirt-qemu/emulator
3:cpu:/machine/qemu-4-devos.libvirt-qemu/emulator
2:cpuset:/machine/qemu-4-devos.libvirt-qemu/emulator
1:name=openrc:/libvirtd
0::/

MATE general version

1.24.2

Package version

80640c9b

Linux Distribution

Arch Linux x86_64

Link to bugreport of your Distribution (requirement)

Arch does not modify the build steps or source in any way. This is purely an issue with mate-system-monitor.