# Sly crashes emacs. How to debug?

**URL:** <https://forum.systemcrafters.net/t/sly-crashes-emacs-how-to-debug/923>\
**Category:** Emacs\
**Tags:** lisp\
**Created:** [August 14, 2024, 4:56am UTC](https://forum.systemcrafters.net/t/sly-crashes-emacs-how-to-debug/923 "2024-08-14T04:56:16Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![kflak](https://avatars.discourse-cdn.com/v4/letter/k/f08c70/32.png) [@kflak](https://forum.systemcrafters.net/u/kflak)\
**Post date:** [August 14, 2024, 4:56am UTC](https://forum.systemcrafters.net/t/sly-crashes-emacs-how-to-debug/923/1 "2024-08-14T04:56:16Z")

</div>

Hi,

I’m using the `lisp` module, but sly keeps crashing emacs when working in common-lisp files. Trying to debug by running `emacs -Q` and loading sly, but for some reason I don’t get any `sly` command. I tried running `package-install-selected-packages`, selecting sly and installing it that way, but it still doesn’t show up as a command when I run `M-x sly`.

Running on arch linux, emacs 29.4

---

<div class="post-metadata">

**Author:** ![theesm](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.systemcrafters.net/theesm/32/175_2.png) [@theesm](https://forum.systemcrafters.net/u/theesm)\
**Post date:** [August 14, 2024, 10:03am UTC](https://forum.systemcrafters.net/t/sly-crashes-emacs-how-to-debug/923/2 "2024-08-14T10:03:17Z")

</div>

If emacs hangs/freezes you could use `pkill -SIGUSR2 emacs` which will toggle `debug-on-quit` and throw a stacktrace, this will also (most of the time) “unfreeze” emacs as a side effect as the hanging blocking function will exit due to this.

---

<div class="post-metadata">

**Author:** ![kflak](https://avatars.discourse-cdn.com/v4/letter/k/f08c70/32.png) [@kflak](https://forum.systemcrafters.net/u/kflak)\
**Post date:** [August 14, 2024, 3:38pm UTC](https://forum.systemcrafters.net/t/sly-crashes-emacs-how-to-debug/923/3 "2024-08-14T15:38:03Z")

</div>

Ah, that’s useful indeed! Unfortunately it doesn’t address my present concern, which is that emacs dies completely and utterly, leaving behind only a coredump…

For now I’m disabling some of my other modes to see if I can narrow it down without having to go down the route of minimal init files, and right now it seems that yasnippet might be to blame. I have been doing quite a bit of typing without incident now. But let’s see…

EDIT: still getting a crash without yasnippet.

EDIT 2: Trying slime instead of sly, and it seems to be a much more stable experience (for now). Is there a good reason for trying to make sly work, or is slime good enough for casual common-lisping?

---

<div class="post-metadata">

**Author:** ![alphapapa](https://avatars.discourse-cdn.com/v4/letter/a/5f9b8f/32.png) [@alphapapa](https://forum.systemcrafters.net/u/alphapapa)\
**Post date:** [August 14, 2024, 8:24pm UTC](https://forum.systemcrafters.net/t/sly-crashes-emacs-how-to-debug/923/4 "2024-08-14T20:24:40Z")

</div>

Emacs should never crash due to an Elisp library. If it does, and you can reproduce it, you should file a bug report with `M-x report-emacs-bug`.

---

<div class="post-metadata">

**Author:** ![kflak](https://avatars.discourse-cdn.com/v4/letter/k/f08c70/32.png) [@kflak](https://forum.systemcrafters.net/u/kflak)\
**Post date:** [August 15, 2024, 8:37am UTC](https://forum.systemcrafters.net/t/sly-crashes-emacs-how-to-debug/923/5 "2024-08-15T08:37:39Z")

</div>

Good good, will try to find some time to file the report. Just returning to my original question for that: how do I run a clean emacs session (`emacs -Q` I suppose?) and install sly only for the duration of that session?

---

<div class="post-metadata">

**Author:** ![alphapapa](https://avatars.discourse-cdn.com/v4/letter/a/5f9b8f/32.png) [@alphapapa](https://forum.systemcrafters.net/u/alphapapa)\
**Post date:** [August 15, 2024, 11:11pm UTC](https://forum.systemcrafters.net/t/sly-crashes-emacs-how-to-debug/923/6 "2024-08-15T23:11:52Z")

</div>

I recommend using this script of mine, which makes such things very easy: [GitHub - alphapapa/with-emacs.sh: Script to easily run Emacs with specified configurations](https://github.com/alphapapa/with-emacs.sh)

---

<div class="post-metadata">

**Author:** ![kflak](https://avatars.discourse-cdn.com/v4/letter/k/f08c70/32.png) [@kflak](https://forum.systemcrafters.net/u/kflak)\
**Post date:** [August 16, 2024, 4:47am UTC](https://forum.systemcrafters.net/t/sly-crashes-emacs-how-to-debug/923/7 "2024-08-16T04:47:21Z")

</div>

Thanks, I’ll give it a try!
