If I open a new terminal and enter the (obviously malformed) command
"$(;" (without quotes) I get a bash crash about 90% of the time. Transcript:
$ $(;
bash: syntax error near unexpected token `;'
[22:48:22]
free(): invalid next size (fast)
Warning: Program '/bin/bash' crashed.
...this only seems to happen reliably when I use my custom prompt. If I
make .bashrc that contains only this:
red="\033[1;31m";
norm="\033[0;39m";
cyan="\033[1;36m";
if [ "$PS1" ]; then
if [[ $UID -eq 0 ]]; then
PS1="\[$red\]\u@\h:\w\\[\033[0;39m\] # "
else
PS1="\[$cyan\]\u@\h:\w\\[\033[0;39m\] \$ "
fi
export PROMPT_COMMAND="echo \[\$(date +%H:%M:%S)\];history -a;
history -c; history -r"
export PS1=$PS1"\[\e]30;\u@\h\a\]"
fi
...the bug happens reliably. If I have no .bashrc, then the bug doesn't
seem to happen, but occasionally I will still see the "free(): invalid
next size (fast)" errors after I have run "$(;". (This is much harder to
reproduce).
The bug does not seem to happen at all if I change to a vterm. I am
testing in konsole in Debian 12 on KDE/Wayland.