lavv17 / lftp

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

lftp 4.9.0 Cygwin 3.1.* Win10 x64 segmentation fault lftp --version #557

Closed userdocs closed 4 years ago

userdocs commented 4 years ago

After it compiles I get this segmentation fault when checking the version using

lftp --version

Here is the stackdump

Exception: STATUS_ACCESS_VIOLATION at rip=00100459C06
rax=00000001005100E0 rbx=00000000FFFFCAE8 rcx=0000000000000000
rdx=00000001005100E0 rsi=00000000FFFFCB18 rdi=00000001004F2542
r8 =00000006FFB58E1E r9 =000000018031D108 r10=0000000100000000
r11=0000000100453E42 r12=00000001004D7A70 r13=0000000000000000
r14=0000000000000000 r15=0000000000000000
rbp=00000000FFFFCAC0 rsp=00000000FFFFCA00
program=C:\Users\username\Desktop\build\system\usr\local\bin\lftp.exe, pid 183, thread main
cs=0033 ds=002B es=002B fs=0053 gs=002B ss=002B
Stack trace:
Frame        Function    Args
000FFFFCAC0  00100459C06 (001800D269E, 00000000000, 00000000000, 00000000000)
000FFFFCAC0  00100449D0A (001004D1818, 001004D16C0, 001004C2729, 001004D1820)
00000000002  0010044AB20 (00000000000, 000FFFFCCD0, 00000000030, 003FDD0F000)
00000000002  00180048DF6 (001801A3B59, 003FDD01080, 00180049100, 000FFFFCCD0)
00000000002  001004CEF4D (00000000020, FF0700010302FF00, 0018004A7BA, 00180049800)
000FFFFCCD0  0018004A826 (00000000000, 00000000000, 00000000000, 00000000000)
00000000000  00180048353 (00000000000, 00000000000, 00000000000, 00000000000)
000FFFFFFF0  00180048404 (00000000000, 00000000000, 00000000000, 00000000000)
End of stack trace
mshedsilegx commented 4 years ago

I am experiencing the exact same problem on windows 7, lftp 4.9.0, cygwin 3.1.2, gcc 7.4.0

1- Stackdump Exception: STATUS_ACCESS_VIOLATION at eip=00469150 eax=00000000 ebx=005015BC ecx=00000000 edx=00566800 esi=00501510 edi=0022CD84 ebp=0022CAA8 esp=0022CA80 program=\usr\bin\lftp.exe, pid 16481, thread main cs=001B ds=0023 es=0023 fs=003B gs=0000 ss=0023 Stack trace: Frame Function Args 0022CAA8 00469150 (00000000, 00566800, 00000009, 00463471) 0022CAD8 00469270 (00000000, 00566800, 0022CB08, 004F7C20) 0022CB08 004FF02C (00000000, 00566800, 6112AEB9, 003B0023) 0022CB28 004FF010 (00000000, 0051F952, 200426FC, 20042EC8) 0022CB68 004546AE (0051F952, 0022CBB8, 0022CBD4, 6112AF5F) 0022CB88 004F6D0F (0051F952, 0022CBB8, 0022CBD4, 004E2A6F) 0022CBC8 0045492F (0051F952, 00000000, 0051F94D, 00000000) 0022CBE8 004E2B3B (00568181, 5AA10000, 5AA10000, 00401126) 0022CC08 004E2B5F (00000001, 0000FFFF, 00000000, 005015C0) 0022CC28 004E2B7C (61017710, 00000049, 0022FD24, 610177C3) 0022CC78 61009085 (00000002, 0022CC9C, 200385C0, 6100AAA8) 0022CD28 6100AB0A (00000000, 0022CD84, 61009AA0, 00000000) End of stack trace

2- GDB run with --debug [New Thread 5188.0x1fe4] [New Thread 5188.0x19e0] [New Thread 5188.0x1b18] [New Thread 5188.0x198c]

Thread 1 "lftp" received signal SIGSEGV, Segmentation fault. 0x00469150 in _xmap::make_hash (this=0x0, s=...) at xmap.cc:54 54 if(hash_size==1)

lavv17 commented 4 years ago

Please get the stack trace from the debugger. The command "info stack" or "bt"

mshedsilegx commented 4 years ago

Please find below result of "bt"

0 0x00469150 in _xmap::make_hash (this=0x0, s=...) at xmap.cc:54

1 0x00469270 in _xmap::_lookup_c (this=0x0, key=...) at xmap.cc:81

2 0x004ff02c in xmap<ResType*>::lookup (this=0x0, key=...) at xmap.h:86

3 0x004ff010 in xmap<ResType*>::lookup (this=0x0,

key=0x51f952 <RateLimit::AddXfer(int)::__PRETTY_FUNCTION__+266> "dns:order") at xmap.h:91

4 0x004546ae in ResType::FindVar (

name=0x51f952 <RateLimit::AddXfer(int)::__PRETTY_FUNCTION__+266> "dns:order", type=0x22cb68,
re_closure=0x22cb84) at ResMgr.cc:89

5 0x004f6d0f in ResType::FindVar (

name=0x51f952 <RateLimit::AddXfer(int)::__PRETTY_FUNCTION__+266> "dns:order", type=0x22cb68,
re_closure=0x22cb84) at ResMgr.h:78

6 0x0045492f in ResType::Set (

name=0x51f952 <RateLimit::AddXfer(int)::__PRETTY_FUNCTION__+266> "dns:order", cclosure=0x0,
cvalue=0x51f94d <RateLimit::AddXfer(int)::__PRETTY_FUNCTION__+261> "inet", def=false) at ResMgr.cc:159

7 0x004e2b3b in NetworkInit::NetworkInit (this=0x568181 ) at network.cc:485

8 0x004e2b5f in static_initialization_and_destruction_0 (initialize_p=1, __priority=65535)

at network.cc:478

9 0x004e2b7c in _GLOBAL__sub_I__ZNK10sockaddr_u7addressEv () at network.cc:487

10 0x61009085 in __main () from /usr/bin/cygwin1.dll

11 0x0022fd24 in ?? ()

12 0x6100ab0a in cygwin_exit_return () from /usr/bin/cygwin1.dll

13 0x00000001 in ?? ()

14 0x0022cc4c in ?? ()

15 0x610085d2 in _cygtls::call2(unsigned long ()(void, void), void, void*) () from /usr/bin/cygwin1.dll

userdocs commented 4 years ago

Install commands

wget -qO ~/lftp.tar.gz "http://lftp.yar.ru/ftp/lftp-4.9.0.tar.gz"
tar xf ~/lftp.tar.gz -C ~/ && cd lftp-4.9.0
./configure --prefix="$HOME" --with-debug
make -j$(nproc) && make install

gdb lftp

$ gdb lftp
GNU gdb (GDB) (Cygwin 8.1.1-1) 8.1.1
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-pc-cygwin".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from lftp...done.

gdb run

(gdb) run
Starting program: /cygdrive/c/Users/username/Desktop/build/home/bin/lftp

[New Thread 5184.0x217c]
[New Thread 5184.0x1804]
[New Thread 5184.0x16c0]
[New Thread 5184.0x1dd0]
[New Thread 5184.0xf24]

Thread 1 "lftp" received signal SIGSEGV, Segmentation fault.
0x00000001004721e8 in _xmap::make_hash (this=0x0, s=...) at xmap.cc:54
54         if(hash_size==1)

gdb bt

(gdb) bt
#0  0x00000001004721e8 in _xmap::make_hash (this=0x0, s=...) at xmap.cc:54
#1  0x0000000100472332 in _xmap::_lookup_c (this=0x0, key=...) at xmap.cc:81
#2  0x000000010051a8f0 in xmap<ResType*>::lookup (this=0x0, key=...) at xmap.h:86
#3  0x000000010051a8c8 in xmap<ResType*>::lookup (this=0x0, key=0x10053fc82 <RateLimit::AddXfer(int)::__PRETTY_FUNCTION__+274> "dns:order") at xmap.h:91
#4  0x000000010045c132 in ResType::FindVar (name=0x10053fc82 <RateLimit::AddXfer(int)::__PRETTY_FUNCTION__+274> "dns:order", type=0xffffca90, re_closure=0xffffcab8) at ResMgr.cc:89
#5  0x000000010050e40b in ResType::FindVar (name=0x10053fc82 <RateLimit::AddXfer(int)::__PRETTY_FUNCTION__+274> "dns:order", type=0xffffca90, re_closure=0xffffcab8) at ResMgr.h:78
#6  0x000000010045c40b in ResType::Set (name=0x10053fc82 <RateLimit::AddXfer(int)::__PRETTY_FUNCTION__+274> "dns:order", cclosure=0x0, cvalue=0x10053fc7d <RateLimit::AddXfer(int)::__PRETTY_FUNCTION__+269> "inet", def=false) at ResMgr.cc:159
#7  0x00000001004f3150 in NetworkInit::NetworkInit (this=0x10056dc21 <NETWORK_INIT>) at network.cc:485
#8  0x00000001004f3180 in __static_initialization_and_destruction_0 (__initialize_p=1, __priority=65535) at network.cc:478
#9  0x00000001004f319e in _GLOBAL__sub_I__ZNK10sockaddr_u7addressEv () at network.cc:487
#10 0x0000000180048df6 in __main () from /usr/bin/cygwin1.dll
#11 0x0000000100401f87 in main (argc=1, argv=0xffffcc20) at lftp.cc:540
(gdb)
pixel8383 commented 4 years ago

Same happening on FreeBSD 11.2-RELEASE-p15.

lftp 4.8.4 was working great. lftp 4.9.0 crashes with segmentation fault.

userdocs commented 4 years ago

I saw this comment and i thought I'd test it. I can confirm it fixed the issue i experienced to open the issue. Thanks @sasaki12

So what i did?

Downloaded the source code for 4.9.0 Applied this commit manually Configured like this:

./configure --disable-ipv6
make -j4
make install

The i ran lftp --version

The result

2020-01-08_23-23-03

2020-01-08_23-29-15

It appears the issues are related.

zouhair commented 4 years ago

Same problem