Bug 83331 - non-ASCII characters corrupt history
non-ASCII characters corrupt history
Product: Red Hat Public Beta
Classification: Retired
Component: bash (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Tim Waugh
Ben Levenson
Depends On:
  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:
Last Closed: 2003-02-12 10:24:38 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
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

$ cat /etc/sysconfig/i18n

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:
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

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.



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



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
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.


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