snapd updates gnome snap while connected firefox snap is running, breaking the running app
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
snapd (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
I had my Firefox unexpectedly say that "An update to Firefox started in the background", just after I had started my computer, started Firefox, and joined a video meeting.
I figured that maybe the Firefox snap had updated, so I did "snap changes", but that didn't show any update to Firefox. Instead I see an update to a Gnome snap at about the time Firefox decided it had been updated, and falling inside the time period when I had Firefox running and was actively using it:
$ snap changes
ID Status Spawn Ready Summary
544 Done today at 09:15 EDT today at 09:16 EDT Auto-refresh snap "drawio"
545 Done today at 18:49 EDT today at 18:49 EDT Auto-refresh snap "gnome-42-2204"
I was unable to properly use my browser during my meeting. After a few more minutes, my Firefox crashed, ejecting me from my meeting and putting this in my syslog:
Jun 8 19:29:16 octagon firefox_
Jun 8 19:29:16 octagon firefox_
Jun 8 19:29:16 octagon firefox_
Jun 8 19:29:16 octagon firefox_
Jun 8 19:29:16 octagon firefox_
Jun 8 19:29:16 octagon firefox_
Jun 8 19:29:16 octagon firefox_
Jun 8 19:29:16 octagon firefox_
Jun 8 19:29:16 octagon kernel: [ 2717.092890] audit: type=1400 audit(168626695
Jun 8 19:29:16 octagon firefox_
Jun 8 19:29:16 octagon firefox_
Jun 8 19:29:16 octagon firefox_
Jun 8 19:29:16 octagon firefox_
Jun 8 19:29:16 octagon firefox_
Jun 8 19:29:16 octagon firefox_
Jun 8 19:29:16 octagon firefox_
Jun 8 19:29:16 octagon firefox_
Jun 8 19:29:16 octagon firefox_
Jun 8 19:29:16 octagon firefox_
Jun 8 19:29:16 octagon firefox_
Jun 8 19:29:16 octagon systemd[8282]: snap.firefox.
I suspect that the problem is that the gnome-42-2204 snap was updated *while in use by Firefox*.
Firefox apparently decides that an update to it has "started in the background" when the application or its loaded libraries change on disk. I think maybe some libraries from the Gnome snap get exposed to the Firefox snap, and that's how Firefox is finding out that the Gnome snap updated?
If this is indeed the cause of the problem, then sanpd's behavior for preventing updates to running applications needs to be changed to also prevent updates to the *dependency* snaps in use by those applications.
ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: snapd 2.58+22.04.1
ProcVersionSign
Uname: Linux 5.15.0-73-generic x86_64
NonfreeKernelMo
ApportVersion: 2.20.11-0ubuntu82.5
Architecture: amd64
CasperMD5CheckR
CurrentDesktop: ubuntu:GNOME
Date: Thu Jun 8 19:49:17 2023
InstallationDate: Installed on 2017-08-06 (2132 days ago)
InstallationMedia: Ubuntu 17.04 "Zesty Zapus" - Release amd64 (20170412)
SourcePackage: snapd
UpgradeStatus: Upgraded to jammy on 2023-05-19 (20 days ago)
modified.
mtime.conffile.
I can sort of reproduce this on demand by, while Firefox is running, doing a "snap remove gnome-42-2204" followed by a "snap install gnome-42-2204". Removing the Snap doesn't seem to cause a problem immediately, but after reinstalling it, any Firefox tab will crash and produce the gah-your- tab-crashed message when I try to navigate to a new page.
So it is definitely not safe to operate on the gnome-42-2204 snap while the Firefox snap is running, and snapd needs to learn to take this into account.