snapd updates gnome snap while connected firefox snap is running, breaking the running app

Bug #2023344 reported by Adam Novak
12
This bug affects 2 people
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_firefox.desktop[16799]: [Parent 16799, IPC I/O Parent] WARNING: process 178972 exited with status 127: file /build/firefox/parts/firefox/build/ipc/chromium/src/base/process_util_posix.cc:270
Jun 8 19:29:16 octagon firefox_firefox.desktop[16799]: [Parent 16799, IPC I/O Parent] WARNING: process 178975 exited with status 127: file /build/firefox/parts/firefox/build/ipc/chromium/src/base/process_util_posix.cc:270
Jun 8 19:29:16 octagon firefox_firefox.desktop[16799]: [Parent 16799, IPC I/O Parent] WARNING: process 178978 exited with status 127: file /build/firefox/parts/firefox/build/ipc/chromium/src/base/process_util_posix.cc:270
Jun 8 19:29:16 octagon firefox_firefox.desktop[16799]: [Parent 16799, IPC I/O Parent] WARNING: process 178981 exited with status 127: file /build/firefox/parts/firefox/build/ipc/chromium/src/base/process_util_posix.cc:270
Jun 8 19:29:16 octagon firefox_firefox.desktop[178990]: ExceptionHandler::WaitForContinueSignal waiting for continue signal...
Jun 8 19:29:16 octagon firefox_firefox.desktop[16799]: ExceptionHandler::GenerateDump cloned child 178990
Jun 8 19:29:16 octagon firefox_firefox.desktop[16799]: ExceptionHandler::SendContinueSignalToChild sent continue signal to child
Jun 8 19:29:16 octagon firefox_firefox.desktop[16799]: [Parent 16799, IPC I/O Parent] WARNING: process 178984 exited with status 127: file /build/firefox/parts/firefox/build/ipc/chromium/src/base/process_util_posix.cc:270
Jun 8 19:29:16 octagon kernel: [ 2717.092890] audit: type=1400 audit(1686266956.667:297): apparmor="DENIED" operation="open" profile="snap.firefox.firefox" name="/proc/19094/environ" pid=178990 comm="firefox:cs0" requested_mask="r" denied_mask="r" fsuid=1000 ouid=1000
Jun 8 19:29:16 octagon firefox_firefox.desktop[16799]: [Parent 16799, IPC I/O Parent] WARNING: process 178987 exited with status 127: file /build/firefox/parts/firefox/build/ipc/chromium/src/base/process_util_posix.cc:270
Jun 8 19:29:16 octagon firefox_firefox.desktop[29346]: Exiting due to channel error.
Jun 8 19:29:16 octagon firefox_firefox.desktop[29986]: Exiting due to channel error.
Jun 8 19:29:16 octagon firefox_firefox.desktop[29365]: Exiting due to channel error.
Jun 8 19:29:16 octagon firefox_firefox.desktop[27878]: Exiting due to channel error.
Jun 8 19:29:16 octagon firefox_firefox.desktop[26969]: Exiting due to channel error.
Jun 8 19:29:16 octagon firefox_firefox.desktop[26907]: Exiting due to channel error.
Jun 8 19:29:16 octagon firefox_firefox.desktop[38179]: Exiting due to channel error.
Jun 8 19:29:16 octagon firefox_firefox.desktop[19602]: Exiting due to channel error.
Jun 8 19:29:16 octagon firefox_firefox.desktop[21002]: Exiting due to channel error.
Jun 8 19:29:16 octagon firefox_firefox.desktop[19173]: Exiting due to channel error.
Jun 8 19:29:16 octagon systemd[8282]: snap.firefox.firefox.7381adcb-8148-464a-8c1f-8176d0409dcf.scope: Consumed 1h 12min 37.106s CPU time.

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
ProcVersionSignature: Ubuntu 5.15.0-73.80-generic 5.15.98
Uname: Linux 5.15.0-73-generic x86_64
NonfreeKernelModules: zfs zunicode zavl icp zcommon znvpair
ApportVersion: 2.20.11-0ubuntu82.5
Architecture: amd64
CasperMD5CheckResult: unknown
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.conffile..etc.default.apport: [modified]
mtime.conffile..etc.default.apport: 2017-10-28T16:09:59.863087

Revision history for this message
Adam Novak (interfect) wrote :
Revision history for this message
Adam Novak (interfect) wrote :

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.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in snapd (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.