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

crash when press arrow up key #645

Open
GuannanHu opened this issue Sep 20, 2023 · 28 comments
Open

crash when press arrow up key #645

GuannanHu opened this issue Sep 20, 2023 · 28 comments
Labels
bug Something isn't working

Comments

@GuannanHu
Copy link

GuannanHu commented Sep 20, 2023

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
@GuannanHu GuannanHu added the bug Something isn't working label Sep 20, 2023
@SirenityK
Copy link

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.

@GittyMac
Copy link

GittyMac commented Oct 5, 2023

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.

@fshuva
Copy link

fshuva commented Oct 12, 2023

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'

@CheatCod
Copy link

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

@sunny0531
Copy link

sunny0531 commented Oct 16, 2023

The same is happening on my fedora.
Steps:

  1. dnf provides chsh
  2. Press up arrow
  3. 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

@CheatCod
Copy link

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.

@kud
Copy link

kud commented Oct 23, 2023

Got the same issue yeah. I had to disable the plugin as it breaks my shell for now.

@0xluc
Copy link

0xluc commented Oct 24, 2023

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

@ZA0068
Copy link

ZA0068 commented Oct 28, 2023

I get this crash issue too on both my terminal and my terminator

@ZA0068
Copy link

ZA0068 commented Oct 28, 2023

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

@CarolineMorton
Copy link

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!

@julien-blanchon
Copy link

This is pretty annoying :(

@Luk9091
Copy link

Luk9091 commented Nov 8, 2023

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 # )
Nagranie.ekranu.z.2023-11-08.01-01-48.webm

@julien-blanchon
Copy link

Thanks @Luk9091 ! I think the history should be disable for now, this is breaking almost all my installation. Both macOS and Ubuntu

@joo920131
Copy link

I get similar issue like this where it just gets stuck 😭

zsh-autocomplete-buggy.mov

@ingorichter
Copy link

@joo920131 I see the same issue on my M1 machine with zsh 5.9 :-/

@lockieluke
Copy link

anyone know if rolling back to an older version works?

@AustinColby
Copy link

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.

@tsumarios
Copy link

This is annoying. It also happens to Fedora 39.

@imreallyliam
Copy link

Experiencing this issue on Debian 11 and MacOS (M2, latest OS)

@0xl30
Copy link

0xl30 commented Jan 8, 2024

Same Issue When Click Arrow Key Terminal Crashed...(Some Time)
Arch Linux 6.6.10
zsh 5.9

@ChloeColman
Copy link

Same here trying to complete non existing paths
Arch Linux 6.7.0-zen3-1-zen
zsh 5.9 (x86_64-pc-linux-gnu)

@edte
Copy link

edte commented Feb 21, 2024

same question

@weberam2
Copy link

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

@t40mas
Copy link

t40mas commented Feb 22, 2024

Hopefully, i will give it a try.

@t40mas
Copy link

t40mas commented Feb 22, 2024

Hopefully, i will give it a try.

Nope, unfortunately it's not working for me.

@lukaskretzschmer
Copy link

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.

@lukaskretzschmer
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests