Drawing snap not working

Hey @kenvandine,

Installed your Drawing snap today, but was unable to use it - it crashes, output below. Anything I can do to help you troubleshoot this problem? Using Ubuntu 18.04, Snapd 2.40+18.04.

Gtk-Message: 23:31:35.497: Failed to load module "canberra-gtk-module"

(com.github.maoschanz.drawing:30537): Gtk-WARNING **: 23:31:35.748: Attempting to add a widget with type GtkFlowBox to a container of type GtkBox, but the widget is already inside a container of type GtkBox, please remove the widget from its existing container first.
activation du panneau …
… panneau activé

(com.github.maoschanz.drawing:30537): Pango-CRITICAL **: 23:31:35.861: pango_layout_set_width: assertion 'layout != NULL' failed

(com.github.maoschanz.drawing:30537): Pango-CRITICAL **: 23:31:35.861: pango_layout_set_alignment: assertion 'layout != NULL' failed

(com.github.maoschanz.drawing:30537): Pango-CRITICAL **: 23:31:35.861: pango_layout_set_text: assertion 'layout != NULL' failed
free(): invalid pointer
Aborted (core dumped)

Thanks,
Ivo

FWIW I see similar behavior with edge and stable channels on Ubuntu 19.04 for me, but I do see the window for a split second before it dies. The log message I get doesn’t include the Pango messages however.

Also I see the following denials in the system journal when this happens:

Oct 14 13:17:10 kernel: audit: type=1400 audit(1571077030.803:324): apparmor="DENIED" operation="open" profile="snap.drawing.drawing" name="/proc/94387/mounts" pid=94387 comm="drawing" requested_mask="r" denied_mask="r" fsuid=1000 ouid=1000
Oct 14 13:17:11 audit[94387]: AVC apparmor="DENIED" operation="open" profile="snap.drawing.drawing" name="/var/lib/snapd/desktop/icons/" pid=94387 comm="drawing" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
Oct 14 13:17:11 dbus-daemon[5211]: apparmor="DENIED" operation="dbus_method_call"  bus="session" path="/org/gnome/Shell/Screenshot" interface="org.freedesktop.DBus.Properties" member="GetAll" mask="send" name=":1.21" pid=94387 label="snap.drawing.drawing" peer_pid=5400 peer_label="unconfined"

Likely just noise. Could connect mount-observe to be sure.

Per @jamesh, also likely just noise. Could update the apparmor profile temporarily to have /var/lib/snapd/desktop/icons/{,**} r, to be sure.

I suspect this is the culprit and the app isn’t handling the access denied gracefully. Try connecting the screencast-legacy interface.

The snap doesn’t seem to plug that currently, so perhaps that’s the issue. If I get some more time I will try adding that interface to the snap

Adding the screencast-legacy interface doesn’t seem to fix the issue.

Since the app also crashes in devmode, can we rule out that it’s a confinement issue?

This appears to be a regression in snapd. The app hasn’t been updated since I last tried it, and it used to work. Is there a way for me to test previous snapd versions?

Seems limited to 19.04. I’m on 19.10 and the drawing app works fine.

Anything in dmesg when it crashes?

Nothing new:

[ 5894.420505] audit: type=1400 audit(1571255503.291:1408): apparmor="ALLOWED" operation="open" profile="snap.drawing.drawing" name="/proc/15266/mounts" pid=15266 comm="drawing" requested_mask="r" denied_mask="r" fsuid=1000 ouid=1000
[ 5894.638403] audit: type=1400 audit(1571255503.507:1409): apparmor="ALLOWED" operation="open" profile="snap.drawing.drawing" name="/var/lib/snapd/desktop/icons/" pid=15266 comm="drawing" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0

I can confirm it also works in 18.04 proper.

I can confirm it doesn’t work on my 18.04 (neither stable or edge). How can I help?

journalctl output follows.

audit[13686]: AVC apparmor="DENIED" operation="open" profile="snap.drawing.drawing" name="/proc/13686/mounts" pid=13686 comm="drawing" requested_mask="r" denied_mask="r" fsuid=1000 ouid=1000
audit: type=1400 audit(1571272770.990:166): apparmor="DENIED" operation="open" profile="snap.drawing.drawing" name="/proc/13686/mounts" pid=13686 comm="drawing" requested_mask="r" denied_mask="r" fsuid=1000 ouid=1000
audit[13686]: AVC apparmor="DENIED" operation="open" profile="snap.drawing.drawing" name="/var/lib/snapd/desktop/icons/" pid=13686 comm="drawing" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
audit: type=1400 audit(1571272771.314:167): apparmor="DENIED" operation="open" profile="snap.drawing.drawing" name="/var/lib/snapd/desktop/icons/" pid=13686 comm="drawing" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
dbus-daemon[3693]: apparmor="DENIED" operation="dbus_method_call"  bus="session" path="/org/gnome/Shell/Screenshot" interface="org.freedesktop.DBus.Properties" member="GetAll" mask="send" name=":1.21" pid=13686 label="snap.drawing.drawing" peer_pid=3819 peer_label="unconfined"
dbus-daemon[3693]: apparmor="DENIED" operation="dbus_method_call"  bus="session" path="/org/gnome/Shell/Screenshot" interface="org.freedesktop.DBus.Properties" member="GetAll" mask="send" name=":1.21" pid=13686 label="snap.drawing.drawing" peer_pid=3819 peer_label="unconfined"
$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.3 LTS"

What separates this snap from others is its use of the gnome-3-32-1804 platform-snap. I have a few test snaps that use this particular content plug that have started failing just like this too.

I’m certain these snaps were all working fine last Friday (11-10-2019) as I was testing them particularly to release the now stable gnome-3-32-1804 (Installing older versions of drawing and/or the gnome-3-32-1804 snap doesn’t fix things either btw).

Now this is weird, I can reproduce this on Disco and Eoan, but not on Bionic. Then, even weirder, if I run Disco or Eoan in a VM with ‘3D Acceleration’ disabled, it works! On the surface, it would seem this is something GL related. Though, LIBGL_ALWAYS_SOFTWARE=1 snap run drawing does not work.

1 Like

UPDATE:

strace reveals that the last thing the snap does before crashing is load Yaru icons. So on a hunch I decided to try switching my Applications theme to Adwaita - no luck, still crashed. Switched to HighContrast, and… it worked… no crash!

I then noticed that although the snap was working on Bionic, the Ambiance theming looked off, so I switched theme to Adwaita and boom! crash.

Now, I’m just brain dumping here in case someone has a good idea. I’m not sure that this is not gnome-3-32-1804’s (my) fault. Either way, these notes will come in handy :slight_smile:

2 Likes

I tried the same, after your results, and it works ideed - accel disabled VM, 18.04, and Drawing works. I can see some visual glitches though - the red “discard” button, “save” button top bleeding to the title bar and others… I’m using Adwaita dark theme.

image
image

Things just keep getting stranger… I just installed Eoan fresh on one of my machines, installed updates, installed the drawing snap - works perfectly. No issues whatsoever.

UPDATE:

Alright, the snap started core dumping on the above machine.

I’m pretty sure the iso I used to install was a daily build from 12th October, so it struck me that perhaps one of the seeded snaps that came with the iso was working and subsequently broke with a refresh some time after.

I noticed that the gtk-common-themes snap updated from 1313 to 1353 so, considering the theming issues we saw, I tried a snap revert gtk-common-themes, and yeah, fixed, no more crash.

1 Like

Tried this, reverted to 1313 and even forwarded to 1358 (edge), no luck: still same problem.
:confused:

Ah, do you happen to be on Adwaita or Yaru-light? I just noticed that on 1313, these themes still cause the crash, while standard Yaru, Yaru-dark, and the HighContrast themes allow drawing to launch just fine.

You’re absolutely right, I was using Adwaita. Changing to High Contrast, for example, makes Drawing work; changing back to Adwaita while Drawing is open crashes the app.

Very strange…

It seems that latest gnome-3-32-1804 (0+git.635fbdc build 75) made Drawing work. Hope it gets stable now.

1 Like

Hey @ivo.cavalcante, yeah the issue was narrowed down yesterday. We should be good for all snaps that use gnome-3-32-1804 now. Thanks for your help :slight_smile:

Not at all, I’m the one who should thank you! :slight_smile:

@kenvandine are you aware that upstream have “issues” with the snap version? - apparently the v0.5 should not have been snapped https://github.com/maoschanz/drawing/issues/125