Bug 701454 - libedit-3.0-2.20090923cvs.fc14 interacts badly with bash's readline
Summary: libedit-3.0-2.20090923cvs.fc14 interacts badly with bash's readline
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: libedit
Version: 14
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Kamil Dudka
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-05-02 21:29 UTC by Ville Skyttä
Modified: 2011-06-21 17:15 UTC (History)
3 users (show)

Fixed In Version: libedit-3.0-3.20090923cvs.fc14
Clone Of:
Environment:
Last Closed: 2011-06-21 17:15:00 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Ville Skyttä 2011-05-02 21:29:55 UTC
libedit-3.0-2.20090923cvs.fc14 causes some kind of odd problems with bash's internal copy of readline.  Reproducer: make sure php-cli is installed, and source this script in bash:

_foo()
{
    php -h &>/dev/null
    COMPREPLY=( foo )
} && complete -F _foo foo

Then, type "foo " and start hitting tab.  Every tab press should result in new "foo " being inserted to the command line, but blank tabs are inserted instead.

The problem goes away if the above recipe is done in a bash instance that is started with libreadline preloaded, "LD_PRELOAD=/lib64/libreadline.so.6 bash --norc".  I guess the libedit pulled in by php has some bad interaction with bash's internal readline copy; the completion breakage above always occurs if php is invoked within a completion function, but I haven't seen it happen with any other things invoked there (and I do that a lot, I'm a bash-completion dev team member ;)).

I can reproduce the problem in a fedora-14-x86_64 mock chroot, but can not reproduce it in fedora-15-x86_64 nor fedora-rawhide-x86_64, and upgrading libedit from rawhide in my F-14 box to 3.0-3.20110227cvs.fc16 fixes it as well.

Comment 1 Kamil Dudka 2011-05-05 14:29:05 UTC
Thank you for reporting the bug.  This will fix it:

--- a/src/tty.c
+++ b/src/tty.c
@@ -495,6 +495,9 @@
    if (el->el_flags & EDIT_DISABLED)
        return (0);

+   if (!isatty(el->el_outfd))
+       return (-1);
+
    if (tty_getty(el, &el->el_tty.t_ed) == -1) {
 #ifdef DEBUG_TTY
        (void) fprintf(el->el_errfile,

Comment 2 Kamil Dudka 2011-05-05 15:29:05 UTC
I pushed the fix as 9fb66ec to Fedora git.

If anybody has enough privileges and patience, please build it.  fedpkg does not work for me at all (times out connecting to 128.197.185.45) and Koji says I need to be admin in order to tag the build:

http://koji.fedoraproject.org/koji/taskinfo?taskID=3052015

Comment 3 Kamil Dudka 2011-05-05 15:43:07 UTC
Actually the build exists, now I need to find someone to tag it such that Bodhi will like that build...

Comment 4 Fedora Update System 2011-05-05 19:30:00 UTC
libedit-3.0-3.20090923cvs.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/libedit-3.0-3.20090923cvs.fc14

Comment 5 Kamil Dudka 2011-05-05 19:33:39 UTC
In case anybody was interested, the following command solved the tagging issue:

$ koji tag-pkg dist-f14-updates-candidate libedit-3.0-3.20090923cvs.fc14

Comment 6 Fedora Update System 2011-05-07 02:51:34 UTC
Package libedit-3.0-3.20090923cvs.fc14:
* should fix your issue,
* was pushed to the Fedora 14 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing libedit-3.0-3.20090923cvs.fc14'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/libedit-3.0-3.20090923cvs.fc14
then log in and leave karma (feedback).

Comment 7 Fedora Update System 2011-06-21 17:14:55 UTC
libedit-3.0-3.20090923cvs.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.


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