Bug 208121 - ftp/filezilla: After update to 3.16.0 I can't connect to any FTP server
Summary: ftp/filezilla: After update to 3.16.0 I can't connect to any FTP server
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-03-18 16:26 UTC by Grzegorz Blach
Modified: 2016-07-03 04:21 UTC (History)
8 users (show)

See Also:
bugzilla: maintainer-feedback? (rezny)
pkubaj: merge-quarterly?


Attachments
libfilezilla fix (647 bytes, patch)
2016-04-03 11:05 UTC, Mikael Urankar
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Grzegorz Blach freebsd_committer freebsd_triage 2016-03-18 16:26:53 UTC
After Filezilla was updated to 3.16.0, when I try to connect to any FTP server I see in message log something like this:

Status:	Resolving address of ftp.blachconsult.nazwa.pl
Error:	Could not connect to server: EINVAL - Invalid argument passed
Error:	Could not connect to server
Status:	Waiting to retry...
Status:	Resolving address of ftp.blachconsult.nazwa.pl
Error:	Could not connect to server: EINVAL - Invalid argument passed
Error:	Could not connect to server

Connecting to SFTP servers works OK.

I'm not sure if this is bug in filezilla itself or in a port.
Comment 1 martin.dieringer 2016-03-21 06:57:14 UTC
same problem here
Comment 2 martin.dieringer 2016-03-21 07:02:52 UTC
updating to 3.16.1 doesn't help
Comment 3 Henrik Hudson 2016-03-24 20:08:15 UTC
I have the same issue.

OS: FreeBSD 10.2-P14 x64
Comment 4 Dušan Vejnovič 2016-03-30 19:20:43 UTC
(In reply to martin.dieringer from comment #2)

same problem here.
Comment 5 Jack 2016-04-03 06:54:47 UTC
I have the same issue
Comment 6 Mikael Urankar freebsd_committer freebsd_triage 2016-04-03 09:27:05 UTC
The problem is here:
https://svn.filezilla-project.org/filezilla/FileZilla3/branches/3.16.x/src/engine/socket.cpp?revision=7372&view=markup#l247

to_utf8 doesn't seem to work correctly on FreeBSD (it comes from ftp/libfilezilla).

You can try, as a temporary workaround and until a correct fix is found, replace:
247 m_host = fz::to_utf8(m_pSocket->m_host);
248 if (m_host.empty()) {
249    return EINVAL;
250 }

to 
247 m_host = m_pSocket->m_host;

as seen in a previous revision of socket.cpp:
https://svn.filezilla-project.org/filezilla/FileZilla3/branches/3.16.x/src/engine/socket.cpp?r1=7296&r2=7304
Comment 7 Mikael Urankar freebsd_committer freebsd_triage 2016-04-03 10:53:28 UTC
so it fails here (libfilezilla-0.4.0.1/lib/string.h):
iconv_t cd = iconv_open("UTF-8", "WCHAR_T");

iconv_open returns EINVAL
Comment 8 Mikael Urankar freebsd_committer freebsd_triage 2016-04-03 11:05:46 UTC
Created attachment 168923 [details]
libfilezilla fix

Using iconv from ports instead of base fixes the problem, see attached patch for ftp/libfilezilla
Comment 9 Grzegorz Blach freebsd_committer freebsd_triage 2016-04-03 11:10:23 UTC
Comment on attachment 168923 [details]
libfilezilla fix

This patch works for me.
Comment 10 Jack 2016-04-04 03:47:05 UTC
Patch is working on 10.3 also
Comment 11 Dušan Vejnovič 2016-04-05 18:03:28 UTC
This patch works for me on 10.2.
Comment 12 martin.dieringer 2016-04-21 19:42:40 UTC
still not submitted?
Comment 13 commit-hook freebsd_committer freebsd_triage 2016-04-21 20:12:06 UTC
A commit references this bug:

Author: gblach
Date: Thu Apr 21 20:11:31 UTC 2016
New revision: 413755
URL: https://svnweb.freebsd.org/changeset/ports/413755

Log:
  Always link against iconv with wchar_t extension

  PR:		208121
  Submitted by:	mikael.urankar <at> gmail <dot> com
  Approved by:	maintainer timeout

Changes:
  head/ftp/libfilezilla/Makefile
Comment 14 Matthew Rezny freebsd_committer freebsd_triage 2016-04-22 09:25:25 UTC
I'm glad someone found a solution; I was blissfully unaware anyone else was working toward a solution until the fix was committed.

I noticed this problem the day after the 3.16.0 update PR was submitted and so held off on the 3.16.1 update in hopes of combining the fix with it even though the fix would have to be in libfilezilla (more PRs = more waiting). The cause of the problem was immediately obvious, but the correct (non-hack) solution was not. I had looked at the iconv section (6.23) of Porter's Handbook numerous times, but that makes no mention of wchar_t whatsoever. It is only in the list of USES flags and parameters (15.35) that the existence and purpose is mentioned in passing.

Sorry to everyone that had to wait due to poor documentation and a bug tracking system that can't send a readable notification. At this point I'm not going to bother with a 3.16.1 update (only a change of the version number in Makefile and refresh the distinfo), because 3.17.0 is close (RC1 was a week ago) and chances are the latter will be released before the former would get committed.

Thanks Mikael!
Comment 15 commit-hook freebsd_committer freebsd_triage 2016-04-24 13:51:15 UTC
A commit references this bug:

Author: pi
Date: Sun Apr 24 13:50:54 UTC 2016
New revision: 413941
URL: https://svnweb.freebsd.org/changeset/ports/413941

Log:
  ftp/libftpzilla: set USES=iconv:wchar_t after last commit

  PR:		208121
  Submitted by:	<matthew@reztek.cz> (maintainer), gblach

Changes:
  head/ftp/libfilezilla/Makefile
Comment 16 Piotr Kubaj freebsd_committer freebsd_triage 2016-06-03 07:27:11 UTC
Since this error happens too on 2016Q2, the fix should be MFH'd.