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

Org mode hangs very sporadically when using mini-buffers #5778

Closed
i-brute-force opened this issue Apr 13, 2016 · 19 comments
Closed

Org mode hangs very sporadically when using mini-buffers #5778

i-brute-force opened this issue Apr 13, 2016 · 19 comments
Labels
- Bug tracker - Org stale marked as a stale issue/pr (usually by a bot) Unresponsive Marked for issues without response from author.

Comments

@i-brute-force
Copy link

Description

The freeze happens very infrequently (once in a few hours of use), but once in a while, when using mini-buffer such as changing todo types or capturing something, the emacs becomes completely irresponsive. C-g and SPC q are not registered, and the only way I can stop the process is through pkill -SIGUSR2 Emacs or shutting it off through Activity Monitor.

Reproduction guide

Difficult to reproduce, but my workflow until the freeze is:

  • Start Emacs
  • Use org-mode for a while using various org-mode commands such as org-todo or org-capture
  • With an unidentifiable pattern, the emacs freeze

Observed behaviour:
Emacs freeze at a random interval when using some org commands

Expected behaviour:
Emacs should not freeze

System Info

  • OS: darwin
  • Emacs: 24.5.1
  • Spacemacs: 0.105.16
  • Spacemacs branch: master (rev. cf8563b)
  • Graphic display: t
  • Distribution: spacemacs
  • Editing style: vim
  • Completion: helm
  • Layers:
((auto-completion :variables auto-completion-return-key-behavior 'complete auto-completion-tab-key-behavior 'cycle auto-completion-complete-with-key-sequence nil)
 better-defaults emacs-lisp git markdown org
 (shell :variables shell-default-height 30 shell-default-position 'bottom)
 spell-checking syntax-checking version-control
 (latex :variables latex-enable-auto-fill t)
 themes-megapack python)

Backtrace

(funcall #[257 "\302\300\242\301\242\303\304$\210\305�@�A\"\207" [(624) (659) put-text-property fontified nil signal] 6 "\n\n(fn ERR)"] err)
  jit-lock-fontify-now(653 1153)
  jit-lock-function(653)
  redisplay_internal\ \(C\ function\)()
@StreakyCobra StreakyCobra added Org - Bug tracker - Unresponsive Marked for issues without response from author. labels Apr 13, 2016
@i-brute-force
Copy link
Author

Another freeze with the same backtrace

@syl20bnr
Copy link
Owner

What is your color theme ?

@i-brute-force
Copy link
Author

i-brute-force commented Apr 14, 2016

@syl20bnr Are you asking about the dotspacemacs-themes?

I am currently using solarized-light

@i-brute-force
Copy link
Author

i-brute-force commented Apr 19, 2016

Another case of freeze.

Here is the full backtrace:

Debugger entered--beginning evaluation of function call form:
* (funcall #[257 "\302\300\242\301\242\303\304$\210\305�@�A\"\207" [(11601) (11697) put-text-property fontified nil signal] 6 "\n\n(fn ERR)"] err)
  jit-lock-fontify-now(11601 12101)
  jit-lock-function(11601)
  redisplay_internal\ \(C\ function\)()

After I unfreeze spacemacs through pkill, I need to restart emacs since it starts to freeze again if I continue using without restart even with simple commands such as fold and unfold.

@i-brute-force
Copy link
Author

Freeze during refiling. Here is the backtrace

@i-brute-force
Copy link
Author

i-brute-force commented Apr 26, 2016

I thought it might be my laptop's problem, so I started working on my desktop, but I still have the same problem while refiling. Since the problem seems to be from jit-lock-mode, I've enabled (setq jit-lock-debug-mode t). I will update result if I get another hang from jit-lock

My desktop's System Info:

System Info

  • OS: gnu/linux
  • Emacs: 24.5.1
  • Spacemacs: 0.105.16
  • Spacemacs branch: master (rev. cf8563b)
  • Graphic display: t
  • Distribution: spacemacs
  • Editing style: vim
  • Completion: helm
  • Layers:
((auto-completion :variables auto-completion-return-key-behavior 'complete auto-completion-tab-key-behavior 'cycle auto-completion-complete-with-key-sequence nil)
 better-defaults emacs-lisp git markdown org
 (shell :variables shell-default-height 30 shell-default-position 'bottom)
 spell-checking syntax-checking version-control
 (latex :variables latex-enable-auto-fill t)
 themes-megapack python)

Backtrace

Debugger entered--beginning evaluation of function call form:
* (funcall #[257 "\302\300\242\301\242\303\304$\210\305�@�A\"\207" [(18052) (18230) put-text-property fontified nil signal] 6 "\n\n(fn ERR)"] err)
  jit-lock-fontify-now(18053 18553)
  jit-lock-function(18053)
  redisplay_internal\ \(C\ function\)()

@i-brute-force
Copy link
Author

i-brute-force commented May 1, 2016

Update. The problem seems to be that of flyspell. How do I turn off flyspell on org-mode?

Backtrace

Debugger entered--entering a function:
* command-error-default-function((quit) "" nil)
  recursive-edit()
  debug(lambda)
* command-error-default-function((quit) "" nil)
  recursive-edit()
  debug(t)
* (byte-code "\301�\302\303!\207" [quit-flag t eval (ignore nil)] 2)
  flyspell-post-command-hook()
  recursive-edit()
  debug(lambda)
* evil--jump-hook()
  recursive-edit()
  debug(lambda)
* evil--jump-hook()
  recursive-edit()
  debug(lambda)
* evil--jump-hook()
  recursive-edit()
  debug(lambda)
* evil--jump-hook()
  recursive-edit()
  debug(t)
* (byte-code "\301�\302\303!\207" [quit-flag t eval (ignore nil)] 2)
  flyspell-post-command-hook()
  recursive-edit()
  debug(t)
* (funcall #[257 "\302\300\242\301\242\303\304$\210\305�@�A\"\207" [(692) (791) put-text-property fontified nil signal] 6 "\n\n(fn ERR)"] err)
  jit-lock-fontify-now(692 1192)
  jit-lock-function(692)
  redisplay_internal\ \(C\ function\)()
  redisplay()
  sit-for(3)
  flyspell-check-word-p()
  byte-code("\306�  \306��\307 \203�\212\fb\210\310 \210)\311 \203#\310 \210p�`��\2029\306\211���   9\2039  \312N\2039\313��\314��\315 \204k��:\203k��@@��@A����\316����\"\203b\212��b\210\310 \210)��A��*\2029�\211��+\207" [inhibit-quit this-command deactivate-mark command flyspell-pre-point flyspell-pre-pre-buffer nil flyspell-check-pre-word-p flyspell-word flyspell-check-word-p flyspell-delayed -1 _ input-pending-p flyspell-check-changed-word-p flyspell-pre-pre-point flyspell-word-cache-end flyspell-word-cache-result flyspell-changes stop start flyspell-previous-command] 4)
  flyspell-post-command-hook()

@StreakyCobra
Copy link
Contributor

Probably something like:

(add-hook 'org-mode-hook 'spacemacs/toggle-spelling-checking-off [append])

in dotspacemacs/user-config. Not tested though.

@bwinkler
Copy link

bwinkler commented Sep 6, 2016

I'm not sure that it's flyspell since I'm getting the same behavior (hanging) with it disabled and with a similar backtrace. I think that something is just triggering fontification (flyspell, scrolling, etc.) and that some function being used as a font locking rule not returning or otherwise misbehaving.

So, how do we figure what is going on here:
(funcall #[257 "\302\300\242\301\242\303\304$\210\305�@�A\"\207" [(72443) (72639) put-text-property fontified nil signal] 6 "\n\n(fn ERR)"] err)

Is this a byte-compiled font-lock rule? The readme for font-lock-studio talks about both "Hanging emacs" and byte-compiled font lock rules. Unfortunately, since this doesn't happen every time org files are loaded, I'm not sure that using that package to debug will work.

@rundong08
Copy link

I've met similar issues in some other situations. I used gdb and found out that in the function redisplay_window (xdisp.c) (called indirectly by redisplay_internal (xdisp.c)), somehow the height of the mode line cannot be computed consistently.

Somewhere inside redisplay_window

if (WINDOW_WANTS_MODELINE_P (w)
      && CURRENT_MODE_LINE_HEIGHT (w) != DESIRED_MODE_LINE_HEIGHT (w))
    {
      f->fonts_changed = true;
      w->mode_line_height = -1;
      MATRIX_MODE_LINE_ROW (w->current_matrix)->height
        = DESIRED_MODE_LINE_HEIGHT (w);
}

The variable f->fonts_changed is set to be true, which causes the functionredisplay_window to be called again somewhere later. But then somehow the CURRENT_MODE_LINE_HEIGHT (w) is changed back to an "undesired" value before the code run to the if statement above, which causes a dead loop.

Those functions in xdisp.c are too long, so I didn't go further to inspect the reason.

@halvorlu
Copy link

I experience the same issue as i-brute-force. Any solutions found yet?

@angry-bird
Copy link

 same here, still searching for a solution

@varun531
Copy link

What font are you guys using? I found I need to have Source Code Pro AND have it installed (of course).

@halvorlu
Copy link

halvorlu commented Jan 3, 2017

I thought I was using Source Code Pro, but it seems I didn't have it installed. @varun531 : Did you fix the problem by installing it, or the other way around?

@varun531
Copy link

varun531 commented Jan 4, 2017

@halvorlu At the time I thought I had fixed the problem by installing Source Code Pro, but Emacs started hanging again the next day, despite the installed font. Very frustrating. I just get around it by mashing Ctrl-g whenever Emacs gets hung up on an .org file.

@richerve
Copy link

I'm having a similar issue. I notice that it happens when trying to open a Salstack (.sls) file. I'm using the salt layer that underneath is using mmm-mode to mix jinja and yaml

@richerve
Copy link

Now I found that it only happen when opening and .sls file that is using jinja to render jinja files. That's the case when using something like [https://github.com/audreyr/cookiecutter]. It throws the same error: Not enabling jit-lock: it does not work in indirect buffer

Maybe is related to the recent update of the spacemacs_theme which I'm using

@mcheema
Copy link

mcheema commented Jan 19, 2017

I have similar problems suddenly appear on my upto date OSX and I don't use spacemacs. I made some changes to try to make my .emacs more "modern" by copying large parts from a user here on github and changed my theme from default to wheatgrass. I added a bunch of stuff like flyspell, flycheck, ibuffer, ido, etc. with the use-package idiom so I am guessing that somewhere in there is the problem.

@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 Feb 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- Bug tracker - Org 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

10 participants