lavv17 / lftp

sophisticated command line file transfer program (ftp, http, sftp, fish, torrent)
http://lftp.yar.ru
GNU General Public License v3.0
1.08k stars 159 forks source link

lftp crashes with segmentation violation when running "find" #650

Closed goeranu closed 2 years ago

goeranu commented 2 years ago

The following command causes a segmentation violation

mimmi$ lftp http://ftp.acc.umu.se/mirror/fedora/linux/releases/35/Everything/x86_64/os/Packages
cd: received redirection to `http://ftp.acc.umu.se/mirror/fedora/linux/releases/35/Everything/x86_64/os/Packages/'
cd ok, cwd=/mirror/fedora/linux/releases/35/Everything/x86_64/os/Packages
lftp ftp.acc.umu.se:/mirror/fedora/linux/releases/35/Everything/x86_64/os/Packages> find */.
Segmenteringsfel (minnesutskrift skapad)
Exit 139

The backtrace looks like this:

#0  GetFileInfo::Do (this=0x55a7cdfe5a70) at /usr/src/debug/lftp-4.9.2-3.fc35.x86_64/src/FileSet.h:134
#1  GetFileInfo::Do (this=0x55a7cdfe5a70) at /usr/src/debug/lftp-4.9.2-3.fc35.x86_64/src/GetFileInfo.cc:117
#2  0x00007f3479be962c in SMTask::ScheduleThis (this=0x55a7cdfe5a70) at /usr/src/debug/lftp-4.9.2-3.fc35.x86_64/src/SMTask.cc:209
#3  0x00007f3479beae19 in SMTask::Schedule () at /usr/src/debug/lftp-4.9.2-3.fc35.x86_64/src/SMTask.cc:248
#4  0x00007f3479c74aa7 in Job::WaitDone (this=0x55a7cdfce610) at /usr/src/debug/lftp-4.9.2-3.fc35.x86_64/src/Job.cc:557
#5  0x000055a7cdd3ee72 in main (argc=2, argv=0x7ffe73a809e8) at /usr/src/debug/lftp-4.9.2-3.fc35.x86_64/src/SMTask.h:164

The top two frames don't really make sense to me. Frame 0 is the definition of HasAny which I can't see how it could get a violation, and frame 1 is the initial line of the definition of GetFileInfo::Do, not any executable code. I guess there is some C++ magic beyond me in play.

This was discovered on a Fedora 35 system with lftp-4.9.2-3.fc35.x86_64.

lavv17 commented 2 years ago

I have reproduced this, will try to fix