Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lftp 4.9.0 segmentation fault on FreeBSD 11.2 #562

Closed
pixel8383 opened this issue Jan 7, 2020 · 5 comments
Closed

lftp 4.9.0 segmentation fault on FreeBSD 11.2 #562

pixel8383 opened this issue Jan 7, 2020 · 5 comments

Comments

@pixel8383
Copy link

On FreeBSD 11.2-RELEASE-p15 the latest pkg of lftp is crashing with seg fault.

root@server:/ # pkg update && pkg upgrade
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Checking for upgrades (0 candidates): 100%
Processing candidates (0 candidates): 100%
Checking integrity... done (0 conflicting)
Your packages are up to date.
root@server:/ # pkg install lftp
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Checking integrity... done (0 conflicting)
The most recent versions of packages are already installed
root@server:/ # pkg info lftp
lftp-4.9.0
Name           : lftp
Version        : 4.9.0
Installed on   : Mon Jan  6 22:39:58 2020 CET
Origin         : ftp/lftp
Architecture   : FreeBSD:11:amd64
Prefix         : /usr/local
Categories     : ftp
Licenses       : GPLv3
Maintainer     : martymac@FreeBSD.org
WWW            : http://lftp.tech/
Comment        : Shell-like command line FTP client
Options        :
	DOCS           : on
	GNUTLS         : off
	NLS            : on
	OPENSSL        : on
Shared Libs required:
	libidn2.so.0
	libintl.so.8
	libexpat.so.1
	libreadline.so.8
Annotations    :
	FreeBSD_version: 1103000
	repo_type      : binary
	repository     : FreeBSD
Flat size      : 4.21MiB
Description    :
LFTP is a shell-like command line ftp client. It is
reliable: can retry operations and does reget automatically.
It can do several transfers simultaneously in background.
You can start a transfer in background and continue browsing
the ftp site or another one. This all is done in one process.
Background jobs will be completed in nohup mode if you exit
or close modem connection. Lftp has reput, mirror, reverse
mirror among its features.

WWW: http://lftp.tech/
root@server:/ # lftp
Segmentation fault

@pixel8383 pixel8383 changed the title lftp 4.9.0 segmentation fault lftp 4.9.0 segmentation fault on FreeBSD 11.2 Jan 7, 2020
@sasaki12
Copy link

sasaki12 commented Jan 8, 2020

Same issue on 11.3-STABLE.

This is IPv6 related issue. This issue will be solved if you run configure with --disable-ipv6 option. Unfortunately, current port's Makefile doesn't have IPV6 option. Therefore, you can add the following code to /etc/make.conf and run make.

.if ${.CURDIR} == "/usr/ports/ftp/lftp"
CONFIGURE_ARGS+=	--disable-ipv6
.endif

In addition, lftp port doesn't import #553 fix. Thus, you have to add the patch manually.

@lavv17
Copy link
Owner

lavv17 commented Jan 8, 2020

Please compile lftp with debug info and get a stack trace using a debugger

@sasaki12
Copy link

sasaki12 commented Jan 9, 2020

The result of "bt" is below

# gdb /var/ports/usr/ports/ftp/lftp/work/lftp-4.9.0/src/lftp
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "amd64-marcel-freebsd"...
(gdb) run
Starting program: /var/ports/usr/ports/ftp/lftp/work/lftp-4.9.0/src/lftp 

Program received signal SIGSEGV, Segmentation fault.
_xmap::_lookup_c (this=0x0, key=@0x76fac0) at xmap.cc:54
54         if(hash_size==1)
(gdb) bt
#0  _xmap::_lookup_c (this=0x0, key=@0x76fac0) at xmap.cc:54
#1  0x0000000000490dd7 in ResType::FindVar (name=0x534848 "dns:order", type=0x7fffffffd590, re_closure=0x7fffffffd598) at xmap.h:86
#2  0x0000000000491071 in ResType::Set (name=<value optimized out>, cclosure=0x0, cvalue=0x534858 "inet") at ResMgr.h:78
#3  0x00000000005207e2 in __do_global_ctors_aux ()
#4  0x000000000043fc1e in _init ()
#5  0x00007fffffffda60 in ?? ()
#6  0x000000080076e95c in r_debug_state () from /libexec/ld-elf.so.1
#7  0x000000080076d8b2 in __tls_get_addr () from /libexec/ld-elf.so.1
#8  0x000000080076b6b9 in .text () from /libexec/ld-elf.so.1
#9  0x0000000000000000 in ?? ()

@Farmbuyer
Copy link

Same thing happens under Cygwin, when the underlying Windows system has no IPv6 address.

`$ lftp
Segmentation fault (core dumped)

$ cat lftp.exe.stackdump
Exception: STATUS_ACCESS_VIOLATION at rip=0010045C8B6
rax=00000001005130E0 rbx=00000000FFFFCAC0 rcx=0000000000000000
rdx=00000001005130E0 rsi=000000018031DC50 rdi=00000001004F6032
r8 =00000006FFB42C1E r9 =0000000800038C60 r10=0000000100000000
r11=00000001004566E2 r12=00000000FFFFCAB8 r13=0000000000000000
r14=0000000000000000 r15=0000000000000000
rbp=00000000FFFFCA80 rsp=00000000FFFFC9C0
program=D:\cygwin\bin\lftp.exe, pid 1068, thread main
cs=0033 ds=002B es=002B fs=0053 gs=002B ss=002B
Stack trace:
Frame Function Args
000FFFFCA80 0010045C8B6 (00800050F50, 0018031DC50, 00000000000, 00000000001)
000FFFFCA80 0010044BCE3 (6AD49A70C876549A, 001004D4EA8, 001004D4D50, 000FFFFCDF0)
00000000001 0010044CC72 (00000000000, 00000000000, 001801AD261, 00000000002)
00000000001 00180048DF6 (0018031DA80, 00000000000, 0018031DA80, 00000000000)
00000000001 001004D251D (00000000020, 30001000000FF00, 0018004A7BA, 00000310000)
000FFFFCCD0 0018004A826 (00000000000, 00000000000, 00000000000, 00000000000)
00000000000 00180048353 (00000000000, 00000000000, 00000000000, 00000000000)
000FFFFFFF0 00180048404 (00000000000, 00000000000, 00000000000, 00000000000)
End of stack trace

$`

Is there a runtime option or config file setting to avoid the use of IPv6 in the meantime? Building from scratch isn't an option on this particular system, nor is activating an IPv6 driver, I'm afraid.

@pixel8383
Copy link
Author

The issue is I am using lftp on a machine where I can't use ports and I am using the lftp version included into http://pkg.FreeBSD.org/FreeBSD:11:amd64/quarterly (which has been updated to 4.9.0 recently).

Is there any workaround?

@lavv17 lavv17 closed this as completed in 5d34493 Jan 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants