<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugs.gentoo.org/bugzilla.dtd">

<bugzilla version="2.22.7"
          urlbase="http://bugs.gentoo.org/"
          maintainer="bugzilla@gentoo.org"
>

    <bug>
          <bug_id>203729</bug_id>
          
          <creation_ts>2007-12-30 00:35 0000</creation_ts>
          <short_desc>net-ftp/lftp-3.6.1 du command causes segfault</short_desc>
          <delta_ts>2008-01-21 20:19:01 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Gentoo Linux</product>
          <component>Applications</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>esqualante@o2.pl</reporter>
          <assigned_to>dragonheart@gentoo.org</assigned_to>
          

      

      
          <long_desc isprivate="0">
            <who>esqualante@o2.pl</who>
            <bug_when>2007-12-30 00:35:38 0000</bug_when>
            <thetext>du command causes lftp segfault when it tries to print size of file/dir with long pathname.

Reproducible: Always

Steps to Reproduce:
1. create file (not empty) with long name, say bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
2. share it on ftp server
3. try &apos;du bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb&apos; in lftp
4. lftp segfaults (checked on remote serwer and localhost)
5. it also happens if path is very long e.g. bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/bbbbbbbbbb

Actual Results:  
gdb bt full

#0  0x000000327e476c10 in strlen () from /lib/libc.so.6
No symbol table info available.
#1  0x000000327e445e10 in vfprintf () from /lib/libc.so.6
No symbol table info available.
#2  0x000000327e4697fa in vsnprintf () from /lib/libc.so.6
No symbol table info available.
#3  0x00002b9562760c17 in Buffer::vFormat (this=0x6139d0, f=0x2b956251ebc8 &quot;%s\t%s\n&quot;, v=0x7fff485e1eb0)
    at buffer.cc:158
	tmp = {{gp_offset = 32, fp_offset = 48, overflow_arg_area = 0x7fff485e1f90, reg_save_area = 0x7fff485e1ed0}}
	res = &lt;value optimized out&gt;
	size = 1649535944
#4  0x00002b9562760cdc in Buffer::Format (this=0x9, f=0x2b956251ebc8 &quot;%s\t%s\n&quot;) at buffer.cc:147
	v = {{gp_offset = 40, fp_offset = 48, overflow_arg_area = 0x7fff485e1f90, reg_save_area = 0x7fff485e1ed0}}
#5  0x00002b9562514bc0 in FinderJob_Du::print_size (this=0x6694e0, n_blocks=&lt;value optimized out&gt;, 
    string=0x687d90 &apos;b&apos; &lt;repeats 64 times&gt;) at FindJobDu.cc:177
	buffer = &quot;\n\000\000\000\000\000\000\0008zf\000\000\000\000\000\001\000\000\000\000\000\000\000\024\000\000\000\000\000\000\000=É\r\215\000\000\000\000L\216\000~2\000\000\000\002\000\000\000\000\000\000\000\234SNb\225+\000\000Zìm\020\000\000\000\000L\216\000~=\000\000\000$74\002\000\000\000\000\000 ^Hÿ\177\000\000h!^Hÿ\177\000\000ø[Nb\225+&quot;, &apos;\0&apos; &lt;repeats 18 times&gt;, &quot;ØPLb\225+\000\000rþNb\225+\000\000p³Nb\225+\000\000H\201Nb\225+\000\000\000\000\000\000\001\000\000\000\216\001\000\000\001\000\000\0008tsb\225+\000\0000TLb\225+\000\000 !^Hÿ\177\000\000P!^Hÿ\177\000\000&quot;...
#6  0x00002b9562514d1b in FinderJob_Du::ProcessFile (this=0x6694e0, d=&lt;value optimized out&gt;, fi=0x688170)
    at FindJobDu.cc:141
	add = &lt;value optimized out&gt;
#7  0x00002b95625133c1 in FinderJob::Do (this=0x6694e0) at FindJob.cc:144
	m = 1
	pres = &lt;value optimized out&gt;
	j = &lt;value optimized out&gt;
#8  0x00002b956274c46e in SMTask::Schedule () at SMTask.cc:226
	scan = (SMTask *) 0x6694e0
	timer_timeout = &lt;value optimized out&gt;
	res = 0
#9  0x00002b95624fc9b2 in Job::WaitDone (this=0x6136d0) at Job.cc:522
No locals.
#10 0x0000000000405be8 in main (argc=1, argv=0x7fff485e2418) at lftp.cc:466
	home = &lt;value optimized out&gt;
	exit_code = &lt;value optimized out&gt;
#11 0x000000327e41e1f4 in __libc_start_main () from /lib/libc.so.6
No symbol table info available.
#12 0x0000000000405239 in _start ()
No symbol table info available.



Portage 2.1.4_rc9 (default-linux/amd64/2007.0, gcc-4.2.2, glibc-2.7-r1, 2.6.23-tuxonice-r4 x86_64)
=================================================================
System uname: 2.6.23-tuxonice-r4 x86_64 Intel(R) Core(TM)2 CPU 6300 @ 1.86GHz
Timestamp of tree: Wed, 12 Dec 2007 17:16:01 +0000
app-shells/bash:     3.2_p17-r1
dev-java/java-config: 1.3.7, 2.1.3
dev-lang/python:     2.5.1-r4
sys-apps/baselayout: 1.12.10-r5
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.13, 2.61-r1
sys-devel/automake:  1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.18-r1
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.24
virtual/os-headers:  2.6.23-r2
ACCEPT_KEYWORDS=&quot;amd64 ~amd64&quot;
CBUILD=&quot;x86_64-pc-linux-gnu&quot;
CFLAGS=&quot;-march=nocona -O2 -pipe -ggdb&quot;
CHOST=&quot;x86_64-pc-linux-gnu&quot;
CONFIG_PROTECT=&quot;/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config&quot;
CONFIG_PROTECT_MASK=&quot;/etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/php/apache2-php4/ext-active/ /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php4/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php4/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/splash /etc/terminfo /etc/texmf/web2c /etc/udev/rules.d&quot;
CXXFLAGS=&quot;-march=nocona -O2 -pipe -ggdb&quot;
DISTDIR=&quot;/usr/portage.distfiles&quot;
FEATURES=&quot;distlocks fixpackages metadata-transfer parallel-fetch sandbox sfperms splitdebug strict test unmerge-orphans userfetch userpriv usersandbox&quot;
GENTOO_MIRRORS=&quot;http://gentoo.prz.rzeszow.pl ftp://gentoo.po.opole.pl ftp://pandemonium.tiscali.de/pub/gentoo/ ftp://ftp.tu-clausthal.de/pub/linux/gentoo/&quot;
LANG=&quot;pl_PL.UTF-8&quot;
LC_ALL=&quot;pl_PL.UTF-8&quot;
LINGUAS=&quot;pl&quot;
MAKEOPTS=&quot;-j3&quot;
PKGDIR=&quot;/usr/portage/packages&quot;
PORTAGE_RSYNC_OPTS=&quot;--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*&quot;
PORTAGE_TMPDIR=&quot;/var/tmp&quot;
PORTDIR=&quot;/usr/portage&quot;
PORTDIR_OVERLAY=&quot;/usr/portage/local/layman/sunrise /usr/portage/local/layman/custom-kernels /usr/local/portage&quot;
SYNC=&quot;rsync://rsync.europe.gentoo.org/gentoo-portage&quot;
USE=&quot;X aac alsa amd64 apache2 bash-completion berkdb bitmap-fonts cairo cdr cli cracklib crypt cups dbus dri dvd dvdr dvdread encode flac gdbm gif gnutls gpm gstreamer gtk hal iconv java jpeg kdeenablefinal kdehiddenvisibility lcms logrotate mad midi mmx mp3 mpeg mudflap musepack mysql ncurses nls nptl nptlonly nsplugin ogg opengl openmp oss pam pcre pdf perl php png postgres python quicktime readline sasl sdl session slang spell spl sse sse2 ssl svg tcpd test threads truetype truetype-fonts type1-fonts unicode vim-syntax vorbis xcomposite xml xorg xvid zlib&quot; ALSA_CARDS=&quot;hda-intel&quot; ALSA_PCM_PLUGINS=&quot;adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol&quot; APACHE2_MODULES=&quot;actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias&quot; ELIBC=&quot;glibc&quot; INPUT_DEVICES=&quot;keyboard mouse evdev&quot; KERNEL=&quot;linux&quot; LCD_DEVICES=&quot;bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text&quot; LINGUAS=&quot;pl&quot; USERLAND=&quot;GNU&quot; VIDEO_CARDS=&quot;i810 i830 i915 vesa&quot;
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LDFLAGS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>esqualante@o2.pl</who>
            <bug_when>2008-01-03 09:41:22 0000</bug_when>
            <thetext>Created an attachment (id=139942)
patch from Alexander V. Lukyanov

</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>armin76@gentoo.org</who>
            <bug_when>2008-01-21 20:19:01 0000</bug_when>
            <thetext>Fixed in -r1, thanks</thetext>
          </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>139942</attachid>
            <date>2008-01-03 09:41 0000</date>
            <desc>patch from Alexander V. Lukyanov</desc>
            <filename>diff</filename>
            <type>text/plain</type>
            <data encoding="base64">SW5kZXg6IGJ1ZmZlci5jYwo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09ClJDUyBmaWxlOiAvaG9tZS9sYXYvY3Zzcm9vdC9s
ZnRwL3NyYy9idWZmZXIuY2MsdgpyZXRyaWV2aW5nIHJldmlzaW9uIDEuNjYKZGlmZiAtdSAtcCAt
cjEuNjYgYnVmZmVyLmNjCi0tLSBidWZmZXIuY2MJMTAgU2VwIDIwMDcgMTE6NDU6MjcgLTAwMDAJ
MS42NgorKysgYnVmZmVyLmNjCTMgSmFuIDIwMDggMDk6MDc6NDMgLTAwMDAKQEAgLTE1NSw3ICsx
NTUsNyBAQCB2b2lkIEJ1ZmZlcjo6dkZvcm1hdChjb25zdCBjaGFyICpmLCB2YV9sCiAgICB7CiAg
ICAgICB2YV9saXN0IHRtcDsKICAgICAgIFZBX0NPUFkodG1wLHYpOwotICAgICAgaW50IHJlcz12
c25wcmludGYoR2V0U3BhY2Uoc2l6ZSksIHNpemUsIGYsIHYpOworICAgICAgaW50IHJlcz12c25w
cmludGYoR2V0U3BhY2Uoc2l6ZSksIHNpemUsIGYsIHRtcCk7CiAgICAgICB2YV9lbmQodG1wKTsK
ICAgICAgIGlmKHJlcz49MCAmJiByZXM8c2l6ZSkKICAgICAgIHsK
</data>        

          </attachment>
    </bug>

</bugzilla>