lftp 4.9.0-1 segmentation fault (core dumped)

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

lftp 4.9.0-1 segmentation fault (core dumped)

thierry blind
Hi,
I updated lftp 4.8.4-1 to lftp 4.9.0-1 but now calling following command will always core dump (I anonymized some confidential data):

lftp sftp://myuser@1.2.3.4:2222 -u myuser,mypasswd -e "set xfer:timeout 30; set net:timeout 30; set net:reconnect-interval-base 5; set net:max-retries 5; mirror --Remove-source-files --verbose . /path/to/local/dir; bye"

 337501 [main] lftp 16519 cygwin_exception::open_stackdumpfile: Dumping stack trace to lftp.exe.stackdump

Downgrading to lftp 4.8.4-1 solved the problem.
Note that my cygwin installation is up-to-date (as of 8 january 2020).

Thank you in advance for your help,
Greetings,
Thierry Blind.


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

lftp_strace.out (54K) Download Attachment
cygcheck.out (70K) Download Attachment
lftp.exe.stackdump (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: lftp 4.9.0-1 segmentation fault (core dumped)

Henry S. Thompson
thierry blind writes:

> I updated lftp 4.8.4-1 to lftp 4.9.0-1 but now calling following
> command will always core dump (I anonymized some confidential data):

Likewise, with just lftp, no arguments at all!

: gdb lftp
(gdb) run
Starting program: /usr/bin/lftp
[New Thread 23540.0x480c]
[New Thread 23540.0x8c4]
[New Thread 23540.0x5fa8]
[New Thread 23540.0x5e98]
warning: the debug information found in
"/usr/lib/debug//usr/bin/cygncursesw-10.d
ll.dbg" does not match "/usr/bin/cygncursesw-10.dll" (CRC mismatch).

[New Thread 23540.0x3848]

Thread 1 "lftp" received signal SIGSEGV, Segmentation fault.
0x000000010045c8b6 in lftp!_ZNK5_xmap9_lookup_cERK7xstring ()
(gdb) bt
#0  0x000000010045c8b6 in lftp!_ZNK5_xmap9_lookup_cERK7xstring ()
#1  0x000000010044bce3 in lftp!_ZN7ResType7FindVarEPKcPPKS_PS1_ ()
#2  0x000000010044cc72 in lftp!_ZN7ResType3SetEPKcS1_S1_b ()
#3  0x0000000180048df6 in do_global_ctors (force=0, in_pfunc=<optimized
out>)
    at /usr/src/debug/cygwin-3.1.2-1/winsup/cygwin/dcrt0.cc:77
#4  __main () at
/usr/src/debug/cygwin-3.1.2-1/winsup/cygwin/dcrt0.cc:1138
#5  0x00000001004d251d in main ()

ht
--
       Henry S. Thompson, School of Informatics, University of Edinburgh
      10 Crichton Street, Edinburgh EH8 9AB, SCOTLAND -- (44) 131 650-4440
                Fax: (44) 131 650-4587, e-mail: [hidden email]
                       URL: http://www.ltg.ed.ac.uk/~ht/
 [mail from me _always_ has a .sig like this -- mail without it is forged spam]

The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

Reply | Threaded
Open this post in threaded view
|

Re: lftp 4.9.0-1 segmentation fault (core dumped)

Henry S. Thompson
Henry S. Thompson writes:

> thierry blind writes:
>
>> I updated lftp 4.8.4-1 to lftp 4.9.0-1 but now calling following
>> command will always core dump (I anonymized some confidential data):
>
> Likewise, with just lftp, no arguments at all!

OK, installed src, built it using cygport, and found the problem.

It only happens under the call to Set in the following, i.e. if the IPV6
test fails (see src/network.cc:482)

#if INET6
   // check if ipv6 is really supported
   if(!Networker::FindGlobalIPv6Address() || !CanCreateIpv6Socket())
      ResMgr::Set("dns:order",0,"inet");
#endif

This code is called during dll/module initialisation, at which point the
call to 'ResMgr::Set' segfaults because another static var
initialisation (resource.cc:426) hasn't happened.

It's seems likely that the upstream people, and the package maintainer,
were running on systems with IPV6 enabled, so they didn't hit the
problem.

So, the fix is for the upstream people to fix the ordering problem.

One way, perhaps not the best, to do this is in the attached patch.

Not sure if this is a cygwin problem or an upstream problem...

[The attached file contains a definite upstream fix as well, only
 triggered if you try to build with --disable-ipv6]

ht


--
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.


--
       Henry S. Thompson, School of Informatics, University of Edinburgh
      10 Crichton Street, Edinburgh EH8 9AB, SCOTLAND -- (44) 131 650-4440
                Fax: (44) 131 650-4587, e-mail: [hidden email]
                       URL: http://www.ltg.ed.ac.uk/~ht/
 [mail from me _always_ has a .sig like this -- mail without it is forged spam]



--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

lftp-ipv6-fail-fix.patch (2K) Download Attachment