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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

org-mode causes emacs 27 to freeze #14462

Closed
plants-mom opened this issue Mar 7, 2021 · 13 comments
Closed

org-mode causes emacs 27 to freeze #14462

plants-mom opened this issue Mar 7, 2021 · 13 comments

Comments

@plants-mom
Copy link

Description :octocat:

After upgrading to 27.1 Emacs hangs when opening an org-mode file.

Reproduction guide 馃

  • Start Emacs
  • Open an org-mode file with a bit of structure in it. Eg. a layer documentation.

Observed behaviour: 馃憖 馃挃
Emacs hangs and has to be killed.

Expected behaviour: 鉂わ笍 馃槃
Org-mode should be usable.

System Info 馃捇

  • OS: gnu/linux
  • Emacs: 27.1
  • Spacemacs: 0.300.0
  • Spacemacs branch: develop (rev. 721765d)
  • Graphic display: t
  • Distribution: spacemacs
  • Editing style: vim
  • Completion: helm
  • Layers:
((auto-completion :variables auto-completion-complete-with-key-sequence "jk" auto-completion-enable-snippets-in-popup t)
 better-defaults bibtex common-lisp csv dash deft emacs-lisp
 (ess :variables ess-assign-key "\255")
 git haskell helm html ibuffer javascript latex markdown nixos org pandoc pdf python spell-checking syntax-checking
 (shell :variables shell-default-shell 'multi-term shell-default-height 30 shell-default-position 'bottom)
 treemacs yaml)
  • System configuration features: XPM JPEG TIFF GIF PNG RSVG CAIRO SOUND DBUS GSETTINGS GLIB NOTIFY INOTIFY LIBSELINUX GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT LIBOTF ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS LIBSYSTEMD JSON PDUMPER GMP

Backtrace 馃惥

<<BACKTRACE IF RELEVANT>>
@lebensterben
Copy link
Collaborator

Try:
First upgrade all packages. Second nuke .emacs.d/elpa directory.

@plants-mom
Copy link
Author

Thanks for the quick reply. This doesn't help unfortunately. I also removed emacs.d/.cache, upgraded to the latest revision, and removed all my org-mode related settings from the .spacemacs file. Emacs still freezes when opening an org file or reading documentation.

@lebensterben
Copy link
Collaborator

Is that a particular org file or any org file?
If it's a particular one, does that have uncommon features comparing to others?

@plants-mom
Copy link
Author

Any which is more complex than just a single heading. I test if this works by pressing spc h l and opening the org mode layer documentation (but I also tried opening some of my agenda files). This file actually opens but usually emacs freezes when scroll down a bit.

@lebensterben
Copy link
Collaborator

If that file has tables then you can try to disable valign.

@plants-mom
Copy link
Author

Thanks for your help. I don't think it's related to tables because in the other files I don't have any tables. I'll try to come up with a minimal file for which it hangs, but so far I am quite frustrated with it so I switched back to 26. I'll deal with this when I'll have the time.

@emacs18
Copy link
Contributor

emacs18 commented Mar 11, 2021

Did you try to get a stack trace? I mean

  • do (setq debug-on-quit t) before opening the org file
  • open the org file
  • Hit Control-g when it hangs

This should print stack trace. If this does not work, then other things that you can try to narrow down the cause of your problem include

  • (setq org-mode-hook nil) to see if any of the hooks are causing the problem
  • use edebug-defun to instrument org-mode for single stepping with the debugger

@plants-mom
Copy link
Author

plants-mom commented Mar 13, 2021

Thanks @emacs18 for the tips, very instructive. I didn't know you can get stack trace like that.
I managed to single out the problem with my agenda files by disabling org hooks. It looks like it was caused by org-superstar package, adding it to the excluded packages seems to "solve" (I liked my pretty bullets) the problem.

But emacs still freezes when I'm reading layer documentation, particularly org-mode layer documentation (the file $HOME/.emacs.d/layers/+emacs/org/README.org) this happens around line 300 which I believe is related to the superstar bullets chars, since on my screen scrolling down more would show "different bullets" section with those chars in them.
What could cause this? Fonts issues? I believe 27 changed something with how emacs renders fonts? I post the stacktrace below but I don't think it's telling much (these are two different traces from the same file).

stack trace
Debugger entered--Lisp error: (quit)
  vertical-motion(1)
  line-move-1(1 nil)
  line-move(1 nil nil nil)
  next-line(1)
  evil-line-move(1)
  evil-next-line(nil)
  funcall-interactively(evil-next-line nil)
  call-interactively(evil-next-line nil nil)
  command-execute(evil-next-line)

Debugger entered--Lisp error: (quit)
  redisplay_internal\ \(C\ function\)()

UPDATE: So it seems this isn't a total freeze but rather a huge slow down. When enabling org-superstar-mode in an org buffer everything slows down almost to a halt. This happens even in a buffer with just two nested headings eg:

* header1
some text
* * header2
some more text  

I tried profiling but the report didn't tell me much.
profilemem.txt
profilecpu.txt

@emacs18
Copy link
Contributor

emacs18 commented Mar 13, 2021

I use org-superstar-mode as well, but I do not have any problem. Perhaps you can try different theme, e.g., following is what I have in my .spacemacs file.

   dotspacemacs-themes '(modus-operandi
                         modus-vivendi
                         spacemacs-light
                         spacemacs-dark)

@plants-mom
Copy link
Author

Unfortunately this doesn't help. I also tried disabling doom mode-line but without success.

@plants-mom
Copy link
Author

So I tried running vanilla emacs 27.1 with org superstar and the issue also occurs on vanilla. I'll report upstream. It has to be something specific to my setup but apparently more people experience this (or something similar) as can be seen in the doom emacs thread.

@lebensterben
Copy link
Collaborator

Just attach you .spacemacs here

@plants-mom
Copy link
Author

@lebensterben Thanks but it turned out to be a font problem. I use source code pro and on 27.1 emacs did a lot of work to render the glyphs which weren't available in the font. In 26 it would just omit them. The issue was solved by using the package unicode-fonts and following the guide: https://github.com/rolandwalker/unicode-fonts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants