Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 74815 - lftp-3.0.12 broken with libreadline-5.0-r1 (Segfaults)
Summary: lftp-3.0.12 broken with libreadline-5.0-r1 (Segfaults)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Daniel Black (RETIRED)
URL:
Whiteboard:
Keywords:
: 95958 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-12-18 02:31 UTC by Thomas Jäger
Modified: 2006-01-11 12:36 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Backtrace from dbg (lftp.gdb.out,2.83 KB, text/plain)
2005-07-31 15:28 UTC, Jeroen Roovers (RETIRED)
Details
Backtrace from lftp 3.0.13 (lftp-i686.gdb.out,2.21 KB, text/plain)
2005-07-31 15:33 UTC, Jeroen Roovers (RETIRED)
Details
Obligatory emerge info (i686, lftp 3.0.13) (emerge.info-epia,2.52 KB, text/plain)
2005-07-31 15:37 UTC, Jeroen Roovers (RETIRED)
Details
Obligatory emerge info (i586, lftp 3.2.1) (emerge.info-henke,1.99 KB, text/plain)
2005-07-31 15:38 UTC, Jeroen Roovers (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Jäger 2004-12-18 02:31:06 UTC
lftp seems to be broken when compiled againt the newest libreadline. if lftp is compiled manually using the --with-included-readline ./configure option lftp works without any problems. 

Reproducible: Always
Steps to Reproduce:
1. Use lftp to access a ftp site
2. use tab completion a few times with mirror/get


Actual Results:  
Segmentation fault

Expected Results:  
No Segmentation fault

Nothing special, bug can be reproduced on many diffrent gentoo instalations.
Comment 1 Eldad Zack (RETIRED) gentoo-dev 2004-12-18 04:53:35 UTC
I can't reproduce this problem.
lftp-3.0.12 against readline-5.0-r1 works just fine with tab completion.

try different lftp version (say, current stable is 3.0.9) and see if that segfaults or not for you.

Also, can you provide a gdb backtrace so we can see what is causing the segfault?
Comment 2 Daniel Webert 2004-12-18 05:52:43 UTC
works fine overhere on x86 - lftp 3.0.12 + readline 5.0-r1
Comment 3 Jeffrey Litvin 2004-12-18 07:36:34 UTC
I had this problem.  This is a known problem and is fixed in the next version of lftp.  Please see http://www.mail-archive.com/lftp%40uniyar.ac.ru/msg01819.html for the patch.  Contact me if you need help applying the patch in the ebuild.  Was going post it, but figured the next rev of lftp with the problem fixed is due out soon.
Comment 4 Daniel Black (RETIRED) gentoo-dev 2004-12-18 14:03:48 UTC
3.0.12-r1 added with patch described in comment 3 (Thanks Jeffery). Thomas I hope this fixes your fault otherwise can you  provide a backtrace and reopen this bug.
Comment 5 Thomas Jäger 2004-12-18 14:10:43 UTC
Thanks Jeffrey that did fix it. The reason i though libreadline was the curlpit was that gdb said the crash occurred in a function loaded from libreadline.so. Oh well, Thanks again.
Comment 6 Jeroen Roovers (RETIRED) gentoo-dev 2005-07-31 14:26:53 UTC
I seem to be having the exact same problem with net-ftp/lftp-3.0.13, but only on 
x86 and not on hppa. strace doesn't reveal much, though:

---------------------------------------------------------------
read(4, 0x81147e8, 65536)               = -1 EAGAIN (Resource temporarily 
unavailable)
read(4, 0x81147e8, 65536)               = -1 EAGAIN (Resource temporarily 
unavailable)                                                                     
     poll([{fd=4, events=POLLIN}], 1, 18)    = 0
gettimeofday({1122845009, 635815}, NULL) = 0                                    
read(4, 0x81147e8, 65536)               = -1 EAGAIN (Resource temporarily 
unavailable)
read(4, 0x81147e8, 65536)               = -1 EAGAIN (Resource temporarily 
unavailable)                                                                     
     --- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++
---------------------------------------------------------------
Comment 7 Daniel Black (RETIRED) gentoo-dev 2005-07-31 14:42:20 UTC
Do the unstable version lftp-3.1.4 and lftp-3.2.1 work for you? I so I'll move 
them to stable k? 
 
To debug SEGV's properly use gdb - 
http://www.gentoo.org/doc/en/bugzilla-howto.xml#doc_chap2 
Comment 8 Jeroen Roovers (RETIRED) gentoo-dev 2005-07-31 14:49:22 UTC
(In reply to comment #7)

Gosh, that was quick! :)

> Do the unstable version lftp-3.1.4 and lftp-3.2.1 work for you? I so I'll move 
> them to stable k? 

Currently merging net-ftp/lftp-3.2.1...

> To debug SEGV's properly use gdb - 
> http://www.gentoo.org/doc/en/bugzilla-howto.xml#doc_chap2 

I'll do that.
Comment 9 Jeroen Roovers (RETIRED) gentoo-dev 2005-07-31 15:28:33 UTC
Created attachment 64829 [details]
Backtrace from dbg
Comment 10 Jeroen Roovers (RETIRED) gentoo-dev 2005-07-31 15:29:25 UTC
That first backtrace concerns:

jeroen@henke ~ $ lftp --version
LFTP | Version 3.2.1 | Copyright (c) 1996-2005 Alexander V. Lukyanov

LFTP 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.
There is absolutely no warranty for LFTP.  See COPYING for details.

Send bug reports and questions to <lftp@uniyar.ac.ru>.

Libraries used: Readline 5.0, Expat 1.95.8, GnuTLS 1.2.3
Comment 11 Jeroen Roovers (RETIRED) gentoo-dev 2005-07-31 15:33:20 UTC
Created attachment 64831 [details]
Backtrace from lftp 3.0.13
Comment 12 Jeroen Roovers (RETIRED) gentoo-dev 2005-07-31 15:37:49 UTC
Created attachment 64835 [details]
Obligatory emerge info (i686, lftp 3.0.13)
Comment 13 Jeroen Roovers (RETIRED) gentoo-dev 2005-07-31 15:38:34 UTC
Created attachment 64836 [details]
Obligatory emerge info (i586, lftp 3.2.1)
Comment 14 Jeroen Roovers (RETIRED) gentoo-dev 2005-11-20 06:08:44 UTC
The tabbing segfault occurs as well with these versions of lftp:

henke ~ # qlop -l lftp | grep -o '>>>.*' | sort | uniq
...
>>> net-ftp/lftp-3.3.0
>>> net-ftp/lftp-3.3.3
>>> net-ftp/lftp-3.3.4

For instance:

jeroen@epia ~ $ lftpkernel
cd ok, cwd=/pub/linux/kernel
lftp ftp.kernel.org:/pub/linux/kernel> cd /
lftp ftp.kernel.org:/> cd pub/linux/kernel/peSegmentation fault                 
jeroen@epia ~ $

So what exactly has been resolved/fixed?
Comment 15 Jeroen Roovers (RETIRED) gentoo-dev 2005-11-24 04:16:40 UTC
Same with 3.3.4-r1.
Comment 16 Jeroen Roovers (RETIRED) gentoo-dev 2005-11-24 04:18:31 UTC
Oops.
Comment 17 Jeroen Roovers (RETIRED) gentoo-dev 2005-11-24 04:46:30 UTC
Interesting to note that in debug mode, lftp crashes a lot less (race 
condition?). Assuming remote-completion is the problem, I tried to do without 
(using 3.3.4-r1):

----------
jeroen@epia ~ $ lftp -v
LFTP | Version 3.3.4 | Copyright (c) 1996-2005 Alexander V. Lukyanov

LFTP 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.
There is absolutely no warranty for LFTP.  See COPYING for details.

Send bug reports and questions to <lftp@uniyar.ac.ru>.

Libraries used: Readline 5.0, Expat 1.95.8, GnuTLS 1.2.3
jeroen@epia ~ $ lftp ftp://ftp.kernel.org/
cd ok, cwd=/
lftp ftp.kernel.org:/> set cmd:remote-completion false
lftp ftp.kernel.org:/> cd /<<TAB>>lftp: complete.cc:832: char** lftp_completion
(const char*, int, int): Assertion `generator' failed.
Aborted
jeroen@epia ~ $
----------

Seems like I can't even turn it off to prevent segfaults.
Comment 18 Daniel Black (RETIRED) gentoo-dev 2006-01-05 02:03:36 UTC
*** Bug 95958 has been marked as a duplicate of this bug. ***
Comment 19 Daniel Black (RETIRED) gentoo-dev 2006-01-05 02:22:46 UTC
I finally bit the bullet and went --with-included-readline

Sorry it took so long. I'm stuborn in a bad way sometimes.
Comment 20 Daniel Black (RETIRED) gentoo-dev 2006-01-05 02:23:19 UTC
details - this is included in 3.4.0.

Thanks for everyones help.
Comment 21 Daniel Black (RETIRED) gentoo-dev 2006-01-11 01:23:08 UTC
3.4.0-r1 reverts to using system readline-5.1 as it doesn't break it- thanks  Peter Kerwien
Comment 22 Jeroen Roovers (RETIRED) gentoo-dev 2006-01-11 11:10:03 UTC
(In reply to comment #21)
> 3.4.0-r1 reverts to using system readline-5.1 as it doesn't break it- thanks 
> Peter Kerwien

Breaks for me... Same [tab][tab]SEGFAULT problem as before, while 3.4.0 was the first version in a long time that didn't exhibit the bug. Shall we just stick with the --with-included-readline for now? :)
Comment 23 Peter Kerwien 2006-01-11 11:36:26 UTC
> Breaks for me... Same [tab][tab]SEGFAULT problem as before, while 3.4.0 was the
> first version in a long time that didn't exhibit the bug. Shall we just stick
> with the --with-included-readline for now? :)
> 

Have you also updated to readline-5.1-r2? I have a bulletproof TAB-sequence that crashed lftp everytime and I also so it disappeared with --with-included-readline but also when upgrading readline from 5.0 to 5.1-r2.
Comment 24 Jeroen Roovers (RETIRED) gentoo-dev 2006-01-11 11:47:59 UTC
If lftp needs sys-libs/readline-5.1-r2 to get this bug fixed, then >=sys-libs/readline-5.1 should probably be in RDEPEND, which is currently only the case for ppc-macos.
Comment 25 Daniel Black (RETIRED) gentoo-dev 2006-01-11 12:36:36 UTC
opps should of  been RDEPEND=!ppc-macos ( >=readline-5.1 )

sorry.

Upgrade readline to >readline-5.1 and you should be good.