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

Freeze while searching in file using / #9220

Closed
achikin opened this issue Jul 12, 2017 · 22 comments
Closed

Freeze while searching in file using / #9220

achikin opened this issue Jul 12, 2017 · 22 comments

Comments

@achikin
Copy link

achikin commented Jul 12, 2017

Description :octocat:

Emacs freezes while searching in file using /

Reproduction guide 🐞

  • Start Emacs
  • Open quite big file (200+ lines)
  • Press /
  • Type in one letter

Observed behaviour: 👀 💔

  • Emacs takes up 96% CPU and freezes

Expected behaviour: ❤️ 😄

  • Emacs searches for the letter

System Info 💻

  • OS: darwin
  • Emacs: 25.2.1
  • Spacemacs: 0.200.9
  • Spacemacs branch: develop (rev. 7e57b1f)
  • Graphic display: t
  • Distribution: spacemacs
  • Editing style: vim
  • Completion: helm
  • Layers:
(sql helm auto-completion syntax-checking better-defaults emacs-lisp git clojure html markdown parinfer)
  • System configuration features: NOTIFY ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS NS MODULES

Backtrace 🐾

@achikin achikin closed this as completed Jul 12, 2017
@achikin achikin reopened this Jul 12, 2017
@bobsongplus
Copy link
Contributor

There is too little information to diagnose the problem, you can use profiler-start command to check where stacked

@delaanthonio
Copy link
Contributor

@achikin Do you get this issue when using the Spacemacs master branch?

@braham-snyder
Copy link
Contributor

braham-snyder commented Jul 14, 2017

does excluding the spaceline package (add it to dotspacemacs-excluded-packages, which should be in a setq in your init file) circumvent the issue? if so, may be:

TheBB/spaceline#123 (comment)

if not, the pkill -USR2 bit in there may still help you diagnose your issue (it opens a backtrace ASAP)

@mathpunk
Copy link
Contributor

I thought the recommendation to disable unicode in powerline here TheBB/spaceline#123 (comment) fixed my issue, but, it just happened again. I will try pkill -USR2 next time it happens.

@braham-snyder
Copy link
Contributor

Did you set it in dotspacemacs/init? For what it's worth, if you set it in dotspacemacs/user-config (and possibly even in dotspacemacs/user-init), it won't actually be set in time to take effect.

@mathpunk
Copy link
Contributor

I did not! I've kept away from that expression entirely. I have now set it in dotspacemacs/init, after the setq-default expression. Thanks, I'll see how it goes.

@carloscheddar
Copy link

I'm running the latest develop changes and this issue is still happening even after I added (setq dotspacemacs-mode-line-unicode-symbols nil) to dotspacemacs/init. I can search a few times but after 6 or 7 times it hangs.

@carloscheddar
Copy link

Quick update: Excluding the spaceline package definitely fixes the issue. I also removed the (setq dotspacemacs-mode-line-unicode-symbols nil) line and everything works correctly.

@braham-snyder
Copy link
Contributor

@carloscheddar that's odd -- but just to double check: a line already exists in the default .spacemacs file as: (setq dotspacemacs-mode-line-unicode-symbols t) within dotspacemacs/init (not within dotspacemacs/user-init). Does changing that line to use nil and restarting (SPC q r) still not work?

If not, when the freeze occurs, you might want to triple check your modeline for any unicode characters: I suspect I initially ran into trouble partly because the only unicode symbols I used on my modeline were the workspace numbers, which are frequently hidden (so I didn't notice that I hadn't successfully turned them off).

@carloscheddar
Copy link

@braham-snyder After verifying my config I finally found what was causing the hang.
I had added this line to the user-config from a suggestion on the mac section of the readme:

(setq powerline-default-separator 'utf-8)

After removing it everything works as expected even with dotspacemacs-mode-line-unicode-symbols set to t.

@jonathanj
Copy link

My powerline-default-separator is set to 'slant and I still have this hanging, with the same trace as in #9595. I'm going to try @braham-snyder's suggestion regarding dotspacemacs-mode-line-unicode-symbols.

@x-ji
Copy link
Contributor

x-ji commented Jun 28, 2018

It also doesn't work for me. I'm not even using spaceline. I'm using vim-powerline. Is there a way to just disable this instant search behavior and only search when I hit enter?

@JonathanReeve
Copy link

This bug is driving me nuts. It will lock up my emacs for about 30s-1m, at times, when I search for anything in a large file. Is there a way to disable this instant search until at least three or four characters have been typed?

@duianto
Copy link
Contributor

duianto commented Nov 26, 2019

@JonathanReeve
It might help to try another search tool.

It's chosen from the .spacemacs variable: dotspacemacs-search-tools

On the develop branch there's also support for rg:
https://github.com/BurntSushi/ripgrep

The default value is:
'("rg" "ag" "pt" "ack" "grep")

It uses the first tool it finds, as the comment above the variable says:

;; List of search tool executable names. Spacemacs uses the first installed
;; tool of the list. Supported tools are `rg', `ag', `pt', `ack' and `grep'.

@JonathanReeve
Copy link

It doesn't seem to matter which tool you use. I've tried it with ag and grep both, but the problem persists. In fact, I'm writing this comment now while waiting for a search to finish highlighting on a large org file. It's been about a minute or two.

Once spacemacs gets started with searching and highlighting single letters, it can't be stopped: not with Ctrl+G, not with Esc, or by trying to close Emacs.

I'll echo @x-ji's question above and ask: is there a way to disable typeahead search? From there it should be possible to disable it for large files.

@duianto
Copy link
Contributor

duianto commented Nov 26, 2019

These variables might be what your looking for:

  • helm-grep-input-idle-delay

Its value is 0.6
Same as ‘helm-input-idle-delay’ but for grep commands.
It have a higher value than ‘helm-input-idle-delay’ to avoid
flickering when updating.

  • helm-input-idle-delay

Its value is 0.01
Idle time before updating, specified in seconds.

@JonathanReeve
Copy link

Apparently when you set those values to a higher number, say, 1.0, it still has the issue. To reproduce, try doing this:

  • Get a large org mode file (or probably any other type with syntax highlighting). A 500k file would be fine.
  • Search the file for something. Say, abc.
  • Notice that emacs totally freezes up after typing a, and insists on highlighting every single instance of the letter a in your file. Notice that the freeze lasts about a minute.

@gberenfield
Copy link

gberenfield commented Nov 29, 2019

Unfortunately none of the above helped. I did my trick usual of commenting out large chunks of config and found that disabling smooth scrolling fixed it for me.

dotspacemacs-smooth-scrolling nil

HTH
Greg

@JonathanReeve
Copy link

I don't see what scrolling has to do with it. I'm not even scrolling when this is happening. But anyway, I've had smooth scrolling disabled this whole time, so that doesn't help.

@gberenfield
Copy link

Well neither do I but it seemingly worked. Today, not so well (froze again).

So in debugging, the last line before freezing is
command-execute(evil-ex-search-forward)

This is in evil-commands.el in the base evil package. Looking there, I found this bug
emacs-evil/evil#1101

Testing 'search-invisible' set to nil and will see if that works...

@TheBB
Copy link
Contributor

TheBB commented Jan 17, 2020

This should have been fixed in Evil.

@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 Jan 16, 2021
@lebensterben lebensterben removed stale marked as a stale issue/pr (usually by a bot) Kills Kittens (=^-^=) labels Aug 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests