Your message dated Sat, 01 Oct 2011 16:26:09 +0000
with message-id <[email protected]>
and subject line Bug#614718: fixed in readline6 6.2-5
has caused the Debian Bug report #614718,
regarding Corrupt display for history search in vi-mode, 256-color prompt
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
614718: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=614718
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: bash
Version: 4.1-2ubuntu4
Severity: normal
Tags: patch
(Forwarded from my bug report against Ubuntu 10.10 (bash 4.1-2ubuntu4,
copy/pasted here)
Binary package hint: bash
This is on Ubuntu 10.10. It very likely still remains in Natty.
I use bash with a prompt that is derived from the current backgrounded
jobs (the script I use to do this is at
http://micah.cowan.name/hg/promptjobs/ - you just source the file and it
does everything). I've customized the colors used, to take advantage of
256-color support in gnome-terminal. An instance of the prompt that
might be produced is:
PS1="\[\033[m\017\033[38;5;103m\]micah-acer\[\033[1m\033[38;5;19m\](\[\033[m\017\033[38;5;83m\]\061\[\033[m\017\033[38;5;189m\]wtitle\[\033[1m\033[38;5;19m\])\[\033[m\017\033[m\017\033[38;5;103m\]$
\[\033[m\017\]"
(This prompt will only display correctly in xterm-compatible terminals;
the term I use is gnome-terminal.)
With a prompt like this, and in vi-mode ("set -o vi" in bash),
attempting to initiate a search in the history, results in display
glitches (specifically, the history line bash/readline jumps to is
displayed far over to the right, and with a couple garbage characters
before it).
Steps to reproduce:
1. Be in vi-mode ("set -o vi" in bash): in particular, readline's
"non-incremental-reverse-search-history" MUST be bound to the "/" key,
as this has significant effects on how bash/readline choose to prompt
for a history search string (even though, for me at least, the "bind"
command doesn't seem to reflect this). If you're running these steps, it
would be advisible for you to be sufficiently familiar with vi-style
bindings to know how to enter commands.
2. Set PS1 as described above.
3. Invoke the non-incremental-reverse-search-history function by
pressing ESC (to escape vi's insert-mode) and "/" (to prompt for reverse
history).
4. At this point, the "/" you just typed may not be showing up properly:
this is the first symptom that something's wrong.
5. Type in some string that should be present in your recent bash
history (so that bash will jump to a different line), and hit enter.
Result:
The history line bash jumps to will be drawn in the wrong location (far
right of the prompt), and with garbage characters; typing "k" or "j" (or
the cursor keys) to move up or down in history continues to draw these
lines in the wrong location.
Expected Result:
The jumped-to line ought to be drawn immediately to the right of the
prompt, and without garbage characters before it.
Cause of bug:
This bug is from readline (it is present both in the readline6 source
package (and probably older, such as readline5), and bash's own built-in
readline code (which has few differences from the sources in readline6).
The bug lies in the function rl_message in display.c, which is called by
_rl_nsearch_init, which is called from noninc_search. rl_message is
primarily intended for writing a "message" on the current line, which
doesn't normally include "invisible" characters (escape sequences, like
the one I'm using in my prompt to set advanced colors), but in this case
is being (ab)used to include the prompt. It uses a buffer of only 128
characters, which in the case of the above prompt/PS1, is overrun. As
long as the system library provides vsnprintf, this does not lead to a
potential buffer overflow, but the results are truncated, and this is
the source of the graphical display glitch, because (a) the prompt is
truncated in the middle of a sequence of "invisible" characters, and (b)
I think the readline code may have other bugs that cause
character-counting not to work properly if the prompt itself is not
completely present at the beginning of a buffer whose value is derived
from the result of rl_message.
Solution:
rl_message ought to use a dynamically-allocated buffer instead, so it
can adjust the size as needed. I'll attach a patch to provide this
shortly.
Workaround:
The statically-allocated buffer is only used to store the final line in
a multi-line prompt (including any invisible characters, and the special
codes used by readline to mark the start and end of invisible-character
sequences). Thus, if you add a newline in the prompt just before the "\$
", the static buffer should have plenty of room. Similar methods might
include not using 256 color support, or any other means to shorten the
total size of the prompt string below 127.
***
A patch for this bug may be found at
https://bugs.launchpad.net/ubuntu/+source/bash/+bug/721982
***
-- System Information:
Debian Release: squeeze/sid
APT prefers lucid-updates
APT policy: (500, 'lucid-updates'), (500, 'lucid-security'), (500, 'lucid')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.32-26-generic (SMP w/4 CPU cores)
Locale: LANG=ja_JP.utf8, LC_CTYPE=ja_JP.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages bash depends on:
ii base-files 5.0.0ubuntu20.10.04.3 Debian base system miscellaneous f
ii dash 0.5.5.1-3ubuntu2 POSIX-compliant shell
ii debianutils 3.2.2 Miscellaneous utilities specific t
ii libc6 2.11.1-0ubuntu7.8 Embedded GNU C Library: Shared lib
ii libncurses5 5.7+20090803-2ubuntu3 shared libraries for terminal hand
Versions of packages bash recommends:
ii bash-completion 1:1.1-3ubuntu2 programmable completion for the ba
Versions of packages bash suggests:
pn bash-doc <none> (no description available)
-- no debconf information
--- End Message ---
--- Begin Message ---
Source: readline6
Source-Version: 6.2-5
We believe that the bug you reported is fixed in the latest version of
readline6, which is due to be installed in the Debian FTP archive:
lib32readline6-dev_6.2-5_amd64.deb
to main/r/readline6/lib32readline6-dev_6.2-5_amd64.deb
lib32readline6_6.2-5_amd64.deb
to main/r/readline6/lib32readline6_6.2-5_amd64.deb
libreadline-dev_6.2-5_amd64.deb
to main/r/readline6/libreadline-dev_6.2-5_amd64.deb
libreadline6-dbg_6.2-5_amd64.deb
to main/r/readline6/libreadline6-dbg_6.2-5_amd64.deb
libreadline6-dev_6.2-5_amd64.deb
to main/r/readline6/libreadline6-dev_6.2-5_amd64.deb
libreadline6_6.2-5_amd64.deb
to main/r/readline6/libreadline6_6.2-5_amd64.deb
readline-common_6.2-5_all.deb
to main/r/readline6/readline-common_6.2-5_all.deb
readline6_6.2-5.debian.tar.gz
to main/r/readline6/readline6_6.2-5.debian.tar.gz
readline6_6.2-5.dsc
to main/r/readline6/readline6_6.2-5.dsc
rlfe_6.2-5_amd64.deb
to main/r/readline6/rlfe_6.2-5_amd64.deb
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Matthias Klose <[email protected]> (supplier of updated readline6 package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Format: 1.8
Date: Sat, 01 Oct 2011 11:56:50 +0200
Source: readline6
Binary: libreadline6 lib64readline6 readline-common libreadline-dev
libreadline6-dev lib64readline6-dev libreadline6-dbg rlfe lib32readline6
lib32readline6-dev
Architecture: source all amd64
Version: 6.2-5
Distribution: unstable
Urgency: low
Maintainer: Matthias Klose <[email protected]>
Changed-By: Matthias Klose <[email protected]>
Description:
lib32readline6 - GNU readline and history libraries, run-time libraries
(32-bit)
lib32readline6-dev - GNU readline and history libraries, development files
(32-bit)
lib64readline6 - GNU readline and history libraries, run-time libraries
(64-bit)
lib64readline6-dev - GNU readline and history libraries, development files
(64-bit)
libreadline-dev - GNU readline and history libraries, development files
libreadline6 - GNU readline and history libraries, run-time libraries
libreadline6-dbg - GNU readline and history libraries, debugging libraries
libreadline6-dev - GNU readline and history libraries, development files
readline-common - GNU readline and history libraries, common files
rlfe - Front-end using readline to "cook" input lines for other programs
Closes: 614718 642383
Changes:
readline6 (6.2-5) unstable; urgency=low
.
* Do not link against any libncurses* library, just against libtinfo.
* Fix corrupt display for history search in vi-mode, 256-color prompt
(Micah Cowan). Closes: #614718, LP: #721982.
* Remove unused build-dep on lsb-release. Closes: #642383.
Checksums-Sha1:
03adedcae1be7fd17a9ed496c3835c574c654797 1718 readline6_6.2-5.dsc
0492e5fad9d956fa46277197f9ff71c41d192701 25695 readline6_6.2-5.debian.tar.gz
55a260757ab42abf2c62e7d502cffd8cfd7d2fdf 55078 readline-common_6.2-5_all.deb
7638b1137fd0f3f329fa1b970c0c883e7196bcc5 157892 libreadline6_6.2-5_amd64.deb
4eca31fea07567bbfcd2540a7732042fbe2b8750 892 libreadline-dev_6.2-5_amd64.deb
7fead85eab149781e14e5b4bdf5cf5af15463fb1 251796
libreadline6-dev_6.2-5_amd64.deb
d2ab5c45af5bbc867683899daa87e1b004e361a0 188744
libreadline6-dbg_6.2-5_amd64.deb
3aabf337f87ac592da51e2a1a936014008320e86 18394 rlfe_6.2-5_amd64.deb
1429ae05c6db40669fd46354d309ca8d8e3562d7 143100 lib32readline6_6.2-5_amd64.deb
70d446b33af94c71acbc9517a07eca29d7b3180f 130398
lib32readline6-dev_6.2-5_amd64.deb
Checksums-Sha256:
97ef95413abd8a8c0400fcc7bc982327486c4c565779d553968980a5408fd9f7 1718
readline6_6.2-5.dsc
f7277bcd924018c0eb318efeb8f0f7612cf2b0a5222e670adbc02c23eb96c1ba 25695
readline6_6.2-5.debian.tar.gz
f85c8059e5ca4014edadbff546d2687abfb9685942eb3ec8d5a7cfc1cff02c8f 55078
readline-common_6.2-5_all.deb
8f5f092615f71d57e42379036c0884e6cc95308df84345cfd2309a6edcaf8c3a 157892
libreadline6_6.2-5_amd64.deb
a237ffcb66ea549f2321655013a6524f28898a30e88c1b7cbaaa0395e7cc19d9 892
libreadline-dev_6.2-5_amd64.deb
8e2da6801036daa14d12f8ec8e0e6285a7c39ddb2304fc05eae0938d25330491 251796
libreadline6-dev_6.2-5_amd64.deb
f4bd379ac02d6de9b33087e0745b6b75550b82f5ac0e093886a13f2d845fe83e 188744
libreadline6-dbg_6.2-5_amd64.deb
bd38ddabf319648fcf08b4cca07b790d683389c7ce66663878d0a9634ca4adc9 18394
rlfe_6.2-5_amd64.deb
2c6132f7f6d10dec2f190190f188450eba0ab4cdb46b4d546bc31e5c24f4a580 143100
lib32readline6_6.2-5_amd64.deb
b4bb877fec7c213e21cf222a5ee38848c998a25c6ea9bff92ce4b263e50f1ee7 130398
lib32readline6-dev_6.2-5_amd64.deb
Files:
0217ba8f001d98bdf70b9b8fbc55ebdc 1718 libs important readline6_6.2-5.dsc
d5b5a88a9bb569d481acbf4972392975 25695 libs important
readline6_6.2-5.debian.tar.gz
0cebab7db0e46d84486327b949ef8dbd 55078 utils important
readline-common_6.2-5_all.deb
23c71f2e0fd269a7bc50bd7d2c131231 157892 libs important
libreadline6_6.2-5_amd64.deb
6b4ffac076a443ec8780ed05d70023a0 892 libdevel optional
libreadline-dev_6.2-5_amd64.deb
b847793d84a316b67058f8509465a481 251796 libdevel optional
libreadline6-dev_6.2-5_amd64.deb
9a54d7a97fbd5456cb71d2262846de9c 188744 debug extra
libreadline6-dbg_6.2-5_amd64.deb
b055130f7212931855e4cfe122a4f457 18394 utils optional rlfe_6.2-5_amd64.deb
efe1e89fa91a174b180ab9a17fa66f43 143100 libs optional
lib32readline6_6.2-5_amd64.deb
08e2ab9b226d63fd8de10fb2c3e75a11 130398 libdevel optional
lib32readline6-dev_6.2-5_amd64.deb
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
iEYEARECAAYFAk6G7BgACgkQStlRaw+TLJw8DwCeNftWc0vEvnCpeKXs0aPFL9uv
JEoAoLOG+jwJz9PhzK+SOpMFcQYuLUgv
=t23V
-----END PGP SIGNATURE-----
--- End Message ---