Gimp and glimpse editor snaps segfault on Arch

I was notified of a problem with glimpse-editor snap segfaulting on Arch and was able to reproduce the problem. The issue is described here: https://github.com/glimpse-editor/Glimpse/issues/381

Since @hellsworth mentioned that glimpse-editor is build based on snapcraft.yaml from gimp snap, I tried that other snap too, with similar results.

When starting gimp snap I see this logged to the console:

maciek@galeon:~/work/canonical snap run glimpse-editor.glimpse-editor                                                                                                                                                                <<< 133 ↵
Gtk-Message: 19:04:56.292: Failed to load module "canberra-gtk-module"
/snap/glimpse-editor/83/usr/bin/glimpse: Gimp-Widgets-WARNING: parse_iso_codes: error parsing '/build/glimpse-editor/parts/glimpse/install/usr/share/xml/iso-codes/iso_639.xml': No such file or directory

Fontconfig warning: FcPattern object weight does not accept value [40 210)
/snap/glimpse-editor/83/usr/bin/glimpse: Gimp-Text-CRITICAL: gimp_font_factory_load_names: assertion 'fontset' failed

(glimpse:62683): GdkPixbuf-CRITICAL **: 19:04:59.750: gdk_pixbuf_scale_simple: assertion 'dest_width > 0' failed

(glimpse:62683): GdkPixbuf-CRITICAL **: 19:04:59.750: gdk_pixbuf_get_width: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

(glimpse:62683): GdkPixbuf-CRITICAL **: 19:04:59.750: gdk_pixbuf_get_height: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

(glimpse:62683): GdkPixbuf-CRITICAL **: 19:04:59.750: gdk_pixbuf_copy: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

(glimpse:62683): GdkPixbuf-CRITICAL **: 19:04:59.750: gdk_pixbuf_saturate_and_pixelate: assertion 'GDK_IS_PIXBUF (src)' failed

(glimpse:62683): GLib-GObject-CRITICAL **: 19:04:59.750: g_object_unref: assertion 'G_IS_OBJECT (object)' failed

(glimpse:62683): GdkPixbuf-CRITICAL **: 19:04:59.750: gdk_pixbuf_get_width: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

(glimpse:62683): GdkPixbuf-CRITICAL **: 19:04:59.750: gdk_pixbuf_get_height: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

(glimpse:62683): GdkPixbuf-CRITICAL **: 19:04:59.750: gdk_pixbuf_get_pixels_with_length: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

(glimpse:62683): GdkPixbuf-CRITICAL **: 19:04:59.750: gdk_pixbuf_get_rowstride: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

(glimpse:62683): GdkPixbuf-CRITICAL **: 19:04:59.750: gdk_pixbuf_get_n_channels: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

(glimpse:62683): GLib-ERROR **: 19:04:59.750: ../../../../glib/gmem.c:333: overflow allocating 18446744073709551615*18446744073709551615 bytes

(script-fu:62810): LibGimpBase-WARNING **: 19:05:00.293: script-fu: gimp_wire_read(): error
zsh: trace trap (core dumped)  snap run glimpse-editor.glimpse-editor

notice the line where it complains about overflow allocating memory:


(glimpse:62683): GLib-ERROR **: 19:04:59.750: ../../../../glib/gmem.c:333: overflow allocating 18446744073709551615*18446744073709551615 bytes

I believe it may be a larger problem, related to fonts again. For the brief moment where the splash screen is visible, the fonts are rendered as boxes too. There are similar issues observed in other snaps, eg. zoom-client Slack and Zoom won't Open The backtrace there also points to some font related issue.

I have mounted a clean tmpfs over /var/cache/fontconfig and there is no more segfaults.

Since we know that fonts cache is invalid in certain situations, perhaps we should not use it at all then? It’s good that we’re trying, but it’s not very helpful if all we get is instability and segfaults. Perhaps we should not be relying on fontconfig cache being actually reliable.

cc @jamesh

2 Likes

@kenvandine is experimenting with snap managing its own fonts cache, see: https://gitlab.com/inkscape/inkscape/-/commit/6542bab0f6b1a5b1a30d32653a85c65977cd0d13

1 Like