Bug 83331 - non-ASCII characters corrupt history
non-ASCII characters corrupt history
Status: CLOSED ERRATA
Product: Red Hat Public Beta
Classification: Retired
Component: bash (Show other bugs)
phoebe
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Tim Waugh
Ben Levenson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-02-02 13:45 EST by Michael Schwendt
Modified: 2007-04-18 12:50 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2003-02-12 10:24:38 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 Michael Schwendt 2003-02-02 13:45:11 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20030120

$ rpm -q redhat-release bash
redhat-release-8.0.93-2
bash-2.05b-14

$ cat /etc/sysconfig/i18n
LANG="de_DE.UTF-8"
SUPPORTED="en_GB.UTF-8:en_GB:en:en_IE.UTF-8:en_IE:en:en_US.UTF-8:en_US:en:de_DE.UTF-8:de_DE:de"
SYSFONT="latarcyrheb-sun16"

1. With bash, log into text mode or open a terminal program.

 [Because I don't know whether bugzilla accepts special characters, I try to
describe the problem in words.] 

2. At the command-prompt, enter # followed by two special characters (e.g. two
times the "cent symbol" or the "Euro symbol" or other non-ASCII characters, e.g.
from "man iso_8859_1"). Hit return, regardless of whether the input makes sense.

3. At the following prompt, input "echo" and hit return.

4. Press the CURSOR UP key two times to go back in the shell's history to the
command-line from 2). Then press CURSOR DOWN and see corruption. Press CURSOR UP
again, see more corruption.

Example (following the # should be two cent symbols, bugzilla probably doesn't
accept these, therefore I use two place-holders, replace them!):

$ #��XX              <-- replace XX with e.g. two times cent symbol 
$ echo
$
at this point press CURSOR UP two times, then CURSOR DOWN one time, then CURSOR
UP once more, then CURSOR DOWN once more, UP, DOWN, UP DOWN, and so on. You
should see a different level of corruption depending on whether you run bash in
text mode or gnome-terminal or konsole.

Needless to say, while this test-case may look weird, it is just stripped down
for reproduciblity. I stumbled upon this misbehaviour of bash history when I
renamed files which have German umlauts in their file names.

How reproducible:
Always
Reproducible in both text mode console and KDE/GNOME.
Comment 1 Tim Waugh 2003-02-02 18:03:50 EST
I see the same thing here.
Comment 2 Tim Waugh 2003-02-05 11:51:55 EST
Fixed package is 2.05b-17, which will shortly appear in rawhide.  Please verify
that it fixes the problem for you.
Comment 3 Michael Schwendt 2003-02-06 17:45:44 EST
Can't confirm.

$ rpm -q bash
bash-2.05b-17

New observation and test-cases (for both virtual console and xterm and
en_US.UTF-8 this time): First command-line must be longer than second one (at
least one character, even white-space).

In the following, replace each 'X' with a special character (as before), e.g. I
used "cent symbol" . No prompt in these examples:

sleep 1
ls X

Then CURSOR_UP two times, CURSOR_DOWN one time, CURSOR_UP one time, and so on.

Or:

sleep
#XX

CURSOR_UP two times, CURSOR_DOWN one time, CURSOR_UP one time, and so on.

Or:

#echo
#XX

CURSOR_UP two times, CURSOR_DOWN one time, CURSOR_UP one time, and so on.
Comment 4 Tim Waugh 2003-02-07 06:25:43 EST
Oops, patch wasn't actually applied.  Fixed in bash-2.05b-18.
Comment 5 Michael Schwendt 2003-02-09 07:33:23 EST
First test-case from Comment #3 still holds true.
Comment 6 Michael Schwendt 2003-02-09 07:36:37 EST
And another test-case:

ls blubbdiblubb
ls blah¢¢foo

where in the second line I used two cent symbols between "blah" and "foo", then
CURSOR_UP two times, CURSOR_DOWN one time, CURSOR_UP one time, and so on. Always
the same pattern.
Comment 7 Tim Waugh 2003-02-11 08:59:07 EST
Fixed package is bash-2.05b-20.
Comment 8 Michael Schwendt 2003-02-12 10:24:38 EST
Confirmed.
Comment 9 Tim Waugh 2003-06-23 10:52:22 EDT
An errata has been issued which should help the problem described in this bug report. 
This report is therefore being closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files, please follow the link below. You may reopen 
this bug report if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2003-140.html

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