Bug 139306

Summary: read -e crashes bash when prompt is longer than terminal window
Product: [Fedora] Fedora Reporter: David Baron <dbaron>
Component: bashAssignee: Tim Waugh <twaugh>
Status: CLOSED RAWHIDE QA Contact: Ben Levenson <benl>
Severity: high Docs Contact:
Priority: medium    
Version: 3   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-11-15 18:36:51 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description David Baron 2004-11-15 01:05:30 UTC
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
bash-3.0-18
readline-4.3-13

How reproducible: 
Every time

Steps to Reproduce (at a prompt):
bash
PS1=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
read -e FOO
  
Actual results:
Program received signal SIGSEGV, Segmentation fault.
0x080b5671 in rl_redisplay ()
(gdb) bt
#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 ()

Expected results:
User could type something in that would end up in $FOO

Comment 1 David Baron 2004-11-15 01:14:44 UTC
Actually, bash has its own internal copy of readline, so changing
component to bash.

Comment 2 David Baron 2004-11-15 01:16:51 UTC
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.

Comment 3 Tim Waugh 2004-11-15 17:48:28 UTC
This regression from pristine 3.0 was introduced at patchlevel 6.

Comment 4 Tim Waugh 2004-11-15 18:36:51 UTC
Reported upstream with patch.

Built in Fedora development (bash-3.0-22).

Thanks for the report.

Comment 5 David Baron 2004-11-16 19:32:11 UTC
Yep, crash is fixed, but filed regression bug 139575, observed when
upgrading from bash-3.0-18 to bash-3.0-22.