Bug 139306 - read -e crashes bash when prompt is longer than terminal window
read -e crashes bash when prompt is longer than terminal window
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: bash (Show other bugs)
3
All Linux
medium Severity high
: ---
: ---
Assigned To: Tim Waugh
Ben Levenson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-11-14 20:05 EST by David Baron
Modified: 2007-11-30 17:10 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-11-15 13:36:51 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description David Baron 2004-11-14 20:05:30 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
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-14 20:14:44 EST
Actually, bash has its own internal copy of readline, so changing
component to bash.
Comment 2 David Baron 2004-11-14 20:16:51 EST
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 12:48:28 EST
This regression from pristine 3.0 was introduced at patchlevel 6.
Comment 4 Tim Waugh 2004-11-15 13:36:51 EST
Reported upstream with patch.

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

Thanks for the report.
Comment 5 David Baron 2004-11-16 14:32:11 EST
Yep, crash is fixed, but filed regression bug 139575, observed when
upgrading from bash-3.0-18 to bash-3.0-22.

Note You need to log in before you can comment on or make changes to this bug.