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

Deadlock on Windows with helm-do-ag #188

Open
jeberger opened this issue Nov 27, 2015 · 18 comments
Open

Deadlock on Windows with helm-do-ag #188

jeberger opened this issue Nov 27, 2015 · 18 comments

Comments

@jeberger
Copy link

I'm experiencing random Emacs freezes when using helm-do-ag (or helm-do-ag-project-root) on Windows.

Steps to reproduce

  • M-x helm-do-ag
  • type some search terms, look at the results, add some other search terms (or some --ignore options)
  • eventually Emacs freezes and needs to be killed from the windows process manager.

Note that when Emacs is frozen, there is no ag process in the windows process manager.

Software versions

  • GNU Emacs 24.5.1 (i686-pc-mingw32) of 2015-04-11 on LEG570
  • helm 20151125.2229 (installed from melpa)
  • helm-ag 20151029.2208 (installed from melpa)
  • ag version 0.31.0
  • Windows 7 64 bits
@syohex
Copy link
Contributor

syohex commented Nov 27, 2015

Which ag do you use ? cygwin ?

@jeberger
Copy link
Author

I've compiled ag from sources using mingw.

@syohex
Copy link
Contributor

syohex commented Nov 28, 2015

I've compiled ag from sources using mingw.

Thanks

And could you show me your configuration of helm-ag ?

I don't have Windows machine now. I'll check this issue next week.

@jeberger
Copy link
Author

And could you show me your configuration of helm-ag ?

Here it is:

(when (executable-find "ag")
  (defun jmb/helm-do-ag-at-project-root-or-folder ()
    "Run `helm-do-ag-project-root' or `helm-do-ag' depending on
whether a project root is found or not."
    (interactive)
    (if (helm-ag--project-root)
        (helm-do-ag-project-root)
      (helm-do-ag)))
  (use-package
    helm-ag
    :commands helm-ag
    :init
    (eval-after-load 'helm
      '(define-key helm-command-prefix (kbd "s")
         'jmb/helm-do-ag-at-project-root-or-folder))))

You can see the rest of the helm configuration here.

@syohex
Copy link
Contributor

syohex commented Nov 30, 2015

Hmm, I cannot reproduce this issue.

@jeberger
Copy link
Author

Just in case, here is the ag binary I've compiled: https://www.dropbox.com/s/qi6gj7om4x0nv21/ag.zip?dl=0

Some extra information which may be relevant:

  • I don't have the problem with the same emacs/helm/helm-ag/ag versions on Linux.
  • The problem only occurs on local files. When I run helm-do-ag for remote files on a tramp connection, everything works fine.
  • It may be related to typing speed: each time I've had the problem, Emacs froze while in the middle of typing a word, never when I pause between words, nor when I remember to type slowly.

@darfink
Copy link

darfink commented Feb 17, 2016

I am experiencing the same issue. It occurs frequently.

One difference in my experience is that the ag.exe process is still running in the task manager,
and if I kill the process, the helm-ag menu closes and emacs becomes responsive again.

Software versions

  • GNU Emacs 25.0.91.1 (x86_64-w64-mingw32)
  • helm 20160211.934 (installed from melpa)
  • helm-ag 20160126.2147 (installed from melpa)
  • ag version 0.29.1
  • Windows 7 64 bits

NOTE: I installed Ag & Emacs via Chocolatey

@syohex
Copy link
Contributor

syohex commented Feb 17, 2016

Hmm, this is windows specific issue and I suppose it is necessary to fix helm or Emacs core for resolving this issue.

@Lompik
Copy link

Lompik commented Apr 15, 2016

Yep it's specific to how Microsoft Windows kills processes : http://www.gnu.org/software/emacs/manual/html_mono/efaq-w32.html#Killing-subprocesses . Those freezes aren't usually reproducible on linux.

Terminating ag while its still running should un-hang emacs (or hit Ctrl-g).

In trying to deal with this, I tried to slow down helm's interactiveness by increasing helm-input-idle-delay or type the search term fast so that the ag subprocess does not start.

@darfink
Copy link

darfink commented Apr 18, 2016

I have noticed that the ag process is not always visible in the task manager when these freezes occur.
If it is, I can always kill the process and emacs becomes responsive, but if it's not listed in the task manager, I have to kill the emacs process instead.

@torgeir
Copy link

torgeir commented Jun 1, 2016

I'm also seeing these kind of hangs

@puzl
Copy link

puzl commented Nov 14, 2016

I'm still getting this issue. I'm wondering if anyone has found a workaround?

@Swoorup
Copy link

Swoorup commented Dec 7, 2016

Same here as well.

@syohex
Copy link
Contributor

syohex commented Jan 18, 2017

I recently use Windows machine. However I cannot reproduce this issue yet. Please tell me how to reproduce this issue in more detail.

  • Reproduce steps
  • Minimum configuration

@JonnyWalker81
Copy link

I am experiencing a hang on a macOS machine. It just started when I upgraded to the new MacBook Pro with Touch Bar. I am using version 26.0.50 of Emacs.

@cmorgan
Copy link

cmorgan commented Apr 25, 2017

same issue and platform here

@cmorgan
Copy link

cmorgan commented Jul 14, 2017

how do we go about solving this? I'm inexperienced with debugging emacs / elisp, can anyone provide pointers?

@cmorgan
Copy link

cmorgan commented Jul 14, 2017

I managed to get this stable on Windows by bumping a few delays up:

(setq helm-input-idle-delay 0.1)
(setq helm-cycle-resume-delay 2)
(setq helm-follow-input-idle-delay 1)

I guess it's due to the crappy interop on Windows, but didn't dig further

jeberger added a commit to jeberger/swiper that referenced this issue Oct 12, 2017
This is probably a good idea performance-wise since it limits the number
of collection updates when the user is typing. However, the main reason
for this change is to work around an Emacs freeze on Windows when the
dynamic collection is generated by an external command (see for example
this bug in helm-ag which also affects counsel-ag and similar commands:
emacsorphanage/helm-ag#188).

Related to abo-abo#1218 (but only applies for dynamic collections, where the
difference is really noticeable).
Helps with abo-abo#1198 and abo-abo#786.
abo-abo pushed a commit to abo-abo/swiper that referenced this issue Nov 13, 2017
This is probably a good idea performance-wise since it limits the number
of collection updates when the user is typing. However, the main reason
for this change is to work around an Emacs freeze on Windows when the
dynamic collection is generated by an external command (see for example
this bug in helm-ag which also affects counsel-ag and similar commands:
emacsorphanage/helm-ag#188).

Related to #1218 (but only applies for dynamic collections, where the
difference is really noticeable).
Helps with #1198 and #786.

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

No branches or pull requests

9 participants