zsh-autocomplete
zsh-autocomplete copied to clipboard
crash when press arrow up key
To reproduce, first, input something that doesn't match anything in current folder , say, cd../bash;
or cd sdfdsfsf;
or nvim ssfs;
then press the arrow up key twice, the zsh crashes with the following message printed in the terminal.
free(): corrupted unsorted chunks
or
corrupted double-linked list
or
malloc(): unaligned tcache chunk detected
Warning: Program '/bin/zsh' crashed.
Normally the color of the text of the command changes and it won't prompt anything.
I tried this on another machine with the same setup.
Konsole won't crash it is stuck at loading
, I have to ctrl+c to stop it.
Environment
% typeset -p1 VENDOR OSTYPE ZSH_PATCHLEVEL _autocomplete__funcfiletrace
typeset VENDOR=pc typeset OSTYPE=linux-gnu typeset ZSH_PATCHLEVEL=zsh-5.9-0-g73d3173 typeset -a _autocomplete__funcfiletrace=( /usr/share/zsh/plugins/zsh-autocomplete/zsh-autocomplete.plugin.zsh:4 /usr/share/zsh/manjaro-zsh-prompt:6 /usr/share/zsh/manjaro-zsh-prompt:1 /home/mjan/.zshrc:9 zsh:0 )
- Terminal emulator: Konsole
.zshrc
# Use powerline
USE_POWERLINE="true"
# Source manjaro-zsh-configuration
if [[ -e /usr/share/zsh/manjaro-zsh-config ]]; then
source /usr/share/zsh/manjaro-zsh-config
fi
# Use manjaro zsh prompt
if [[ -e /usr/share/zsh/manjaro-zsh-prompt ]]; then
source /usr/share/zsh/manjaro-zsh-prompt
fi
Try to roll-back to 2023-05-24 release for now until it is fixed; I am not finding (for now) that problem in this version. I am concerned that you posted this 8 days ago and nobody even noticed, rolling-back apparently gets rid of this bug.
Sadly the previous version doesn't seem to work with zsh 5.9, just leaving a line of command not found errors in any cases of recursive calls.
I have experienced the same issue. I can reproduce this intermittently with any failed zsh command, like an invalid program name, etc. Using invalid cd commands, like the OP, can reproduce this issue reliably.
typeset VENDOR=ubuntu
typeset OSTYPE=linux-gnu
typeset ZSH_PATCHLEVEL=ubuntu/5.8.1-1
typeset -a _autocomplete__funcfiletrace=(
/home/fshuva/.oh-my-zsh/custom/plugins/zsh-autocomplete/zsh-autocomplete.plugin.zsh:4
/home/fshuva/.oh-my-zsh/oh-my-zsh.sh:179
/home/fshuva/.oh-my-zsh/oh-my-zsh.sh:208
/home/fshuva/.zshrc:122
zsh:0
)
Terminal: GNOME Terminal
.zshrc
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" fi
bindkey '^ ' autosuggest-accept
plugins=(git tmux zsh-autosuggestions zsh-syntax-highlighting zsh-autocomplete )
source $ZSH/oh-my-zsh.sh autoload -U compinit; compinit
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh export FZF_DEFAULT_OPTS='--height 40% --layout=reverse --border'
I am having the same issue on m2 MacBook pro zsh 5.9 (x86_64-apple-darwin23.0). Pressing up after a command has failed freezes the shell with the cursor blinking and zsh taking 100% of CPU.
Aftering ctrl-c it gives this:
zsh(22992,0x1e12f5300) malloc: Incorrect checksum for freed object 0x12a814000: probably modified after being freed.
Corrupt value: 0x600002b3e200
zsh(22992,0x1e12f5300) malloc: *** set a breakpoint in malloc_error_break to debug
The same is happening on my fedora. Steps:
- dnf provides chsh
- Press up arrow
- Crash
gdb crash log (not sure if I'm using this right)
Program received signal SIGSEGV, Segmentation fault.
0x00007fffea576a08 in singledraw ()user
at /usr/src/debug/zsh-5.9-7.fc38.x86_64/Src/Zle/complist.c:1953
It seems like the issue is fixed on zsh 5.9 m2 macbook pro if you revert to commit 3942311
, still hoping for a proper fix though.
Got the same issue yeah. I had to disable the plugin as it breaks my shell for now.
Same here, when I cd into a folder inside my Downloads folder and I press the up key, it crashes:
20A[30Cfree(): corrupted unsorted chunks
I get this crash issue too on both my terminal and my terminator
Click on the window you want to change the opacity for â•â”€î‚²free(): corrupted unsorted chunks················░▒▓ ✔  at 16:18:49  ─╮ [1] 32937 IOT instruction (core dumped) zsh
Same issue here. On a M2 and it causes a crash, with my CPU usages shooting up to 97% with zsh. The fan even came on!
This is pretty annoying :(
A simple solution that works for me.
I did comment out lines 61 to 67 in the file Completions/_autocomplete__history_lines
60 local -P groups="${(l:$(( 2 * $#words[CURRENT] ))::=0:):-}"
61 # _comp_colors=( # ERROR
62 # "=(#b)${numpat}${lbuffer}(${query})${rbuffer}${rbuffer:+[[:blank:]]#}=2=2=0=0=30; 103$groups"
63 # "=(#b)${numpat}${lbuffer}(${query})*=2=2=0=30;103$groups"
64 # "=(#b)${numpat}${lbuffer}(*)=2=2=0"
65 # "=(#b)${numpat}*=0=2"
66 # ${(M)_comp_colors:#ma=*}
67 # )
Thanks @Luk9091 ! I think the history should be disable for now, this is breaking almost all my installation. Both macOS and Ubuntu
I get similar issue like this where it just gets stuck ðŸ˜
https://github.com/marlonrichert/zsh-autocomplete/assets/42609860/2d23ac6a-ebfc-4acf-85f5-dd5fffef0856
@joo920131 I see the same issue on my M1 machine with zsh 5.9 :-/
anyone know if rolling back to an older version works?
anyone know if rolling back to an older version works?
Yes, I rolled back to the previous release (https://github.com/marlonrichert/zsh-autocomplete/releases/tag/23.05.24), and I no longer have the issue on both Linux and macOS.
This is annoying. It also happens to Fedora 39.
Experiencing this issue on Debian 11 and MacOS (M2, latest OS)
Same Issue When Click Arrow Key Terminal Crashed...(Some Time) Arch Linux 6.6.10 zsh 5.9
Same here trying to complete non existing paths Arch Linux 6.7.0-zen3-1-zen zsh 5.9 (x86_64-pc-linux-gnu)
same question
I put this at the bottom of my .zshrc
source ~/.oh-my-zsh/custom/plugins/zsh-autocomplete/zsh-autocomplete.plugin.zsh
which seems to have fixed it for me
Hopefully, i will give it a try.
Hopefully, i will give it a try.
Nope, unfortunately it's not working for me.
Finally, I have been having this issue since I updated and the error happens so fast that you can barely see what it says but it basically a free() error, unsupported chunks, double link something and this happens most of the times when using arrow keys on the history. IMPORTANT If you use tmux the terminal will just hang there when pressing the arrows keys on the history, I thought tmux was the issue, but with a gnome terminal with zsh I could finally see these errors. And no, I can roll back because of compatibility issues. But I think it might something about freeing an already "freed" pointer. I am not that good at C.
Finally, I have been having this issue since I updated and the error happens so fast that you can barely see what it says but it basically a free() error, unsupported chunks, double link something and this happens most of the times when using arrow keys on the history. IMPORTANT If you use tmux the terminal will just hang there when pressing the arrows keys on the history, I thought tmux was the issue, but with a gnome terminal with zsh I could finally see these errors. And no, I can roll back because of compatibility issues. But I think it might something about freeing an already "freed" pointer. I am not that good at C.
It was a hard issue to find on the internet.
Until now, I faced the same problem, and not sure exactly why, but it seems to be solved when the plugin is installed by 'Znap', the Zsh plugin manager the repo owner recommended to use in the README.
I just pushed in a new version. Can you try if the problem still occurs?