Bug 83331 - non-ASCII characters corrupt history
Summary: non-ASCII characters corrupt history
Alias: None
Product: Red Hat Public Beta
Classification: Retired
Component: bash
Version: phoebe
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: Tim Waugh
QA Contact: Ben Levenson
Depends On:
TreeView+ depends on / blocked
Reported: 2003-02-02 18:45 UTC by Michael Schwendt
Modified: 2007-04-18 16:50 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2003-02-12 15:24:38 UTC

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2003:140 0 normal SHIPPED_LIVE Updated bash packages fix several bugs 2003-06-23 04:00:00 UTC

Description Michael Schwendt 2003-02-02 18:45:11 UTC
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 23:03:50 UTC
I see the same thing here.

Comment 2 Tim Waugh 2003-02-05 16:51:55 UTC
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 22:45:44 UTC
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 11:25:43 UTC
Oops, patch wasn't actually applied.  Fixed in bash-2.05b-18.

Comment 5 Michael Schwendt 2003-02-09 12:33:23 UTC
First test-case from Comment #3 still holds true.

Comment 6 Michael Schwendt 2003-02-09 12:36:37 UTC
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 13:59:07 UTC
Fixed package is bash-2.05b-20.

Comment 8 Michael Schwendt 2003-02-12 15:24:38 UTC

Comment 9 Tim Waugh 2003-06-23 14:52:22 UTC
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.