Files
snapd/tests/main
Alberto Mardegan f84cbd92cf sandbox/cgroup: don't check V1 cgroup if V2 is active
* sandbox/cgroup: don't check V1 cgroup if V2 is active

The cgroup V1 hierarchy behaves similarly to the V2 one when it is
unmounted: the hierarchy will be visible on the filesystem while there
is at least one process using it, but it will not appear as mounted in
/proc/mounts. Even more importantly, when systemd creates a transient
scope in such a situation, the cgroup V2 will be correctly reported in
/proc/<self>/cgroup, whereas the V1 group will be

    1:name=systemd:/

(that is, the cgroup path is incorrect). In such cases, depending on the
order in which the entries appear in the /proc/<self>/cgroup file, snapd
could incorrectly think that the process has been placed in the `/`
cgroup path.

To fix the above, we consider the V1 hierarchy only if the V2 one has
not been mounted: when the V2 hierarchy is mounted, we know that this is
what will be used by us and by systemd.

Issue raised in https://forum.snapcraft.io/t/snap-freezes-after-update-to-ubuntu-22-04/31413

* sandbox/cgroup: update comment about stale hierarchy

* tests/main/cgroup-devices-v2: allow repeating, improve debugging

Extend the "restore" step to make sure that the test can be executed
multiple times with the `-repeat` spread option.

While we are there, also add a "debug" step to print the IDs of the BPF
maps.

* sandbox: tweak comments in ProcessPathInTrackingCgroup (thanks to Samuele)

Co-authored-by: Michael Vogt <mvo@ubuntu.com>
2022-09-15 08:19:15 +02:00
..
2021-06-09 18:03:24 -03:00
2021-05-17 19:11:12 -03:00
2021-04-13 07:13:20 -03:00
2021-09-16 19:01:39 +01:00
2021-05-26 14:29:24 -03:00
2021-07-23 15:44:43 -03:00
2021-04-21 09:08:50 -03:00
2021-03-10 08:41:31 -03:00
2022-07-14 00:22:15 -03:00
2022-07-14 00:22:15 -03:00
2021-04-21 09:08:50 -03:00
2021-04-21 09:08:50 -03:00
2021-06-09 18:03:24 -03:00
2021-03-04 09:27:19 -03:00
2021-04-21 09:08:50 -03:00
2021-04-08 15:05:29 -03:00
2021-08-31 14:49:47 -03:00