Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spacemacs hangs frequently. #8462

Closed
ryang-bgl opened this issue Mar 2, 2017 · 46 comments
Closed

Spacemacs hangs frequently. #8462

ryang-bgl opened this issue Mar 2, 2017 · 46 comments
Labels
- Bug tracker - stale marked as a stale issue/pr (usually by a bot) Unresponsive Marked for issues without response from author.

Comments

@ryang-bgl
Copy link

Reproduction guide 🪲

  • Start Emacs
  • Keep using it
  • It freezes after using for sometime.

Observed behaviour: 👀 💔

  • It freezes after using for sometime.
  • I have 8 cores, one core usage is 12%, which is 100% usage of one core
  • Memory usage is fine.
  • I have to kill spacemacs and restart it to continue.
  • It happened once when I tried to C-x b (helm-buffers-list).
  • It happened once when I try to type a command in clojure repl.

Expected behaviour: ❤️ 😄
It should not freeze.

System Info 💻

  • OS: windows 7 and Ubuntu
  • Emacs: 25.1.1
  • Spacemacs: 0.200.7
  • Spacemacs branch: nil (rev. nil)
  • Graphic display: t
  • Distribution: spacemacs
  • Editing style: emacs
  • Completion: helm
  • Layers:
     ruby
     ;; ----------------------------------------------------------------
     ;; Example of useful layers you may want to use right away.
     ;; Uncomment some layer names and press <SPC f e R> (Vim style) or
     ;; <M-m f e R> (Emacs style) to install them.
     ;; ----------------------------------------------------------------
     helm
     auto-completion
     ;; better-defaults
     emacs-lisp
     git
     markdown
     org
     (shell :variables
             shell-default-height 30
             shell-default-position 'bottom)
;;     '((syntax-checking :variables syntax-checking-enable-by-default nil))
     version-control
     javascript
     react
     clojure
     ryang-custom
  • System configuration features: XPM JPEG TIFF GIF PNG RSVG SOUND NOTIFY ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS

Backtrace 🐾

@ryang-bgl
Copy link
Author

I suspect it was caused by helm. is there a way to disable the helm?

@ryang-bgl
Copy link
Author

It hanged again on my windows 7 machine when I tried to do C-r to search in a eshell buffer.
Not sure now if it is related to helm or not.

Any tips for me to get a dump of what is happening in emacs itself?

Unfortunately my working environment is windows 7 virtual machine. It is slower than native. But the hanging also happened in my native Ubutntu machine.

@goFrendiAsgard
Copy link

goFrendiAsgard commented Mar 3, 2017

To make sure whether it is related to helm or not, try to use ivy instead of helm.
I don't sure how to do this correctly tough. Probably one of these:

  • Delete ~/.spacemacs, and start it again. This time, choose ivy instead of helm
  • Modify ~/.spacemacs, go to dotspacemacs/layers section, replace helm instead of ivy.

Also, have you try to run emacs as daemon?
I'm using ubuntu, and trying this:
emacs --daemon && emacs
More info: https://www.emacswiki.org/emacs/EmacsAsDaemon

EDIT: To get the log, try to go to Message buffer. I do that by pressing ctrl+x+b looking for Message

@et2010
Copy link
Contributor

et2010 commented Mar 3, 2017

You can try to debug this following this answer:
http://emacs.stackexchange.com/a/507/12431

I also expericenced same issue. When it hangs, usually hit C-g will bring it back, if not, it's probably caused by c code error. If you're on linux, you can try this:

kill -SIGUSR2 <emacs_pid_goes_here>

hopefully emacs

will break out of its current loop into the Lisp debugger

All credits goes here: http://emacs.stackexchange.com/a/649/12431

@bmag
Copy link
Contributor

bmag commented Mar 3, 2017

To make sure whether it is related to helm or not, try to use ivy instead of helm.
I don't sure how to do this correctly tough.

Remove helm layer from list of enabled layers and add ivy layer instead.

@bmag bmag added - Bug tracker - Unresponsive Marked for issues without response from author. labels Mar 3, 2017
@et2010
Copy link
Contributor

et2010 commented Mar 4, 2017

My spacemacs hung again, and I was trying to debug using kill -SIGUSR2 and got following trace back:

Debugger entered--entering a function:
* eval((spaceline-ml-main))
  redisplay_internal\ \(C\ function\)()
  recursive-edit()
  debug(lambda)
* linum-after-scroll(#<window 66 on *Backtrace*> 3837)
  redisplay_internal\ \(C\ function\)()
  recursive-edit()
  debug(error (quit))
  redisplay_internal\ \(C\ function\)()

It happend when I was using ediff to diff two elisp buffers. And If I quit the *Debugger* buffer, then it will freeze again, so I got no other choice but to quit emacs completely. I guess it's linum? I'll try disabling linum and keep watching. Also, I noticed that redisplay_internal thing appears every time when emacs hangs.

BTW, I'm on develop branch and my emacs is 25.1

@ryang-bgl
Copy link
Author

I replaced helm with ivy, but I also disabled auto-complete. will see how it goes on my Windows machine. It is a virtual machine in working place.

@ryang-bgl
Copy link
Author

I disabled autocomplete and helm. it happened less often, but still happened once in a day. The following is the output of dump file opened with WDK.

SYMSRV: is not a valid store
*** ERROR: Symbol file could not be found. Defaulted to export symbols for ntdll.dll -

************* Symbol Loading Error Summary **************
Module name Error
ntdll PDB not found : SRV*https://msdl.microsoft.com/download/symbols

The following location did not respond and were excluded during symbol loading:
cache*

You can troubleshoot most symbol related issues by turning on symbol loading diagnostics (!sym noisy) and repeating the command that caused symbols to be loaded.
You should also verify that your symbol search path (.sympath) is correct.
*** ERROR: Symbol file could not be found. Defaulted to export symbols for KERNELBASE.dll -
ntdll!ZwWaitForMultipleObjects+0xa:
00000000`77bdc2ea c3 ret

************* Symbol Path validation summary **************
Response Time (ms) Location
OK C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\srcsrv

Anyone could help to how I could get more detailed info? seemed that I don't have some symbols.
I downloaed Windows Symbol file. but not sure where it is installed to.
https://msdn.microsoft.com/en-gb/library/windows/hardware/ff551035(v=vs.85).aspx

Any help would be appreciated.

@CeleritasCelery
Copy link
Contributor

@et2010 look at #4730 which deals with ediff freezing. different people have found different solutions. But somethings that seem to work are (setq dotspacemacs-mode-line-unicode-symbols nil), (setq ediff-window-setup-function 'ediff-setup-windows-default), or excluding the spaceline package. All the freezes can be traced back to redisplay_internal. Unfortunately I don't think there is the expertise within the Spacemacs community to comprehend this problem and resolve it.

@et2010
Copy link
Contributor

et2010 commented Mar 9, 2017

@CeleritasCelery Thanks for the tip. It's good to know it's not just me having this problem.

@TheBaronHimself
Copy link

I'm having similar issues:

  • Sometimes it freezes entirely and I have to kill it.
  • Oftentimes it stutters when navigating through a document or even when typing and doesn't react for a second or so.

It's very annoying and makes for a very laggy experience overall. I tried disabling helm, auto-complete, syntax-checking and spell-checking but nothing really solved the issue.

I'm on macOS/OSX 10.11.6.

@aleksandar78
Copy link

I'm encountering similar problems with spacemacs. I'm new with spacemacs, not with emacs. I'm trying to use it for simple js projects. Everything works fine until I add git layer and try to call magit to see ustaged files ( M-m g s ). Spacemacs freezes completely. I'm forced to kill it from terminal using htop. I also noticed high number of running processes, very unusual for emacs.

I've tried almost every possible combination inside user configuration but without success.

I'm on Manjaro Linux
Emacs ver. 25.1.4

@folkwang
Copy link

Similar issue to @aleksandar78 here. Mine hangs when I press i inside magit buffer. I have to press c-g to bring spacemacs back to life. I suspect it's related to some sort of dynamic loading. Sometimes I encounter freeze over short period of time when I press some specific keys I don't frequently use, and I can see some compilation messages in the bottom line.

And idea on how to debug this issue is appreciated.

@FiloSpaTeam
Copy link

Same here with Rails project. Freeze if i try to call SPC-p-f to search a file in the project.
I need to kill manually and restart.

@gone
Copy link

gone commented Mar 30, 2017

I've been getting a lot of slowdown/freezes as well - I wish I could be more helpful. Also on OSX

@damienrg
Copy link

I encounter a similar problem sometimes when commenting a line (SPC c l) and I had to do kill -SIGUSR2 which gives this stacktrace.

@stormpat
Copy link
Contributor

I upgraded to emacs 25.2 and dropped helm for ivy. I have not seen a freeze since. Also on OSX (using emacs-plus via brew).

@stormpat
Copy link
Contributor

Ok so the freezing is back. It makes Emacs almost unusable. I deleted lots of layers (i rarely use) but the biggest issues seems to be gone with removing auto-completion.

@sebhahn
Copy link
Contributor

sebhahn commented Jun 14, 2017

I've experienced similar problems that from one moment to the next the Emacs process needs 100% of one CPU and doesn't react anymore. I'm running Emacs from the Terminal now, which never froze so far.

@FiloSpaTeam
Copy link

You think that can be related to UI?

@sebhahn
Copy link
Contributor

sebhahn commented Jun 14, 2017

I don't know, but it never happened in the terminal so far.

@CeleritasCelery
Copy link
Contributor

From what I have seen this is a "GUI only" problem

@FiloSpaTeam
Copy link

Oh :(

@chenyangguang
Copy link

chenyangguang commented Jul 4, 2017

@CeleritasCelery , I found it appear also when i startup with emacs -nw command in the terminal. It seen not only the "GUI only" problem.

@FiloSpaTeam
Copy link

Strange, i solved without GUI. And it's very faster with urxvt 👍

@CeleritasCelery
Copy link
Contributor

@FiloSpaTeam Yeah this bug always seems to come back to unicode

@FiloSpaTeam
Copy link

Oh damn...

@fredRos
Copy link

fredRos commented Aug 7, 2017

I upgraded from emacs 24.5 to 25.1. That didn't help. I think all the freezes came about when helm was called in one way or another so I replaced it with ivy. No freeze in the first hour of emacs use. I hope it stays like that.

@leezu
Copy link
Contributor

leezu commented Aug 7, 2017

@fredRos have you tried deleting .emacs.d and cloning it again from github? That solved the problem for me as it forces the recompilation of all packages.

@fredRos
Copy link

fredRos commented Aug 7, 2017

I have done it now and I only had one freeze when I used tramp. But that package often leads to a hang, so it seems with ivy the issues are gone. Now I have to learn to master ivy 😢

@leezu
Copy link
Contributor

leezu commented Aug 7, 2017

@fredRos I was mentioning it as that also fixed the hangs for me when using helm. So perhaps its worth trying that again, or indeed you can just continue with ivy.

@pfaure
Copy link
Contributor

pfaure commented Oct 18, 2017

Deactivated version-control layer and had no more hangs.

@fredRos
Copy link

fredRos commented Mar 23, 2018

For me, the problem had nothing to do with ivy or helm, it was about unicode symbols. In dotspacemacs/init, I set

   ;; If non nil unicode symbols are displayed in the mode line. (default t)
   dotspacemacs-mode-line-unicode-symbols nil

and that solved all problems for me. I went back to helm and didn't have a freeze either

@cweill
Copy link
Contributor

cweill commented Mar 28, 2018

I'm running the develop branch at commit 0fa3658. For me the fix was to disable starting an emacs server:

;; If non-nil, start an Emacs server if one is not already running.
dotspacemacs-enable-server nil

Everything is now running smoothly.

@marcoieni
Copy link
Contributor

marcoieni commented Apr 24, 2018

I excluded the package spaceline by editing the .spacemacs file in this way:

dotspacemacs-excluded-packages '(spaceline)

and now it works fine.

I also have unicode symbols disabled:

;; If non nil unicode symbols are displayed in the mode line. (default t)
dotspacemacs-mode-line-unicode-symbols nil

The problem now is that the line is very ugly.
Anyone knows how to install a replacement for spaceline or how to personalize the line without using spaceline?

@fredRos
Copy link

fredRos commented Apr 24, 2018 via email

@marcoieni
Copy link
Contributor

marcoieni commented Apr 24, 2018 via email

@marcoieni
Copy link
Contributor

marcoieni commented Apr 28, 2018

UPDATE: I am using spaceline again and I obtained a stable situation by adding this in my user-config

(spaceline-toggle-minor-modes-off)

If the method of @fredRos doesn't work for you, try this one too.

By the way, it will hide the minor modes from your spaceline.

@Compro-Prasad
Copy link
Contributor

Compro-Prasad commented Jun 19, 2018

@marcoieni https://emacs-fu.blogspot.com/2011/08/customizing-mode-line.html

@Compro-Prasad
Copy link
Contributor

@aleksandar78 is your git status too large. It happens if the status is too large.

@gred7
Copy link

gred7 commented Jul 7, 2018

freezes everywhere, freezes everyday, freezes over and over again
emacs 26.1 on OpenBSD
same observed on Ubuntu and Centos.
no helm, ivy layer is installed.
i need the IDE features, so most of development support layers are installed.

@gred7
Copy link

gred7 commented Jul 7, 2018

I moved to purcell's emacs config. not as good as spacemacs or doom in terms of ease of use, but at least works smooth enough for me

@ar1a
Copy link

ar1a commented Sep 2, 2018

Could be linked to the gc threshold being set massively high

schmir added a commit to schmir/.spacemacs.d that referenced this issue Jan 21, 2019
@timothywangdev
Copy link

same here

@planetA
Copy link

planetA commented Jun 14, 2019

Try to disable global-linum-mode. For me the situation gets much better.

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid!

@github-actions github-actions bot added the stale marked as a stale issue/pr (usually by a bot) label Jun 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- Bug tracker - stale marked as a stale issue/pr (usually by a bot) Unresponsive Marked for issues without response from author.
Projects
None yet
Development

No branches or pull requests