1

I'm a Emacs newbie. I've gone through the guided tutorial and I got excited by what Emacs promises. I want to learn Emacs and use it as my primary development editor, and specifically at the moment for Clojure development with Cider.

When I type M-x package-install and hit enter to try and install Cider my Emacs just closes unexpectedly. I've tried several suggestions I found on this site and other but no luck so far.

Here's what I get on the terminal using --debug-init as a post I read suggested:

Backtrace:
/snap/emacs/296/usr/bin/emacs[0x58f0c7]
/snap/emacs/296/usr/bin/emacs[0x567cbc]
/snap/emacs/296/usr/bin/emacs[0x58e802]
/snap/emacs/296/usr/bin/emacs[0x58e7d3]
/snap/emacs/296/usr/bin/emacs[0x58e83d]
/snap/emacs/296/usr/bin/emacs[0x58e9f9]
/snap/core18/current/lib/x86_64-linux-gnu/libpthread.so.0(+0x12890)[0x7fe670900890]
/snap/core18/current/lib64/ld-linux-x86-64.so.2(+0xcac8)[0x7fe677759ac8]
/snap/core18/current/lib64/ld-linux-x86-64.so.2(+0x150bd)[0x7fe6777620bd]
/snap/core18/current/lib/x86_64-linux-gnu/libc.so.6(_dl_catch_exception+0x6f)[0x7fe66fd642df]
/snap/core18/current/lib64/ld-linux-x86-64.so.2(+0x147ca)[0x7fe6777617ca]
/snap/core18/current/lib/x86_64-linux-gnu/libc.so.6(+0x1663ad)[0x7fe66fd633ad]
/snap/core18/current/lib/x86_64-linux-gnu/libc.so.6(_dl_catch_exception+0x6f)[0x7fe66fd642df]
/snap/core18/current/lib/x86_64-linux-gnu/libc.so.6(_dl_catch_error+0x2f)[0x7fe66fd6436f]
/snap/core18/current/lib/x86_64-linux-gnu/libc.so.6(__libc_dlopen_mode+0x89)[0x7fe66fd634d9]
/snap/core18/current/lib/x86_64-linux-gnu/libc.so.6(+0x148886)[0x7fe66fd45886]
/snap/core18/current/lib/x86_64-linux-gnu/libc.so.6(__nss_lookup_function+0x128)[0x7fe66fd46088]
/snap/core18/current/lib/x86_64-linux-gnu/libc.so.6(+0x105cf3)[0x7fe66fd02cf3]
/snap/core18/current/lib/x86_64-linux-gnu/libc.so.6(getaddrinfo+0x124)[0x7fe66fd04ce4]
/snap/emacs/296/usr/bin/emacs[0x671b31]
/snap/emacs/296/usr/bin/emacs[0x619809]
/snap/emacs/296/usr/bin/emacs[0x6194e5]
/snap/emacs/296/usr/bin/emacs[0x664a8f]
/snap/emacs/296/usr/bin/emacs[0x619fa0]
/snap/emacs/296/usr/bin/emacs[0x619529]
/snap/emacs/296/usr/bin/emacs[0x664a8f]
/snap/emacs/296/usr/bin/emacs[0x61a30a]
/snap/emacs/296/usr/bin/emacs[0x619529]
/snap/emacs/296/usr/bin/emacs[0x664a8f]
/snap/emacs/296/usr/bin/emacs[0x619fa0]
/snap/emacs/296/usr/bin/emacs[0x619529]
/snap/emacs/296/usr/bin/emacs[0x664a8f]
/snap/emacs/296/usr/bin/emacs[0x619fa0]
/snap/emacs/296/usr/bin/emacs[0x619529]
/snap/emacs/296/usr/bin/emacs[0x664a8f]
/snap/emacs/296/usr/bin/emacs[0x61a30a]
/snap/emacs/296/usr/bin/emacs[0x619529]
/snap/emacs/296/usr/bin/emacs[0x664a8f]
/snap/emacs/296/usr/bin/emacs[0x619fa0]
/snap/emacs/296/usr/bin/emacs[0x619529]
/snap/emacs/296/usr/bin/emacs[0x664a8f]

How can I fix this? I've tried:

  • removing and re-installing Emacs,
  • changing the Emacs init file

but none of that has worked.

Do you have any suggestions? What can I do to fix this?

As an aside note, I see a quick message Contacting host: melpa.org:443 before the crash happens so I changed my Emacs init file to see if it would fix the error, but no luck.

(setq gnutls-algorithm-priority "NORMAL:-VERS-TLS1.3")
;(setq package-check-signature nil)

; Set up melpa package repository
(require 'package)
(setq package-enable-at-startup nil)

(package-initialize)

(add-to-list 'package-archives
             '("gnu", "https://elpa.gnu.org/packages/")
             '("melpa", "https://melpa.org/packages/"))

Ideas and suggestions welcome and appreciated. Thank you.

6
  • Which version of emacs is it? You mentioned you "changed" your init file but have you tried running emacs without an init file (emacs -Q), evaluating the package initialization code you posted, and trying package-install? Also does it work when you install a package that isn't Cider? Jun 6 '20 at 18:32
  • I'm running Emacs version 26.3. I tried running with the -Q option but no luck. Also, it's not that I can't install just Cider, it's just that after typing M-x package-install Emacs crashes just right after I press Enter. So there's something preventing me from even trying to install a package.
    – Ariel
    Jun 6 '20 at 18:50
  • Probably that's caused from snap confination mode. I don't have enough knowledge about snap system to give you an answer as I don't use it myself but had similar experiences in the past trying to install other stuff, but ended compiling myself.
    – Muihlinn
    Jun 6 '20 at 20:04
  • 1
    I went searching and found github.com/alexmurray/emacs-snap/issues/12. It seems that this can happen to any snap which ends up partly using the host's libnss. The bug report is closed because the next stable release of the snap will fix it. In the mean time you can install the beta version (instructions in a comment in the bug report). Personally I would uninstall the snap and just install the normal emacs (by running "apt install emacs"); that will eliminate this kind of problem entirely.
    – db48x
    Jun 6 '20 at 20:19
  • Thank you for the suggestions guys. @db48x I'll give this a try.
    – Ariel
    Jun 6 '20 at 22:47
1

The crash turned out to be caused by an improperly packaged snap version of Emacs. The solution was either to upgrade to one that is properly packaged, or to install the apt package rather than the snap.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.