Red Hat Bugzilla – Bug 139306
read -e crashes bash when prompt is longer than terminal window
Last modified: 2007-11-30 17:10:54 EST
Description of problem: The |read -e| command crashes bash (in
readline code) when the prompt created by PS1 is 80 characters or more
(which often happens when in a deeply nested subdirectory).
Version-Release number of selected component (if applicable):
$ rpm -q bash readline
Steps to Reproduce (at a prompt):
read -e FOO
Program received signal SIGSEGV, Segmentation fault.
0x080b5671 in rl_redisplay ()
#0 0x080b5671 in rl_redisplay ()
#1 0x080a9937 in readline_internal_setup ()
#2 0x080aa43d in readline ()
#3 0x0809e244 in read_builtin ()
#4 0x0806923e in dispose_exec_redirects ()
#5 0x0806ad61 in execute_command_internal ()
#6 0x0806c673 in execute_command ()
#7 0x0805dd6b in reader_loop ()
#8 0x0805ce41 in main ()
User could type something in that would end up in $FOO
Actually, bash has its own internal copy of readline, so changing
component to bash.
And, actually, the condition is not 80 characters, but that the prompt
is longer than the width of the terminal window. Reproducable in both
gnome-terminal and xterm, though.
This regression from pristine 3.0 was introduced at patchlevel 6.
Reported upstream with patch.
Built in Fedora development (bash-3.0-22).
Thanks for the report.
Yep, crash is fixed, but filed regression bug 139575, observed when
upgrading from bash-3.0-18 to bash-3.0-22.