-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
magit ediff on unstaged file leads to emacs freeze. #4730
Comments
Ediff from magit is a nice feature, thanks for reminding me of it. I cannot reproduce your problem though - seems to work nicely... |
Could this be related to Issue #4474? |
I do confirm, #4474 gets reproduced on my setup. best regards. |
@vibrys I tested again on |
Sorry for late answer. I switched to spacemacs devel a few months ago to make sure I'm working with right code. regards, |
to be more precise, the last spacemacs devel version I observed freezes on is cf951a5. |
@vibrys could you please checkout on the latest Spacemacs version (v0.200.x) or on latest develop? |
I did happen today again. Tomorrow, I'll use newest version (f0803bc) and test it. regards |
I did happen again today on f0803bc develop. regards, |
In #7366, @randre03 has also been experiencing freezes with ediff, but from |
I have also experienced the same issue (magit ediff freezes Spacemacs at 2nd diff hunk, Emacs CPU at 100%). However, as @bmag hypothesized, I have had this same issue with just regular ediff so I don't think it is a magit problem. |
I copied two files, the one before change and the one after change, then opened these two buffers within two adjacent emacs windows, then did M-x ediff-buffers, and no freeze happened. Unfortunatelly I cannot send buffer contents. I have prepared branch which is 100% reproducible. I'll try to start magit without spacemacs. Then I'll try to see the difference with magit, but after change has been staged, then commited. Maybe I should send some signal to emacs while it is in feeze, with some debug-on-quit? Then see what is emacs stack trace? |
@PrgrmAtCeleritas thanks for the files. Unfortunately, for some reason I am still unable to reproduce the bug on Emacs 24.5.1 with Spacemacs 0.200.3. Since @vibrys discovered that the display engine hangs (in This is the setup I tried to repro with: System Info 💻
(helm emacs-lisp) @PrgrmAtCeleritas can you try and repro with this minimal setup? If it doesn't repro, then bisecting your config should lead you to the problematic (combination of) layers/config. If you can share your system information ( Also, are these really |
They are perl (It won't let me upload files with that extension). However, I still encounter the bug whether they are txt or pl. The major-mode doesn't seem to make a difference. System Info 💻
(csv javascript helm auto-completion better-defaults tmux ranger vinegar emacs-lisp git
(shell :variables shell-default-height 30 shell-default-position 'bottom)
syntax-checking version-control) I will try with a minimal setup and see what happens. |
I tried it with the minimal setup below. System Info 💻
(helm emacs-lisp) I still encounter the same problem. I also tried it with stock Emacs 24.5.1 and it has no problems, so it is not something wrong with my Emacs itself. Not sure if this has already been discovered, but given what @vibrys uncovered about the display engine hanging I tried running Spacemacs Ediff in the terminal with my full setup and it does not have any problems. This may provide a temporary workaround until this issue is resolved. |
I went ahead and used @bmag or @d12frosted is there someone within the Spacemacs project who knows enough to look at this backtrace and get more insight about what may have caused the problem? backtrace file |
I have another update which will hopefully help resolve this issue. I did some more debugging (This issue is really painful) and I tracked down the source of the problem to the That is one thing I found. The other has to with the function I would be very interested to see if @vibrys can produce the same results with the same changes. I am not sure what the Spacemacs Collaborators want to do about this issue since it is clearly not affecting everyone. However I think I have found a fix for those people who are encountering this problem. Just remove that one line and it should work, at least it does for me. |
According to the backtrace provided by @PrgrmAtCeleritas (thank you!),
Instead, you can add this line to (setq ediff-window-setup-function 'ediff-setup-windows-default) Can anyone else who is facing this problem confirm that setting
We'd like to fix the issue, of course, but I fear it might take some serious expertise, especially regarding the display engine. Since we barely have a clue of what's wrong, our concern right now is to isolate the cause for the issue as much as possible. Unfortunately I still can't reproduce the issue, so I have to ask you to take on yourself most of the burden of debugging. Can you reproduce it with spacemacs-base? Change
This has the same effect as using the default You can also try to reproduce the issue with plain Emacs, (require 'package)
;; if you use a non-nil `dotspacemacs-elpa-subdirectory':
;; (setq package-user-dir "path/to/elpa")
(package-initialize)
(require 'which-key)
(require 'evil-ediff)
;; which-key configuration goes here
;; ediff configuration goes here
;; evil-ediff configuration goes here @vibrys we would like to hear your feedback as well. |
@bmag, the following workaround works ok: The following does not reproduce the problem. ~/.emacs
Additionally I installed magit.
No reproduce. additionally I did no reproduce. what do You want me to do as next step? regards |
@vibrys the If you can't repro with a |
spacemacs-ui-visual ;; problem appears after adding this layer. |
@PrgrmAtCeleritas, configuring the following does not help on my config:
version used: There is one thing I don't like though. |
Additionally it is enough to enable spacemacs-ui-visual to have problem reproduced, ie. no other layers from the list above need to be added to spacemacs-base. |
I think it also depends on the font. Some fonts are fine with 1.1 and others are not. At least in my testing. |
@PrgrmAtCeleritas I would be careful about assuming things like that. This bug is extremely random (probably a race condition somewhere). So you can go for hours without seeing it and then suddenly it happens again. I was just editing a diff with magit and ediff and had no problem for 20 minutes, then it froze. For now I will type "w c" (write buffer C to disk) a lot to save my work as I progress through the file. |
Very consistent for me. When I have created a condition where it will freeze I make it freeze every single time. Seems to be the same for the others as well. You are the only one that has mentioned inconsistency. |
Well yeah it isn't consistent for me. |
Hi ! I'm Spacemacs user about 1 month and the ediff freezing bug are the only things is annoying me a lot and that I had to take time to fix on my todo list . I don't have tested more than 1 hour but (add-hook 'ediff-before-setup-hook 'spacemacs/toggle-mode-line-off)
(add-hook 'ediff-quit-hook 'spacemacs/toggle-mode-line-on) Thx ! |
@prestancedesign Cool. Is that 100% a solution against the hangs? |
@SteveJobzniak Yes that seems. Yesteday afternoon, only one freeze when I ediff a local file against this remote version via this package https://github.com/cjohansson/emacs-ssh-deploy. I'll see on a longer use this week to see if this fix fixes that at 100% and keep you up to date. |
@prestancedesign Cool, thanks for the information! Have a nice day too! 👍 |
I have been going crazy from ediff freezes for a long time now, too bad I failed to find this issue earlier. I work mainly with hg repos, but from what I've read so far it's not git-related. Initial tests indicate that the toggling of mode line in the ediff hooks works, we'll see if it stands the test of time... Cheers everyone for your efforts! |
Toggling the mode line did not do the trick, unfortunately. Locks became much more rare, but didn't take long for a lockup to happen. Disabling |
It definitely happens less often than it used to, but still happens. It just froze when I tried to search in ediff middle window. Oh, and that seems to be very reproducible. File even doesn't have to be unstaged. |
goddamit... ediff has become just completely unusable... can't do anything anymore... try for example resizing one of the windows... sigh... whoever finds nice workaround (or guaranteed fix) I'll send them nice bottle of scotch. |
@agzam Does disabling |
I'm unable to reproduce the crash or freezing in Ubuntu 16.10 System Info 💻
(helm emacs-lisp git org version-control)
It's running in virtual box with windows 10 as the host, if that could be preventing the crash some how. It doesn't happen in windows 10 either, but the reports here are for Linux, so it might not be relevant, but it's another data point: System Info 💻
(autohotkey markdown ranger emacs-lisp git github helm org syntax-checking version-control)
|
This is a "works fine for some people" issue. I think it is system dependent as best I can figure. |
@CeleritasCelery yup, it might be affecting only Mac users. My Linux laptop not with me right now. Can't confirm if that breaks there. |
I am still seeing hard locks on macos High Sierra running latest develop. |
edit: I'd forgotten that a Have you tried adding the following to
In the unlikely event that that trick does not avoid the freezes, you might try double checking whether your mode-line includes any unicode after it has already frozen (since some unicode symbols are only conditionally displayed, like workspace numbers -- which incidentally also happens to make |
Still happening to me 100% of the time. I've tried disabling spaceline, mode-line and setting System Info 💻
(haskell helm emacs-lisp git markdown html react javascript clojure common-lisp csv php ruby typescript vimscript go yaml java nginx docker ansible vagrant osx colors git github themes-megapack)
|
@marcoslhc where did you change Did you already try changing the line in If that does not work (after a restart), and
My best guess is that you have unicode symbols somewhere else that are causing issues -- maybe a file tree plugin that displays file icons, or something? |
for me, the work around for this is |
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! |
Description
magit ediff command on unstaged file leads to emacs freeze.
This does not happen at every ediff command. Roughly 30% visits lead to freeze. Remaining ones behave correctly.
It never happened when ediffing file change from an already commited change.
This also does not happen on my non-spacemacs configuration, where ediff is also within the same single window.
Reproduction guide
at some point emacs stops responding on n/p keypresses and it starts consuming 100% CPU.
Subsequent C-g makes emacs back from freeze, but cursor is left within most left source code window, not within ediff bottom line.
System Info
Backtrace
after toggle-debug-on-quit, C-g tells:
Debugger entered--Lisp error: (quit)
redisplay_internal\ (C\ function)()
The text was updated successfully, but these errors were encountered: