Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 61335 - lftp memory leak: usage of memory increases after the program remains active for a while
Summary: lftp memory leak: usage of memory increases after the program remains active ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: High critical (vote)
Assignee: Daniel Black (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-08-23 01:31 UTC by The Master
Modified: 2004-08-26 14:12 UTC (History)
1 user (show)

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


Attachments
lftp-3.0.7-memleak.patch (lftp-3.0.7-memleak.patch,2.26 KB, patch)
2004-08-23 18:54 UTC, Luke Macken (RETIRED)
Details | Diff
lftp-3.0.7-r1.ebuild (lftp-3.0.7-r1.ebuild,1.82 KB, text/plain)
2004-08-23 18:55 UTC, Luke Macken (RETIRED)
Details
lftp-3.0.7-r1.ebuild (lftp-3.0.7-r1.ebuild,1.81 KB, text/plain)
2004-08-23 18:57 UTC, Luke Macken (RETIRED)
Details
lftp-3.0.7-memleak.patch (lftp-3.0.7-memleak.patch,2.11 KB, patch)
2004-08-24 08:22 UTC, Luke Macken (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description The Master 2004-08-23 01:31:42 UTC
When I use lftp versions 3.0.5 to 3.0.7, memory usage of lftp slowly increases as time passes. After a few hours, I saw that lftp was consuming 300MiB of RAM. This problem does not manifest itself in lftp 3.0.3. The problem has been present prior to my transition to gcc 3.4, so I do not believe it to be a compiler problem. I also tried to compile the program with blank CFLAGS to no avail. 

Reproducible: Always
Steps to Reproduce:
1. Run lftp
2. Wait
3. Check memory usage

Actual Results:  
According to 'ps', memory usage slowly increased the longer the program ran,
until eventually the program was killed by the kernel since it exhausted all the
available memory.

Expected Results:  
The software should have run without using so much memory.

Portage 2.0.50-r9 (gcc34-x86-2004.2, gcc-3.4.1, glibc-2.3.4.20040808-r0,
2.6.7-gentoo-r11)
=================================================================
System uname: 2.6.7-gentoo-r11 i686 Intel(R) Pentium(R) 4 CPU 2.26GHz
Gentoo Base System version 1.5.3
distcc 2.16 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
Autoconf: sys-devel/autoconf-2.59-r4
Automake: sys-devel/automake-1.8.5-r1
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CFLAGS="-march=pentium4 -Os -mfpmath=sse,387 -fomit-frame-pointer -fPIC -ftracer
-fforce-addr -ffast-math -fweb -maccumulate-outgoing-args -pipe"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config
/usr/kde/3.3/share/config:/usr/kde/3.3/env:/usr/kde/3.3/shutdown
/usr/kde/3/share/config /usr/lib/mozilla/defaults/pref /usr/share/config
/usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/
/usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/
/usr/share/texmf/xdvi/ /var/bind /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-march=pentium4 -Os -mfpmath=sse,387 -fomit-frame-pointer -fPIC
-ftracer -fforce-addr -ffast-math -fweb -maccumulate-outgoing-args -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs ccache sandbox"
GENTOO_MIRRORS="ftp:///ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/
ftp://mirror.gentoo.ru/pub/mirror/gentoo/ http://mirror.datapipe.net/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage
/usr/local/overlays/bmg-gnome-current.alternative"
SYNC="rsync://rsync.ca.gentoo.org/gentoo-portage"
USE="X Xaw3d aalib acl acpi aim alsa apache2 apm arts avi berkdb bidi bonobo
bundled-libs bzlib canna cdr chroot cjk crypt cups curl dba dga dv dvd dvdr
encode esd faad fbcon ffmpeg flac flash foomaticdb gd gdbm gif gimpprint gnome
gphoto2 gpm gstreamer gtk gtk2 gtkhtml guile icc icq imagemagick imlib innodb
ipv6 java jikes joystick jpeg kde kerberos ldap libg++ libwww mad matroska
matrox memlimit mikmod mmx mng monkey mono motif mozilla mpeg msn mysql ncurses
nls nptl oav oggvorbis opengl oscar oss pam pdflib perl pic plotutils png ppds
psyco python qt quicktime readline samba scanner sdl slang slp socks5 spell sse
ssl stroke svg svga tcltk tcpd tetex theora tiff transcode truetype unicode usb
video_cards_radeon videos wmf wxwindows x86 xine xinerama xml xml2 xmms xosd xv
xvid yahoo zlib zvbi"
Comment 1 Miguel Sousa Filipe 2004-08-23 09:42:47 UTC
If I were you, I would try less agressive gcc optimizations... the problem might be there...

miguel
Comment 2 The Master 2004-08-23 12:32:36 UTC
"I also tried to compile the program with blank CFLAGS to no avail.", so I do not believe my gcc optimizations are at fault. As well as the fact that version 3.0.3 of lftp works flawlessly, only versions 3.0.5 and above are affected.
Comment 3 The Master 2004-08-23 12:35:58 UTC
Also, I tried gcc 3.3, and ICC (Intel C Compiler) as well, and the memory leak is still present in lftp 3.0.5 and above.
Comment 4 Luke Macken (RETIRED) gentoo-dev 2004-08-23 18:54:29 UTC
Created attachment 38066 [details, diff]
lftp-3.0.7-memleak.patch

Patch to fix 12 memory leaks in the code.  Patch emailed to upstream to verify
validity.
Comment 5 Luke Macken (RETIRED) gentoo-dev 2004-08-23 18:55:04 UTC
Created attachment 38067 [details]
lftp-3.0.7-r1.ebuild

Ebuild revision -r1 to apply memory leak patch.
Comment 6 Luke Macken (RETIRED) gentoo-dev 2004-08-23 18:57:03 UTC
Created attachment 38070 [details]
lftp-3.0.7-r1.ebuild

Revised ebuild to apply memory leak patch.
Comment 7 Luke Macken (RETIRED) gentoo-dev 2004-08-24 08:22:33 UTC
Created attachment 38096 [details, diff]
lftp-3.0.7-memleak.patch

Fixed an few things.
Comment 8 Daniel Black (RETIRED) gentoo-dev 2004-08-26 14:12:22 UTC
fixed - thanks for the patch