Bug 145329 - lftp segfaults when doing tab completion with readline 5.0
lftp segfaults when doing tab completion with readline 5.0
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: readline (Show other bugs)
rawhide
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Miroslav Lichvar
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-01-17 10:14 EST by Need Real Name
Modified: 2007-11-30 17:10 EST (History)
0 users

See Also:
Fixed In Version: 5.0-2
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-11-13 10:03:39 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Need Real Name 2005-01-17 10:14:07 EST
Description of problem:

This is on an up2date devel system

When using tab completion to traverse a directory tree with lftp, lftp
crashes on the 4th tab press. This appears to be related to the
upgrade to readline 5.0

How reproducible:

100%

Steps to Reproduce:
1. lftp download.fedora.redhat.com
2. "cd /pu<tab><tab><tab><tab>"
    
Actual results:

lftp download.fedora.redhat.com:~> cd /pub/fedora/linux/Segmentation
fault (core dumped)

Expected results:

no core dump

Additional info:

gdb bt of the core file:

$ gdb /usr/bin/lftp core.25330
GNU gdb Red Hat Linux (6.3.0.0-0.1rh)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and
you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for
details.
This GDB was configured as "i386-redhat-linux-gnu"...
(no debugging symbols found)
Using host libthread_db library "/lib/tls/libthread_db.so.1".

Core was generated by `lftp download.fedora.redhat.com'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /usr/lib/libreadline.so.5...(no debugging symbols
found)...done.
Loaded symbols for /usr/lib/libreadline.so.5
Reading symbols from /lib/libutil.so.1...(no debugging symbols
found)...done.
Loaded symbols for /lib/libutil.so.1
Reading symbols from /usr/lib/libncurses.so.5...done.
Loaded symbols for /usr/lib/libncurses.so.5
Reading symbols from /lib/libresolv.so.2...done.
Loaded symbols for /lib/libresolv.so.2
Reading symbols from /lib/libdl.so.2...done.
Loaded symbols for /lib/libdl.so.2
Reading symbols from /lib/tls/libm.so.6...done.
Loaded symbols for /lib/tls/libm.so.6
Reading symbols from /lib/libgcc_s.so.1...done.
Loaded symbols for /lib/libgcc_s.so.1
Reading symbols from /lib/tls/libc.so.6...done.
Loaded symbols for /lib/tls/libc.so.6
Reading symbols from /lib/ld-linux.so.2...done.
Loaded symbols for /lib/ld-linux.so.2
Reading symbols from /usr/lib/lftp/3.0.6/proto-ftp.so...done.
Loaded symbols for /usr/lib/lftp/3.0.6/proto-ftp.so
Reading symbols from /usr/lib/lftp/3.0.6/liblftp-network.so...done.
Loaded symbols for /usr/lib/lftp/3.0.6/liblftp-network.so
Reading symbols from /lib/libssl.so.4...done.
Loaded symbols for /lib/libssl.so.4
Reading symbols from /lib/libcrypto.so.4...done.
Loaded symbols for /lib/libcrypto.so.4
Reading symbols from /usr/lib/libgssapi_krb5.so.2...done.
Loaded symbols for /usr/lib/libgssapi_krb5.so.2
Reading symbols from /usr/lib/libkrb5.so.3...done.
Loaded symbols for /usr/lib/libkrb5.so.3
Reading symbols from /lib/libcom_err.so.2...done.
Loaded symbols for /lib/libcom_err.so.2
Reading symbols from /usr/lib/libk5crypto.so.3...done.
Loaded symbols for /usr/lib/libk5crypto.so.3
Reading symbols from /usr/lib/libz.so.1...done.
Loaded symbols for /usr/lib/libz.so.1

#0  0x0753c1ae in rl_redisplay () from /usr/lib/libreadline.so.5
(gdb) bt
#0  0x0753c1ae in rl_redisplay () from /usr/lib/libreadline.so.5
#1  0x0753abcf in rl_message () from /usr/lib/libreadline.so.5
#2  0x080629ce in lftp_line_complete ()
#3  0x07534f11 in rl_completion_matches () from /usr/lib/libreadline.so.5
#4  0x07534fed in rl_complete_internal () from /usr/lib/libreadline.so.5
#5  0x07535427 in rl_complete () from /usr/lib/libreadline.so.5
#6  0x0752e9cc in _rl_dispatch_subseq () from /usr/lib/libreadline.so.5
#7  0x0752ec13 in _rl_dispatch () from /usr/lib/libreadline.so.5
#8  0x0752ecc9 in readline_internal_char () from /usr/lib/libreadline.so.5
#9  0x0752f238 in readline () from /usr/lib/libreadline.so.5
#10 0x080631aa in lftp_readline ()
#11 0x08060dd1 in ReadlineFeeder::NextCmd ()
#12 0x08068bc9 in CmdExec::Do ()
#13 0x0807ed57 in SMTask::Schedule ()
#14 0x080601d9 in WaitDone ()
#15 0x080608ca in main ()
Comment 1 Need Real Name 2005-01-17 18:33:10 EST
Oops. I misread the bt. Changing Component to readline.
Comment 2 Need Real Name 2005-01-17 18:38:09 EST
And reassigning it to twaugh@redhat.com who appears to be the person
who gets readline bugs these days. 
Comment 3 Tim Waugh 2005-01-18 08:58:00 EST
Please try readline-5.0-2.
Comment 4 Need Real Name 2005-01-19 19:58:13 EST
Thanks. It no longer crashes but at the point it would crash before
(after the 4th tab) it now doesn't properly redraw the terminal window
and you're left with overwritten data in parts of the window.

How to reproduce:

In a gnome terminal window (80x24) enter run 'lftp
download.fedora.redhat.com'

enter 'cd /pu<tab><tab><tab><tab>' and the prompt you're left with is:

lftp download.fedora.redhat.com:~> cd
/pub/fedora/linux/core/fedora/linux: Getti

hit <tab> again and you get:

                                                            
fedora/linux: Gettilftp download.fedora.redhat.com:~> cd
/pub/fedora/linux/core//pub/fedora/linux/c

hit <tab> again and you get what I would have expected:

1/  2/  3/  development/  test/  updates/
lftp download.fedora.redhat.com:~> cd /pub/fedora/linux/core/

It appears that the "/: Getting directory contents (0)
[Connecting...]>" that extends the command line isn't always
overwritten properly when it completes. This may be a lftp bug. If so
let me know and I'll open a bug against lftp.

Thanks
Comment 5 Tim Waugh 2005-01-20 04:33:38 EST
I've submitted this original bug report, with the patch that at least stops it
crashing, to the bug-readline mailing list.  Hopefully I'll get a response with
a corrected patch.

I'm not sure if this redrawing issue is an lftp problem or not -- it's most
likely readline at fault IMHO.  In fact it's most likely that my patch is wrong. :-)
Comment 6 Miroslav Lichvar 2006-11-13 10:03:39 EST
Looks like this is fixed already.

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