zsh at 100% CPU #24
I've the same issue.
zsh 5.0.5 (x86_64-redhat-linux-gnu)
ltrace return a loop of this:
strcpy(0xc37860, "autosuggest-pop-suggestion") = 0xc37860
strlen("") = 0
strlen("3") = 1
malloc(2) = 0xaa31f0
strcpy(0xaa31f0, "3") = 0xaa31f0
strcmp("where-is", "autosuggest-pop-suggestion") = 22
free(0xaa31f0) = <void>
free(0xc37860) = <void>
free(0xc36b50) = <void>
sigemptyset(<>) = 0
sigaddset(<27>, SIGWINCH) = 0
sigprocmask(SIG_BLOCK, <27>, <27>) = 0
sigemptyset(<>) = 0
sigaddset(<27>, SIGWINCH) = 0
sigprocmask(0, <27>, <>) = 0
malloc(16) = 0xc36b50
strlen("autosuggest-pop-suggestion") = 26
malloc(27) = 0xc37860
strcpy(0xc37860, "autosuggest-pop-suggestion") = 0xc37860
strlen("") = 0
strlen("3") = 1
malloc(2) = 0xaa31f0
strcpy(0xaa31f0, "3") = 0xaa31f0
strcmp("where-is", "autosuggest-pop-suggestion") = 22
free(0xaa31f0) = <void>
free(0xc37860) = <void>
free(0xc36b50) = <void>
sigemptyset(<>) = 0
sigaddset(<27>, SIGWINCH) = 0
sigprocmask(SIG_BLOCK, <27>, <27>) = 0
sigemptyset(<>) = 0
sigaddset(<27>, SIGWINCH) = 0
sigprocmask(0, <27>, <>) = 0
malloc(16) = 0xc36b50
strlen("autosuggest-pop-suggestion") = 26
malloc(27) = 0xc37860
strcpy(0xc37860, "autosuggest-pop-suggestion") = 0xc37860
strlen("") = 0
strlen("3") = 1
malloc(2) = 0xaa31f0
strcpy(0xaa31f0, "3") = 0xaa31f0
strcmp("where-is", "autosuggest-pop-suggestion") = 22
free(0xaa31f0) = <void>
free(0xc37860) = <void>
free(0xc36b50) = <void>
sigemptyset(<>) = 0
sigaddset(<27>, SIGWINCH) = 0
and strace:
poll([{fd=10, events=POLLIN}, {fd=3, events=POLLIN}], 2, 4294967295) = 1 ([{fd=3, revents=POLLIN}])
rt_sigprocmask(SIG_BLOCK, [WINCH], [], 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [WINCH], [WINCH], 8) = 0
poll([{fd=10, events=POLLIN}, {fd=3, events=POLLIN}], 2, 4294967295) = 1 ([{fd=3, revents=POLLIN}])
rt_sigprocmask(SIG_BLOCK, [WINCH], [], 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [WINCH], [WINCH], 8) = 0
poll([{fd=10, events=POLLIN}, {fd=3, events=POLLIN}], 2, 4294967295) = 1 ([{fd=3, revents=POLLIN}])
rt_sigprocmask(SIG_BLOCK, [WINCH], [], 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [WINCH], [WINCH], 8) = 0
poll([{fd=10, events=POLLIN}, {fd=3, events=POLLIN}], 2, 4294967295) = 1 ([{fd=3, revents=POLLIN}])
rt_sigprocmask(SIG_BLOCK, [WINCH], [], 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [WINCH], [WINCH], 8) = 0
poll([{fd=10, events=POLLIN}, {fd=3, events=POLLIN}], 2, 4294967295) = 1 ([{fd=3, revents=POLLIN}])
rt_sigprocmask(SIG_BLOCK, [WINCH], [], 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [WINCH], [WINCH], 8) = 0
poll([{fd=10, events=POLLIN}, {fd=3, events=POLLIN}], 2, 4294967295) = 1 ([{fd=3, revents=POLLIN}])
rt_sigprocmask(SIG_BLOCK, [WINCH], [], 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [WINCH], [WINCH], 8) = 0
poll([{fd=10, events=POLLIN}, {fd=3, events=POLLIN}], 2, 4294967295) = 1 ([{fd=3, revents=POLLIN}])
rt_sigprocmask(SIG_BLOCK, [WINCH], [], 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [WINCH], [WINCH], 8) = 0
poll([{fd=10, events=POLLIN}, {fd=3, events=POLLIN}], 2, 4294967295) = 1 ([{fd=3, revents=POLLIN}])
rt_sigprocmask(SIG_BLOCK, [WINCH], [], 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [WINCH], [WINCH], 8) = 0
poll([{fd=10, events=POLLIN}, {fd=3, events=POLLIN}], 2, 4294967295) = 1 ([{fd=3, revents=POLLIN}])
rt_sigprocmask(SIG_BLOCK, [WINCH], [], 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [WINCH], [WINCH], 8) = 0
poll([{fd=10, events=POLLIN}, {fd=3, events=POLLIN}], 2, 4294967295) = 1 ([{fd=3, revents=POLLIN}])
rt_sigprocmask(SIG_BLOCK, [WINCH], [], 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [WINCH], [WINCH], 8) = 0
poll([{fd=10, events=POLLIN}, {fd=3, events=POLLIN}], 2, 4294967295) = 1 ([{fd=3, revents=POLLIN}])
rt_sigprocmask(SIG_BLOCK, [WINCH], [], 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [WINCH], [WINCH], 8) = 0
poll([{fd=10, events=POLLIN}, {fd=3, events=POLLIN}], 2, 4294967295) = 1 ([{fd=3, revents=POLLIN}])
rt_sigprocmask(SIG_BLOCK, [WINCH], [], 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [WINCH], [WINCH], 8) = 0I get this as well, but only if I am running within tmux. It works fine without tmux.
I've same problem — process is taking up 100% CPU
zsh 5.0.5 (x86_64-apple-darwin14.0)
Confirming, I have the same problem.
zsh 5.0.5 (x86_64-unknown-linux-gnu)
Sorry for the inactivity guys, I'm aware of this bug with zsh 5 but still didn't have time to look into it
My current workaround is to disable the autosuggest-server:
#if is-at-least 5.0.3; then
## autosuggest-ensure-server
##fi
It seams not be an issue at all with zsh 5, but the server
Looking into this a little bit it looks like autosuggest-ensure-server is just broken, and the reason this problem only shows up in zsh > 5 is that the place that function is called is in an if statement which is only true for zsh > 5.0.3.
As @Mic92 said, the solution is to comment out those lines. Note this does not disable the autosuggest-server, just disables the extra check to ensure it is running (which seems to be unnecessary). I have not noticed any missing functionality from doing this.
As @Mic92 said, the solution is to comment out those lines. Note this does not disable the autosuggest-server, just disables the extra check to ensure it is running (which seems to be unnecessary). I have not noticed any missing functionality from doing this.
The server was created to asynchronously provide autosuggestions from user completion functions(right now it only uses history), which could be slow. Zsh 4 had some limitations that blocked this server from functioning properly, but this may have been fixed in zsh 5. The mailing list thread where I announced this plugin contains more information: http://www.zsh.org/mla/users/2013/msg00546.html
So I ended up adding a version check to only enable the server in Zsh 5, but unfortunately I didn't have the time to test or fix it(I'm still using zsh4). I will push a fix that disables the server until I find the time to look into it.
Thanks for the temporary fix tarruda. I did a "git pull" and my problem was solved after restarting zsh.
After setting up autosuggestions every zsh shell process is taking up 100% CPU after using suggestions once. From my zshrc:
zsh:
Let me know if I can help.