refresh-app-awareness=true does not seem to concern dependencies

Bug #1944447 reported by Francois Thirioux
44
This bug affects 8 people
Affects Status Importance Assigned to Milestone
snapd
Confirmed
Medium
Samuele Pedroni

Bug Description

0) refresh-app-awareness=true is set
1) Firefox snap is started & runs
2) gnome 3.38 snap is manually updated
3) Firefox crashes

I thought the refresh option blocked updates of running snaps dependencies, but nope.
Is that intended for manual updates?
The auto background updates of dependencies are blocked?

Revision history for this message
Ian Johnson (anonymouse67) wrote :

Hi, can you provide the output of

snap version
snap list

Thanks

Changed in snapd:
status: New → Incomplete
Changed in snapd (Ubuntu):
status: New → Incomplete
Revision history for this message
Francois Thirioux (fthx) wrote :

snap version

snap 2.51.4
snapd 2.51.4
series 16
ubuntu 21.10
kernel 5.13.0-16-generic

snap list

Nom Version Révision Suivi Éditeur Notes
bare 1.0 5 latest/stable canonical✓ base
chromium 93.0.4577.82 1753 latest/stable canonical✓ -
chromium-ffmpeg 0.1 23 latest/stable canonical✓ -
code 83bd43bc 74 latest/stable vscode✓ classic
core 16-2.51.4 11606 latest/stable canonical✓ core
core18 20210722 2128 latest/stable canonical✓ base
core20 20210702 1081 latest/stable canonical✓ base
firefox 92.0-3 595 latest/stable mozilla✓ -
foliate 2.6.3 1167 latest/stable johnfactotum -
gimp 2.10.24 372 latest/stable snapcrafters -
gnome-3-28-1804 3.28.0-19-g98f9e67.98f9e67 161 latest/stable canonical✓ -
gnome-3-34-1804 0+git.3556cb3 72 latest/stable canonical✓ -
gnome-3-38-2004 0+git.6ba6040 76 latest/stable canonical✓ -
gtk-common-themes 0.1-59-g7bca6ae 1519 latest/candidate canonical✓ -
inkscape 1.1-ce6663b3b7-2021-05-25 9090 latest/stable inkscape✓ -
libreoffice 7.2.0.4 229 latest/stable canonical✓ -
shortwave 1.1.1 13 latest/stable alexmurray -
snapd 2.51.4 12883 latest/stable canonical✓ snapd
stellarium-daily v0.21.1 887 latest/stable t4saha -
thunderbird 91.1.1 148 latest/candidate canonical✓ -
vlc 3.0.16 2344 latest/stable videolan✓ -
xournalpp 1.1.0 61 latest/stable ken-vandine -

Revision history for this message
Ian Johnson (anonymouse67) wrote :

Thanks for that information, for now I think that it is expected that refreshes to dependency snaps are not blocked by active snaps using those dependencies, but that is something I think we should explore doing automatically.

We are actively working on hooks which snaps can implement manually which would allow controlling this behavior and being notified of when a dependency is going to be refreshed and the running snap can decide to delay that refresh, but that work is not quite done yet, and would require work from individual snap authors, while the automatic feature I mentioned above would not require that manual work.

Revision history for this message
Ian Johnson (anonymouse67) wrote :

Hmm, actually though I cannot reproduce the specific crash/error on my machine, I was running the firefox snap and I tried both refreshing gnome-3-38-2004 from revision 61 -> 76 and the inverse of 76 -> 61, can you describe how the crash happened? Did you do some specific thing in firefox when the refresh happened that made it crash? I was just opening a new tab and browsing to a random news site to try and reproduce the crash.

To be clear, I can still see where some snaps may have issues with their dependencies being refreshed, so we will evaluate this for refresh-app-awareness, just that if we can't reproduce it on one of the "lighthouse" snaps like firefox it will be a lower priority for us to address.

Revision history for this message
Francois Thirioux (fthx) wrote :

Ok I've done some logs-crawling.

17h22, gnome snap refreshed

Just 1 minute after that, some Firefox logs:
ExceptionHandler::GenerateDump cloned child 40921
ExceptionHandler::SendContinueSignalToChild sent continue signal to child
ExceptionHandler::GenerateDump cloned child 40921
ExceptionHandler::WaitForContinueSignal waiting for continue signal...
AVC apparmor="DENIED" operation="open" profile="snap.firefox.firefox" name="/proc/40920/environ" pid=40921 comm="WRRende~kend#11" requested_mask="r" denied_mask="r" fsuid=1000 ouid=1000

SECCOMP auid=1000 uid=1000 gid=1000 ses=3 subj=snap.firefox.firefox pid=40922 comm="crashreporter" exe="/snap/firefox/595/usr/lib/firefox/crashreporter" sig=0 arch=c000003e syscall=314 compat=0 ip=0x7f82883d789d code=0x50000

audit: type=1326 audit(1632237822.594:590): auid=1000 uid=1000 gid=1000 ses=3 subj=snap.firefox.firefox pid=40922 comm="crashreporter" exe="/snap/firefox/595/usr/lib/firefox/crashreporter" sig=0 arch=c000003e syscall=314 compat=0 ip=0x7f82883d789d code=0x50000

Maybe that's a random crash, I'm not able to make the difference...! But FF snap nowadays crashes once a day, no more.

Revision history for this message
Zygmunt Krynicki (zyga) wrote :

Updating gnome snap will remove the mount points from the firefox snap mount namespace. It should not be done. I'm afraid r-a-a should be extended to prevent refreshes of any connected snaps with the content interface as well.

Revision history for this message
Ian Johnson (anonymouse67) wrote :

@fthx can you show the output of `snap changes` and `snap list gnome-3-38-2004 --all` ? What I suspect made your firefox crash is that the last revision of gnome-3-38-2004 that firefox was launched with was garbage collected out of existence

Revision history for this message
Francois Thirioux (fthx) wrote :

snap list gnome-3-38-2004 --all
Nom Version Révision Suivi Éditeur Notes
gnome-3-38-2004 0+git.6ba6040 70 latest/stable canonical✓ désactivé
gnome-3-38-2004 0+git.6ba6040 76 latest/stable canonical✓ -

I do not have nothing left in snap changes now...

Revision history for this message
Olivier Tilloy (osomon) wrote :

I saw a similar crash on Tuesday, when gnome-3-38-2004 was automatically refreshed from revision 39 to revision 76 under a running firefox (with refresh app awareness enabled). The next time I interacted with firefox, it crashed instantly.

Ian helped me debug the issue further in a private conversation, and he confirmed that the problem was with revision 39 that was garbage collected on my system.

Changed in snapd:
status: Incomplete → Confirmed
importance: Undecided → High
no longer affects: snapd (Ubuntu)
Revision history for this message
Harm van Bakel (hvbakel) wrote :

When the deb package updates, firefox displays an alert asking for a restart to avoid issues. It would be nice if the snap version does something similar when it or any of its dependencies are updated (in addition to or as a fallback for the r-a-a changes).

Right now a running firefox snap crashes hard when there are updates to either core, core20, gnome-3-38, or firefox itself. That averages to about a crash every 1-2 weeks and results in a poor user experience. I have used the firefox snap for about a year now as I like the extra sandboxing it provides, but I would not recommend including it as the default in an upcoming LTS until the problematic updating process is fully addressed.

Revision history for this message
Maximilian Federle (ppd) wrote :

Firefox crashes reliably when opening a new tab if you refresh gnome-3-38-2004 in the background.

State before:

```
$ snap list gnome-3-38-2004 --all
Name Version Rev Tracking Publisher Notes
gnome-3-38-2004 0+git.6ba6040 76 latest/candidate canonical✓ disabled
gnome-3-38-2004 0+git.cd626d1 87 latest/candidate canonical✓
```

After:
```
$ snap list gnome-3-38-2004 --all
Name Version Rev Tracking Publisher Notes
gnome-3-38-2004 0+git.cd626d1 87 latest/stable canonical✓ disabled
gnome-3-38-2004 0+git.6ba6040 76 latest/stable canonical✓ -

```

There is no garbage collection going on, I think. I just want to confirm that those crashes happen to me all the time. Firefox, at least, cannot tolerate it at all.

Changed in snapd:
assignee: nobody → Ian Johnson (anonymouse67)
Revision history for this message
Alexander Browne (elcste) wrote :

FWIW, I have this setting on, and I've noticed the GNOME snap will still update and then Chromium loses the cursor and icon theme until it's restarted. Not a crash, but still an unexpected behavio(u)r.

Changed in snapd:
importance: High → Medium
assignee: Ian Johnson (anonymouse67) → nobody
assignee: nobody → Samuele Pedroni (pedronis)
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.