Bug 142405 - net-ftp/lftp-3.5.2 segfaults with gnutls
Bug#: 142405 Product:  Gentoo Linux Version: unspecified Platform: All
OS/Version: Linux Status: RESOLVED Severity: normal Priority: P2
Resolution: WORKSFORME Assigned To: dragonheart@gentoo.org Reported By: nicote@gmail.com
Component: Ebuilds
URL: 
Summary: net-ftp/lftp-3.5.2 segfaults with gnutls
Keywords:  
Status Whiteboard: 
Opened: 2006-08-01 04:42 0000
Description:   Opened: 2006-08-01 04:42 0000
Using gnutls lftp-3.5.2 gives segfaults using commands like ls or mirror.
Tested with gnutls-1.2.11 on ~x86 and ~amd64


~amd64 emerge --info:
Portage 2.1.1_pre4-r1 (default-linux/amd64/2006.0, gcc-3.4.6/amd64-vanilla,
glibc-2.3.6-r4, 2.6.16-gentoo-r9 x86_64)
=================================================================
System uname: 2.6.16-gentoo-r9 x86_64 AMD Athlon(tm) 64 X2 Dual Core Processor
3800+
Gentoo Base System version 1.12.1
app-admin/eselect-compiler: 2.0.0_rc2-r1
dev-lang/python:     2.4.3-r1
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     [Not Present]
dev-util/confcache:  [Not Present]
sys-apps/sandbox:    1.2.18.1
sys-devel/autoconf:  2.13, 2.60
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2
sys-devel/binutils:  2.16.1-r3
sys-devel/gcc-config: 2.0.0_rc1
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.16
ACCEPT_KEYWORDS="amd64 ~amd64"
AUTOCLEAN="yes"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=k8 -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config
/usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config /var/bind"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/eselect/compiler
/etc/gconf /etc/java-config/vms/ /etc/revdep-rebuild /etc/terminfo
/etc/texmf/web2c"
CXXFLAGS="-march=k8 -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks metadata-transfer multilib-strict sandbox
sfperms strict"
GENTOO_MIRRORS="http://linuv.uv.es/mirror/gentoo/ http://gentoo.inode.at/"
LANG="es_ES@euro"
LC_ALL="es_ES@euro"
LINGUAS="es"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress
--force --whole-file --delete --delete-after --stats --timeout=180
--exclude='/distfiles' --exclude='/local' --exclude='/packages'"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="amd64 X alsa apache2 avi bcmath berkdb bitmap-fonts bzip2 calendar cli
crypt cups curl dba dbus dlloader dri dvd dvdread eds emboss encode ffmpeg flac
foomaticdb fortran ftp gd gdbm gif gmp gnome gnutls gpm gstreamer gtk gtk2 hal
ieee1394 imagemagick imlib ipod ipv6 isdnlog java jpeg kde lm_sensors
logitech-mouse lzw lzw-tiff mad mmext mp3 mpeg msn msnextras musicbrainz mysql
ncurses nls nptl nptlonly nvidia ogg oggvorbis opengl openssl pam pcre pdf
pdflib perl png ppds pppd python qt qt3 qt4 quicktime readline reflection samba
screen sdl session smp spell spl ssl tcpd tetex threads tiff truetype
truetype-fonts type1-fonts udev usb userlocales v4l v4l2 vorbis xcomposite xine
xml xml2 xorg xpm xv xvid zip zlib elibc_glibc input_devices_evdev
input_devices_keyboard input_devices_mouse kernel_linux linguas_es userland_GNU
video_cards_nv video_cards_nvidia video_cards_apm video_cards_v4l"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LDFLAGS,
PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY

~x86 emerge --info:
Portage 2.1.1_pre4-r1 (default-linux/x86/2006.0, gcc-4.1.1/vanilla,
glibc-2.3.6-r4, 2.6.17-gentoo-r4 i686)
=================================================================
System uname: 2.6.17-gentoo-r4 i686 AMD Athlon(tm) XP 2600+
Gentoo Base System version 1.12.1
app-admin/eselect-compiler: 2.0.0_rc2-r1
dev-lang/python:     2.4.3-r1
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     [Not Present]
dev-util/confcache:  [Not Present]
sys-apps/sandbox:    1.2.18.1
sys-devel/autoconf:  2.13, 2.60
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2
sys-devel/binutils:  2.16.1-r3
sys-devel/gcc-config: 2.0.0_rc1
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r5
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=athlon-xp -O2 -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config
/usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/eselect/compiler
/etc/gconf /etc/java-config/vms/ /etc/revdep-rebuild /etc/terminfo
/etc/texmf/web2c"
CXXFLAGS="-march=athlon-xp -O2 -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks metadata-transfer multilib-strict sandbox
sfperms strict"
GENTOO_MIRRORS="http://linuv.uv.es/mirror/gentoo/
ftp://ftp.rnl.ist.utl.pt/pub/gentoo/ http://darkstar.ist.utl.pt/gentoo/"
LANG="es_ES@euro"
LC_ALL="es_ES@euro"
LINGUAS="es"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress
--force --whole-file --delete --delete-after --stats --timeout=180
--exclude='/distfiles' --exclude='/local' --exclude='/packages'"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://192.168.0.2/gentoo-portage"
USE="x86 3dnow X alsa apache2 apm arts avi berkdb bitmap-fonts bzip2 cli crypt
cups dbus dlloader dri eds emboss encode esd foomaticdb fortran gdbm gif gnome
gpm gstreamer gtk gtk2 hal imlib ipv6 isdnlog jpeg kde libg++ libwww lm_sensors
logitech-mouse mad mikmod mmx motif mp3 mpeg ncurses nls nptl nptlonly ogg
opengl openssl oss pam pcre pdf pdflib perl png pppd python qt qt3 quicktime
readline reflection samba screen sdl session spell spl sse ssl tcpd tetex tiff
truetype truetype-fonts type1-fonts udev userlocales vorbis xml xmms xorg xv
zlib elibc_glibc input_devices_evdev input_devices_mouse input_devices_keyboard
kernel_linux linguas_es userland_GNU video_cards_apm video_cards_radeon"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LDFLAGS,
PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY

------- Comment #1 From Daniel Black 2006-08-01 07:02:29 0000 -------
Can you point me to the ftp server that caused the problem so I can replicate.

Alternately try to get a backtrace
(http://www.gentoo.org/proj/en/qa/backtraces.xml)

------- Comment #2 From José Valentín Gutiérrez Boquete 2006-08-01 08:13:59 0000 -------
The segfault appears with any ftp with SSL enabled

------- Comment #3 From Daniel Black 2006-08-01 14:52:19 0000 -------
(In reply to comment #2)
> The segfault appears with any ftp with SSL enabled
> 

Please name one. I'm finding it a bit find to get one.

------- Comment #4 From José Valentín Gutiérrez Boquete 2006-08-02 02:02:41 0000 -------
(In reply to comment #3)
I've configured one ftp server for you ;)

try it, lftp -u daniel,black -p 1337 nicoHQ.org.

You should get something like that:

WITH gnutls:
nico@multivac ~ $ lftp -u daniel,black -p 1337 nicoHQ.org
lftp nicoHQ.org ~ > ls
Violaci

------- Comment #5 From José Valentín Gutiérrez Boquete 2006-08-02 02:02:41 0000 -------
(In reply to comment #3)
I've configured one ftp server for you ;)

try it, lftp -u daniel,black -p 1337 nicoHQ.org.

You should get something like that:

WITH gnutls:
nico@multivac ~ $ lftp -u daniel,black -p 1337 nicoHQ.org
lftp nicoHQ.org ~ > ls
Violación de segmentoiation...] --> Segmentation fault
nico@multivac ~ $

WITHOUT gnutls:
nico@multivac ~ $ lftp -u daniel,black -p 1337 nicoHQ.org
lftp nicoHQ.org ~ > ls
total 9
-rw-r--r--   1 glftpd   glftpd         41 Aug  2 10:45 TEST
drwxr-xr-x   2 glftpd   glftpd       4096 Aug  2 10:37 incoming
lftp nicoHQ.org / >

------- Comment #6 From Daniel Black 2006-08-02 07:21:13 0000 -------
(In reply to comment #4)
> (In reply to comment #3)
> I've configured one ftp server for you ;)
> 
> try it, lftp -u daniel,black -p 1337 nicoHQ.org.

Thank you very much. This helped a lot.

> You should get something like that:
> 
> WITH gnutls:
> nico@multivac ~ $ lftp -u daniel,black -p 1337 nicoHQ.org
> lftp nicoHQ.org ~ > ls
> Violaci

------- Comment #7 From Daniel Black 2006-08-02 07:21:13 0000 -------
(In reply to comment #4)
> (In reply to comment #3)
> I've configured one ftp server for you ;)
> 
> try it, lftp -u daniel,black -p 1337 nicoHQ.org.

Thank you very much. This helped a lot.

> You should get something like that:
> 
> WITH gnutls:
> nico@multivac ~ $ lftp -u daniel,black -p 1337 nicoHQ.org
> lftp nicoHQ.org ~ > ls
> Violación de segmentoiation...] --> Segmentation fault
> nico@multivac ~ $

That I did as per cced email. Reported upstream. Nonstripped stuff even enables
decent backtracks. Shouldn't be too long for a fix. Alexander is usually very
quick with fixes.

------- Comment #8 From Daniel Black 2006-08-02 17:25:32 0000 -------
patch added to net-ftp/lftp-3.5.2-r1

Much appreciate the test server and bug report.

------- Comment #9 From Daniel Black 2006-08-03 17:00:16 0000 -------
guessing it worked for you?

------- Comment #10 From José Valentín Gutiérrez Boquete 2006-08-04 02:01:33 0000 -------
(In reply to comment #7)

Negative, now lftp doesn't crash with a segfault but commands like ls or mirror
doesn't work, lftp enters in a infinite loop with the message "Delaying before
retry".

Test server is working if you want to test it

------- Comment #11 From Enito 2006-08-04 08:16:28 0000 -------
(In reply to comment #8)
> (In reply to comment #7)
> 
> Negative, now lftp doesn't crash with a segfault but commands like ls or mirror
> doesn't work, lftp enters in a infinite loop with the message "Delaying before
> retry".
> 
> Test server is working if you want to test it
> 
Hi, i have another trouble when i try to emerge new one lftp version, see

libtool: install: warning: relinking `proto-fish.la'
libtool: link: warning: `/usr/lib/libsocks.la' seems to be moved
libtool: link: warning: `/usr/lib/libgnutls.la' seems to be moved
libtool: link: warning: `/usr/lib/libgcrypt.la' seems to be moved
libtool: link: warning: `/usr/lib/libgpg-error.la' seems to be moved
libtool: install: warning: remember to run `libtool --finish
/usr/lib64/lftp/3.5.2'
 /bin/sh ../libtool --silent --mode=install /bin/install -c  'proto-sftp.la'
'/var/tmp/portage/lftp-3.5.2-r1/image//usr/lib64/lftp/3.5.2/proto-sftp.la'
libtool: install: warning: relinking `proto-sftp.la'
libtool: link: warning: `/usr/lib/libsocks.la' seems to be moved
libtool: link: warning: `/usr/lib/libgnutls.la' seems to be moved
libtool: link: warning: `/usr/lib/libgcrypt.la' seems to be moved
libtool: link: warning: `/usr/lib/libgpg-error.la' seems to be moved
libtool: install: warning: remember to run `libtool --finish
/usr/lib64/lftp/3.5.2'
 /bin/sh ../libtool --silent --mode=install /bin/install -c 
'liblftp-getdate.la'
'/var/tmp/portage/lftp-3.5.2-r1/image//usr/lib64/lftp/3.5.2/liblftp-getdate.la'
libtool: install: warning: remember to run `libtool --finish
/usr/lib64/lftp/3.5.2'
 /bin/sh ../libtool --silent --mode=install /bin/install -c  'cmd-mirror.la'
'/var/tmp/portage/lftp-3.5.2-r1/image//usr/lib64/lftp/3.5.2/cmd-mirror.la'
libtool: install: warning: relinking `cmd-mirror.la'
libtool: install: warning: remember to run `libtool --finish
/usr/lib64/lftp/3.5.2'
 /bin/sh ../libtool --silent --mode=install /bin/install -c  'cmd-sleep.la'
'/var/tmp/portage/lftp-3.5.2-r1/image//usr/lib64/lftp/3.5.2/cmd-sleep.la'
libtool: install: warning: relinking `cmd-sleep.la'
libtool: install: warning: remember to run `libtool --finish
/usr/lib64/lftp/3.5.2'
make[2]: Leaving directory `/var/tmp/portage/lftp-3.5.2-r1/work/lftp-3.5.2/src'
make[1]: *** [install-am] Error 2
make[1]: Leaving directory `/var/tmp/portage/lftp-3.5.2-r1/work/lftp-3.5.2/src'
make: *** [install-recursive] Error 1

!!! ERROR: net-ftp/lftp-3.5.2-r1 failed.
Call stack:
  ebuild.sh, line 1543:   Called dyn_install
  ebuild.sh, line 1017:   Called src_install
  lftp-3.5.2-r1.ebuild, line 72:   Called die

!!! (no error message)
!!! If you need support, post the topmost build error, and the call stack if
relevant.


thx,

------- Comment #12 From José Valentín Gutiérrez Boquete 2006-08-04 10:29:47 0000 -------
Please, post your emerge --info info

------- Comment #13 From Enito 2006-08-04 11:23:29 0000 -------
(In reply to comment #10)
> Please, post your emerge --info info
> 

emerge --info
Portage 2.1.1_pre4-r2 (default-linux/amd64/2006.0, gcc-4.1.1/amd64-vanilla,
glibc-2.4-r3, 2.6.16-gentoo-r13-cabroncito x86_64)
=================================================================
System uname: 2.6.16-gentoo-r13-cabroncito x86_64 AMD Athlon(tm) 64 Processor
3200+
Gentoo Base System version 1.12.4
app-admin/eselect-compiler: 2.0.0_rc2-r1
dev-lang/python:     2.3.5-r2, 2.4.3-r1
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     [Not Present]
dev-util/confcache:  [Not Present]
sys-apps/sandbox:    1.2.18.1
sys-devel/autoconf:  2.13, 2.60
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2
sys-devel/binutils:  2.17
sys-devel/gcc-config: 2.0.0_rc1
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.16
ACCEPT_KEYWORDS="amd64 ~amd64"
AUTOCLEAN="yes"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=k8 -mmmx -m3dnow -pipe -O2 -fomit-frame-pointer -msse -msse2
-msse3 -combine"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config
/usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/eselect/compiler
/etc/gconf /etc/java-config/vms/ /etc/revdep-rebuild /etc/terminfo"
CXXFLAGS="-march=k8 -mmmx -m3dnow -pipe -O2 -fomit-frame-pointer -msse -msse2
-msse3 -combine"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig ccache distlocks fixpackages metadata-transfer sandbox
sfperms strict"
GENTOO_MIRRORS="http://mirror.datapipe.net/gentoo
http://mirror.datapipe.net/gentoo ftp://gentoo.mirrors.pair.com/
http://gentoo.mirrors.pair.com/ http://open-systems.ufl.edu/mirrors/gentoo
ftp://gentoo.ccccom.com http://gentoo.ccccom.com"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress
--force --whole-file --delete --delete-after --stats --timeout=180
--exclude='/distfiles' --exclude='/local' --exclude='/packages'"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="amd64 7zip X alsa asf avi berkdb bitmap-fonts cli crypt cups divx4linux
dlloader dri dvd dvdr dvdread eds emboss encode foomaticdb fortran gif
gimpprint gnome gpm gstreamer gtk gtk2 imlib ipv6 isdnlog jpeg kde
kdehiddenvisibility live lzw lzw-tiff matroska mjpeg mp3 mpeg ncurses nls nptl
nptlonly nvidia opendivx opengl pam pcre pdflib perl png pppd python qt qt3 qt4
quicktime readline reflection sdl session slang socks5 spell spl ssl tcpd
theora tiff toolame truetype-fonts type1-fonts unicode usb v4l v4l2 vcd xanim
xorg xpm xv xvmc zip zlib elibc_glibc input_devices_mouse
input_devices_keyboard kernel_linux userland_GNU video_cards_nv
video_cards_nvidia video_cards_vga video_cards_vmware video_cards_vesa"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS,
LINGUAS, PORTAGE_RSYNC_EXTRA_OPTS

thx

------- Comment #14 From Daniel Black 2006-08-06 04:46:26 0000 -------
> Test server is working if you want to test it
> 
I put this down to the test server being disabled - it doesn't respond to a SYN
packet. Please check.

------- Comment #15 From Daniel Black 2006-08-06 05:02:43 0000 -------
(In reply to comment #9)
> Hi, i have another trouble when i try to emerge new one lftp version, see

This is a different bug so please do a separate bug report in future.

> make[2]: Leaving directory `/var/tmp/portage/lftp-3.5.2-r1/work/lftp-3.5.2/src'
> make[1]: *** [install-am] Error 2
> make[1]: Leaving directory `/var/tmp/portage/lftp-3.5.2-r1/work/lftp-3.5.2/src'
> make: *** [install-recursive] Error 1
> 

Does this occur with MAKEOPTS=-j1? Does this error occur every time?

------- Comment #16 From José Valentín Gutiérrez Boquete 2006-08-07 01:58:48 0000 -------
(In reply to comment #12)
> > Test server is working if you want to test it
> > 
> I put this down to the test server being disabled - it doesn't respond to a SYN
> packet. Please check.
> 

Sorry, due to several hardware problems on my machine the test server was
unreachable this weekend, now it's working :)

------- Comment #17 From Enito 2006-08-07 05:35:42 0000 -------
(In reply to comment #13)
> (In reply to comment #9)
> > Hi, i have another trouble when i try to emerge new one lftp version, see
> 
> This is a different bug so please do a separate bug report in future.
> 
> > make[2]: Leaving directory `/var/tmp/portage/lftp-3.5.2-r1/work/lftp-3.5.2/src'
> > make[1]: *** [install-am] Error 2
> > make[1]: Leaving directory `/var/tmp/portage/lftp-3.5.2-r1/work/lftp-3.5.2/src'
> > make: *** [install-recursive] Error 1
> > 
> 
> Does this occur with MAKEOPTS=-j1? Does this error occur every time?
> 

Hi, i use the -j2 but i tryed j1 and same..some erorrs say libtool no find the
patch os some ssl stuff..i make rev-rebuildp and nothing..the strange thing i
use lftp 3.5.1 and works..

greets

------- Comment #18 From Daniel Black 2006-10-28 19:07:30 0000 -------
3.5.2 had a few bugs hence removed.

Is lftp-3.5.4/lftp-3.5.6 working for you?

------- Comment #19 From José Valentín Gutiérrez Boquete 2006-10-29 01:30:26 0000 -------
(In reply to comment #16)
> 3.5.2 had a few bugs hence removed.
> 
> Is lftp-3.5.4/lftp-3.5.6 working for you?
> 

lftp-3.5.6 it's working without problems :)

------- Comment #20 From Daniel Black 2006-10-29 01:46:09 0000 -------
great - thanks for getting back to me.