Configuration Information:
Machine: x86_64
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -g -O2 -fstack-protector-strong -Wformat
-Werror=format-security -Wall
uname output: Linux mymachine 6.1.0-40-amd64 #1 SMP PREEMPT_DYNAMIC
Debian 6.1.153-1 (2025-09-20) x86_64 GNU/Linux
Machine Type: x86_64-pc-linux-gnu
Bash Version: 5.2
Patch Level: 15
Release Status: release
Description:
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.