Sharing debug details from jamesh

When starting snap applications via the shell, log messages like the following 
are produced:
Mar 21 18:07:49 MGLT-Ubuntu chromium_chromium.desktop[13099]: 
/user.slice/user-1000.slice/[email protected]/app.slice/app-gnome-chromium_chromium-13099.scope
 is not a snap cgroup

This error is triggered in snapd’s device-cgroup-support.c, where it
expects the process to be in a cgroup created by snapd but finds it in
an app-gnome-*.scope cgroup instead. I think this is down to a race
condition between gnome-shell and snapd.

On the gnome-shell side, it’s doing:

    spawns the app via GLib.spawn_async, which returns the pid of the
running child process.

    Calls GnomeDesktop.start_systemd_scope on the pid.

    start_systemd_scope calls the systemd StartTransientUnit D-Bus
method to move the pid to the app-gnome-*.scope cgroup.

On the snap side:

    the executables in /snap/bin are equivalent to running snap run
snapname.

    the snap run code asks systemd to move its own pid to a snap.*.scope
cgroup via StartTransientUnit.

    it then execs /usr/lib/snapd/snap-confine to set up the sandbox.
This includes the device-cgroup-support.c code with the cgroup check.

    if it could set up the sandbox correctly, snap-confine execs the
sandboxed application.

I think the problem occurs if gnome-shell’s StartTransientUnit call
occurs between steps (2) and (3) on the snap side.

** Changed in: snapd (Ubuntu)
   Importance: Undecided => High

** Also affects: gnome-shell (Ubuntu)
   Importance: Undecided
       Status: New

** Changed in: gnome-shell (Ubuntu)
   Importance: Undecided => Critical

** Tags added: rls-ll-incoming

-- 
You received this bug notification because you are a member of Ubuntu
Desktop Bugs, which is subscribed to gnome-shell in Ubuntu.
https://bugs.launchpad.net/bugs/2011806

Title:
  [lunar] Snaps don't launch due to cgroup issue

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gnome-shell/+bug/2011806/+subscriptions


-- 
desktop-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/desktop-bugs

Reply via email to