crash when completing a single-quoted word which ends with a backslash
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Gnu Bash |
Fix Released
|
Undecided
|
Unassigned | ||
bash (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Bug Description
Binary package hint: bash
0) My system:
I'm using Ubuntu Karmic, this is some output from uname:
Linux 2.6.31-14-generic #48-Ubuntu SMP i686 GNU/Linux
I'm using bash package version 4.0-5ubuntu2 [ bash --version gives: 4.0.33(1)-release (i486-pc-linux-gnu) ]
1) Steps to reproduce the bug:
type in a terminal:
ls 'test\<tab>
where <tab> means pressing the tab key
2) Expected result:
filename completion
3) Actual result:
Bash prints out this message:
malloc: unknown:0: assertion botched
free: start and end chunk sizes differ
Aborting...
malloc: unknown:0: assertion botched
free: start and end chunk sizes differ
Aborting...
sometimes a bash crash occurs.
4) More details:
This seems like a bash_completion problem, but the function actually crashing is the compgen builtin function.
However, I haven't been able to reproduce the bug without passign through the bash_completion itself, i.e. if I create a file called "alt_filedir" with this content:
_filedir()
{
local A='test\'
compgen -d -- "$A"
}
and then I source it in bash typing:
. alt_filedir
in the command line, and I subsequently try to give a completion command starting with a quote, I obtain the crash.
If the completion doesn't start with a quote the crash doesn't occur.
If I give those same commands from the command line directly, everything works fine and it even finds the appropriate completions.
This bug occurs with double-quoted words ending with a backslash too.