alexmurray / emacs-snap

GNU Emacs in a snap
https://snapcraft.io/emacs
73 stars 12 forks source link

Segmentation fault on fontconfig #17

Closed AndriyDmytrenko closed 4 years ago

AndriyDmytrenko commented 4 years ago

Just installed a fresh 27.1 release from snap $ sudo snap install emacs --beta --classic on manjaro testing.

Running emacs throws an error:

$ emacs

(emacs:48071): GLib-GObject-WARNING **: 10:20:40.071: Two different plugins tried to register 'GDaemonVfs'.

(emacs:48071): GLib-GObject-WARNING **: 10:20:40.071: Two different plugins tried to register 'GDaemonVolumeMonitor'.

(emacs:48071): GLib-GIO-WARNING **: 10:20:40.071: Tried to register an extension of the type (null) to extension point gio-volume-monitor. Expected type is GVolumeMonitor.

(emacs:48071): GLib-GObject-WARNING **: 10:20:40.071: cannot add interface type 'GLoadableIcon' to type 'GVfsIcon', since type 'GVfsIcon' already conforms to interface

(emacs:48071): GLib-GIO-WARNING **: 10:20:40.071: Tried to register an extension of the type (null) to extension point gio-vfs. Expected type is GVfs.

(emacs:48071): GLib-GObject-WARNING **: 10:20:40.071: Two different plugins tried to register 'GVfsUriMapper'.

(emacs:48071): GLib-GObject-WARNING **: 10:20:40.071: Two different plugins tried to register 'GVfsUriMapperSmb'.

(emacs:48071): GLib-GObject-WARNING **: 10:20:40.071: Two different plugins tried to register 'GVfsUriMapperHttp'.

(emacs:48071): GLib-GObject-WARNING **: 10:20:40.071: Two different plugins tried to register 'GVfsUriMapperAfp'.
Gtk-Message: 10:20:40.118: Failed to load module "canberra-gtk-module"
Gtk-Message: 10:20:40.119: Failed to load module "canberra-gtk-module"

(emacs:48071): GLib-GObject-WARNING **: 10:20:40.128: cannot register existing type 'DConfSettingsBackend'

(emacs:48071): GLib-CRITICAL **: 10:20:40.128: g_once_init_leave: assertion 'result != 0' failed

(emacs:48071): GLib-GIO-WARNING **: 10:20:40.128: Tried to register an extension of the type (null) to extension point gsettings-backend. Expected type is GObject.
Fontconfig warning: "/etc/fonts/fonts.conf", line 5: unknown element "its:rules"
Fontconfig warning: "/etc/fonts/fonts.conf", line 6: unknown element "its:translateRule"
Fontconfig error: "/etc/fonts/fonts.conf", line 6: invalid attribute 'translate'
Fontconfig error: "/etc/fonts/fonts.conf", line 6: invalid attribute 'selector'
Fontconfig error: "/etc/fonts/fonts.conf", line 7: invalid attribute 'xmlns:its'
Fontconfig error: "/etc/fonts/fonts.conf", line 7: invalid attribute 'version'
Fontconfig warning: "/etc/fonts/fonts.conf", line 9: unknown element "description"
Fontconfig warning: "/etc/fonts/conf.d/10-hinting-slight.conf", line 4: unknown element "description"
Fontconfig warning: "/etc/fonts/conf.d/10-scale-bitmap-fonts.conf", line 4: unknown element "description"
Fontconfig warning: "/etc/fonts/conf.d/20-unhint-small-vera.conf", line 4: unknown element "description"
Fontconfig warning: "/etc/fonts/conf.d/30-metric-aliases.conf", line 4: unknown element "description"
Fontconfig warning: "/etc/fonts/conf.d/40-nonlatin.conf", line 4: unknown element "description"
Fontconfig warning: "/etc/fonts/conf.d/45-generic.conf", line 4: unknown element "description"
Fontconfig warning: "/etc/fonts/conf.d/45-latin.conf", line 4: unknown element "description"
Fontconfig warning: "/etc/fonts/conf.d/49-sansserif.conf", line 4: unknown element "description"
Fontconfig warning: "/etc/fonts/conf.d/50-user.conf", line 4: unknown element "description"
Fontconfig warning: "/etc/fonts/conf.d/51-local.conf", line 4: unknown element "description"
Fontconfig warning: "/etc/fonts/conf.d/60-generic.conf", line 4: unknown element "description"
Fontconfig warning: "/etc/fonts/conf.d/60-latin.conf", line 4: unknown element "description"
Fontconfig warning: "/etc/fonts/conf.d/65-nonlatin.conf", line 4: unknown element "description"
Fontconfig error: Cannot load config file from /etc/fonts/fonts.conf
Fatal error 11: Segmentation fault
Backtrace:
/var/lib/snapd/snap/emacs/745/usr/bin/emacs(+0x256048)[0x55dae8281048]
/var/lib/snapd/snap/emacs/745/usr/bin/emacs(+0x219542)[0x55dae8244542]
/var/lib/snapd/snap/emacs/745/usr/bin/emacs(+0x255780)[0x55dae8280780]
/var/lib/snapd/snap/emacs/745/usr/bin/emacs(+0x255751)[0x55dae8280751]
/var/lib/snapd/snap/emacs/745/usr/bin/emacs(+0x2557bb)[0x55dae82807bb]
/var/lib/snapd/snap/emacs/745/usr/bin/emacs(+0x255977)[0x55dae8280977]
/snap/core18/current/lib/x86_64-linux-gnu/libpthread.so.0(+0x128a0)[0x7fbb879248a0]
/var/lib/snapd/snap/emacs/745/usr/bin/../lib/x86_64-linux-gnu/libfontconfig.so.1(+0x1ced0)[0x7fbb887b3ed0]
/var/lib/snapd/snap/emacs/745/usr/bin/../lib/x86_64-linux-gnu/libfontconfig.so.1(+0x1e1ae)[0x7fbb887b51ae]
/var/lib/snapd/snap/emacs/745/usr/bin/emacs(+0x459ced)[0x55dae8484ced]
/var/lib/snapd/snap/emacs/745/usr/bin/emacs(+0x462448)[0x55dae848d448]
/var/lib/snapd/snap/emacs/745/usr/bin/emacs(+0x377767)[0x55dae83a2767]
/var/lib/snapd/snap/emacs/745/usr/bin/emacs(+0x37918a)[0x55dae83a418a]
/var/lib/snapd/snap/emacs/745/usr/bin/emacs(+0x379411)[0x55dae83a4411]
/var/lib/snapd/snap/emacs/745/usr/bin/emacs(+0x3795fa)[0x55dae83a45fa]
/var/lib/snapd/snap/emacs/745/usr/bin/emacs(+0x37966d)[0x55dae83a466d]
/var/lib/snapd/snap/emacs/745/usr/bin/emacs(+0x1d2176)[0x55dae81fd176]
/var/lib/snapd/snap/emacs/745/usr/bin/emacs(+0x1d343f)[0x55dae81fe43f]
/var/lib/snapd/snap/emacs/745/usr/bin/emacs(+0x34e7a1)[0x55dae83797a1]
/var/lib/snapd/snap/emacs/745/usr/bin/emacs(+0x34e35f)[0x55dae837935f]
/var/lib/snapd/snap/emacs/745/usr/bin/emacs(+0x3bd606)[0x55dae83e8606]
/var/lib/snapd/snap/emacs/745/usr/bin/emacs(+0x34ee4e)[0x55dae8379e4e]
/var/lib/snapd/snap/emacs/745/usr/bin/emacs(+0x34e3a3)[0x55dae83793a3]
/var/lib/snapd/snap/emacs/745/usr/bin/emacs(+0x3bd606)[0x55dae83e8606]
/var/lib/snapd/snap/emacs/745/usr/bin/emacs(+0x34ee4e)[0x55dae8379e4e]
/var/lib/snapd/snap/emacs/745/usr/bin/emacs(+0x34e3a3)[0x55dae83793a3]
/var/lib/snapd/snap/emacs/745/usr/bin/emacs(+0x34d271)[0x55dae8378271]
/var/lib/snapd/snap/emacs/745/usr/bin/emacs(+0x34e6ab)[0x55dae83796ab]
/var/lib/snapd/snap/emacs/745/usr/bin/emacs(+0x34e35f)[0x55dae837935f]
/var/lib/snapd/snap/emacs/745/usr/bin/emacs(+0x3bd606)[0x55dae83e8606]
/var/lib/snapd/snap/emacs/745/usr/bin/emacs(+0x34ee4e)[0x55dae8379e4e]
/var/lib/snapd/snap/emacs/745/usr/bin/emacs(+0x34e3a3)[0x55dae83793a3]
/var/lib/snapd/snap/emacs/745/usr/bin/emacs(+0x3bd606)[0x55dae83e8606]
/var/lib/snapd/snap/emacs/745/usr/bin/emacs(+0x34ee4e)[0x55dae8379e4e]
/var/lib/snapd/snap/emacs/745/usr/bin/emacs(+0x34e3a3)[0x55dae83793a3]
/var/lib/snapd/snap/emacs/745/usr/bin/emacs(+0x3bd606)[0x55dae83e8606]
/var/lib/snapd/snap/emacs/745/usr/bin/emacs(+0x34ee4e)[0x55dae8379e4e]
/var/lib/snapd/snap/emacs/745/usr/bin/emacs(+0x34e3a3)[0x55dae83793a3]
/var/lib/snapd/snap/emacs/745/usr/bin/emacs(+0x3bd606)[0x55dae83e8606]
/var/lib/snapd/snap/emacs/745/usr/bin/emacs(+0x34ee4e)[0x55dae8379e4e]
/var/lib/snapd/snap/emacs/745/usr/bin/emacs(+0x34e3a3)[0x55dae83793a3]
...
zsh: segmentation fault (core dumped)  emacs

emacs -nw runs fine.

alexmurray commented 4 years ago

Thanks for reporting this issue - I'm taking a look at it now and will see what I can do.

alexmurray commented 4 years ago

Issue #3 was also a segfault-on-manjaro - @sergiusens have you by any chance used Manjaro again recently or tested the 27.1 version in the beta/candidate channels?

alexmurray commented 4 years ago

FYI I am unable to reproduce this on a clean install of Manjaro 20.0.3 - but I notice you said Manjaro testing, so I will try enabling the testing repos and report back.

alexmurray commented 4 years ago

Ok I can reproduce it on Manjaro testing - now to see about actually root-causing it...

sergiusens commented 4 years ago

Alex Murray notifications@github.com writes:

Issue #3 was also a segfault-on-manjaro - @sergiusens have you by any chance used Manjaro again recently or tested the 27.1 version in the beta/candidate channels?

I have a /physical/ machine setup with Manjaro and another with Fedora 32 for next time (as I see you already setup a reproducer).

FWIW, I believe I see a similar behavior on Fedora 32. I will log something as soon as I can.

alexmurray commented 4 years ago

Thanks @sergiusens - I can 'fix' this at the moment by making emacs ignore the system fontconfig configuration but then this means it does not see any fonts that are not shipped inside the emacs snap itself. I am trying to see if I can come up with a compromise to avoid the segfault but also see system installed fonts.

alexmurray commented 4 years ago

Ah ok so it is enough to just redirect the fontconfig cache dir to avoid using the system cache (since the format of this will not match the fontconfig version used in the emacs snap) - I'll try and get a fix in place to do this automatically - stay tuned :)

alexmurray commented 4 years ago

Ok with some minimal testing I believe the commit above should fix this issue - I have triggered rebuilds of the snap for all architectures and these should be available in the beta channel within the next hour or so - I'm going EOD now but will leave this issue open and check for any feedback in the morning.

AndriyDmytrenko commented 4 years ago

The update of snap has just arrived and the issue is not reproducible now. Thanks.

alexmurray commented 4 years ago

Excellent - I will close this issue then :)

idcrook commented 4 years ago

this most recent snap errors upon startup in ubuntu 20.04 desktop (emacs -nw works without a hitch)

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.1 LTS
Release:    20.04
Codename:   focal
$ snap install emacs --beta --classic
Automatically connect eligible plugs and slots of snap "emacs"                                                         
emacs (beta) 27.1 from Alex Murray (alexmurray) installed
$ which emacs
/snap/bin/emacs
$ emacs 
Fontconfig warning: "/home/dpc/snap/emacs/common/fonts.conf", line 5: unknown element "its:rules"
Fontconfig warning: "/home/dpc/snap/emacs/common/fonts.conf", line 6: unknown element "its:translateRule"
Fontconfig error: "/home/dpc/snap/emacs/common/fonts.conf", line 6: invalid attribute 'translate'
...
Fontconfig error: "/etc/fonts/conf.d/90-synthetic.conf", line 6: invalid attribute 'version'
Fontconfig error: Cannot load config file from /home/dpc/snap/emacs/common/fonts.conf
Backtrace:
/snap/emacs/754/usr/bin/emacs(+0x256048)[0x559c933bb048]
...
alexmurray commented 4 years ago

Oh that sucks - I am not able to reproduce it myself but perhaps you can help debug this - could you try running the following and see if that helps:

sed "s|/var|/home/dpc/snap/emacs/common|" /snap/emacs/current/etc/fonts/fonts.conf > /home/dpc/snap/emacs/common/fonts.conf

If that still does not resolve it, could you also try the following:

rm -rf /home/dpc/snap/emacs/common/.cache/fontconfig

And let me know if either helps at all.