helm-ag icon indicating copy to clipboard operation
helm-ag copied to clipboard

Deadlock on Windows with helm-do-ag

Open jeberger opened this issue 10 years ago • 18 comments

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

jeberger avatar Nov 27 '15 09:11 jeberger

Which ag do you use ? cygwin ?

syohex avatar Nov 27 '15 10:11 syohex

I've compiled ag from sources using mingw.

jeberger avatar Nov 27 '15 11:11 jeberger

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.

syohex avatar Nov 28 '15 01:11 syohex

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.

jeberger avatar Nov 28 '15 06:11 jeberger

Hmm, I cannot reproduce this issue.

syohex avatar Nov 30 '15 03:11 syohex

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.

jeberger avatar Nov 30 '15 07:11 jeberger

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

darfink avatar Feb 17 '16 10:02 darfink

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

syohex avatar Feb 17 '16 12:02 syohex

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.

Lompik avatar Apr 15 '16 07:04 Lompik

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.

darfink avatar Apr 18 '16 14:04 darfink

I'm also seeing these kind of hangs

  • emacs-24.4-bin-i686-pc-mingw32 (https://ftp.gnu.org/gnu/emacs/windows/)
  • helm-20160530.424 (melpa)
  • helm-ag-20160527.754 (melpa)
  • ag version 0.31.0
  • Windows 7 64 bits

torgeir avatar Jun 01 '16 12:06 torgeir

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

puzl avatar Nov 14 '16 10:11 puzl

Same here as well.

Swoorup avatar Dec 07 '16 16:12 Swoorup

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

syohex avatar Jan 18 '17 10:01 syohex

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.

JonnyWalker81 avatar Jan 31 '17 21:01 JonnyWalker81

same issue and platform here

cmorgan avatar Apr 25 '17 15:04 cmorgan

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

cmorgan avatar Jul 14 '17 07:07 cmorgan

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

cmorgan avatar Jul 14 '17 10:07 cmorgan