Filezilla not starting after funtion local_filesys::begin_find_files

Need help with FileZilla Client? Something does not work as expected? In this forum you may find an answer.

Moderator: Project members

Post Reply
Message
Author
t1mb0
500 Command not understood
Posts: 4
Joined: 2021-09-21 10:31

Filezilla not starting after funtion local_filesys::begin_find_files

#1 Post by t1mb0 » 2021-09-21 10:49

Hello Dear Support Team,

I hit an issue, on a server with multiple user HOME directories, that are located on auto-mounting NFS storage,
after starting the binary and debugging with "strace" and "gdb", it shows a function "local_filesys::begin_find_files",
when the Filezilla start walking through the entire FS including the thousands of user directories, and after that it just hangs.
Is is possible to avoid the full filesystem scan after starting the Filezilla Client on Linux?

Some short logs:

Code: Select all

#0  0x00007ffff3887810 in __openat_nocancel () from /lib64/libc.so.6
#1  0x00007ffff3858d75 in __opendirat () from /lib64/libc.so.6
#2  0x00007ffff7f0359c in fz::local_filesys::begin_find_files (this=this@entry=0x7fffffffcd20, path=..., dirs_only=dirs_only@entry=true, query_symlink_targets=query_symlink_targets@entry=true) at local_filesys.cpp:409
#3  0x0000000000564489 in CLocalTreeView::HasSubdir (this=<optimized out>, dirname=...) at LocalTreeView.cpp:548
#4  0x0000000000564d1c in CLocalTreeView::CheckSubdirStatus (this=0xe04230, item=..., path=...) at LocalTreeView.cpp:1502
#5  0x000000000056531f in CLocalTreeView::DisplayDir (this=0xe04230, parent=..., dirname=..., knownSubdir=...) at LocalTreeView.cpp:522
#6  0x00000000005658a1 in CLocalTreeView::MakeSubdirs (this=0xe04230, parent=..., dirname=..., subDir=...) at LocalTreeView.cpp:594
#7  0x00000000005692a5 in CLocalTreeView::SetDir (this=0xe04230, localDir=...) at LocalTreeView.cpp:326
#8  0x0000000000569b1f in CLocalTreeView::OnStateChange (this=0xe04230, notification=<optimized out>) at LocalTreeView.cpp:912
#9  0x00000000006c4d40 in CState::NotifyHandlers (this=this@entry=0xdfc020, notification=notification@entry=STATECHANGE_LOCAL_DIR, data=..., data2=data2@entry=0x0) at state.cpp:694
#10 0x00000000006c7af3 in CState::SetLocalDir (this=0xdfc020, dir=..., error=<optimized out>, rememberPreviousSubdir=<optimized out>) at /opt/rh/devtoolset-9/root/usr/include/c++/9/ext/new_allocator.h:89
#11 0x00000000006c80f3 in CState::SetLocalDir (this=this@entry=0xdfc020, dir=..., error=error@entry=0x0, rememberPreviousSubdir=rememberPreviousSubdir@entry=true) at state.cpp:271
#12 0x00000000004cd6b4 in CContextControl::CreateTab (this=0x934df0, localPath=..., site=..., remotePath=...) at context_control.cpp:137
#13 0x00000000004cdce7 in CContextControl::CreateTab (this=0x934df0) at context_control.cpp:74
#14 0x00000000004ce6c8 in CContextControl::RestoreTabs (this=0x934df0) at context_control.cpp:767
#15 0x00000000005846b9 in CMainFrame::CMainFrame (this=0xba5ac0) at Mainfrm.cpp:454
#16 0x0000000000504ed4 in CFileZillaApp::OnInit (this=0x8931c0) at FileZilla.cpp:267
#17 0x00007ffff6c312e2 in wxEntry(int&, wchar_t**) () from /opt/filezilla/3.55.1/filezilla/lib/libwx_baseu-3.0.so.0
#18 0x000000000048bf4e in main (argc=<optimized out>, argv=0x7fffffffdc28) at locale_initializer.cpp:96

Code: Select all

ewfstatat(8, "root", {st_mode=S_IFDIR|0550, st_size=4096, ...}, AT_SYMLINK_NOFOLLOW) = 0
openat(AT_FDCWD, "/root", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 9
getdents(9, /* 26 entries */, 32768)    = 872
newfstatat(9, ".pki", {st_mode=S_IFDIR|0740, st_size=19, ...}, AT_SYMLINK_NOFOLLOW) = 0
close(9)                                = 0
newfstatat(8, "var", {st_mode=S_IFDIR|0755, st_size=267, ...}, AT_SYMLINK_NOFOLLOW) = 0
openat(AT_FDCWD, "/var", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 9
getdents(9, /* 23 entries */, 32768)    = 632
newfstatat(9, "tmp", {st_mode=S_IFDIR|S_ISVTX|0777, st_size=136, ...}, AT_SYMLINK_NOFOLLOW) = 0
close(9)                                = 0
newfstatat(8, "tmp", {st_mode=S_IFDIR|S_ISVTX|0777, st_size=221, ...}, AT_SYMLINK_NOFOLLOW) = 0
openat(AT_FDCWD, "/tmp", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 9
getdents(9, /* 9 entries */, 32768)     = 368
newfstatat(9, ".Test-unix", {st_mode=S_IFDIR|S_ISVTX|0777, st_size=6, ...}, AT_SYMLINK_NOFOLLOW) = 0
close(9)                                = 0
newfstatat(8, "usr", {st_mode=S_IFDIR|0755, st_size=155, ...}, AT_SYMLINK_NOFOLLOW) = 0
openat(AT_FDCWD, "/usr", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 9
getdents(9, /* 14 entries */, 32768)    = 384
newfstatat(9, "bin", {st_mode=S_IFDIR|0555, st_size=32768, ...}, AT_SYMLINK_NOFOLLOW) = 0
close(9)                                = 0
newfstatat(8, "bin", {st_mode=S_IFLNK|0777, st_size=7, ...}, AT_SYMLINK_NOFOLLOW) = 0
newfstatat(8, "bin", {st_mode=S_IFDIR|0555, st_size=32768, ...}, 0) = 0
openat(AT_FDCWD, "/bin", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 9
getdents(9, /* 1035 entries */, 32768)  = 32744
newfstatat(9, "bashbug", {st_mode=S_IFLNK|0777, st_size=10, ...}, AT_SYMLINK_NOFOLLOW) = 0
newfstatat(9, "bashbug", {st_mode=S_IFREG|0755, st_size=6964, ...}, 0) = 0
newfstatat(9, "lastb", {st_mode=S_IFLNK|0777, st_size=4, ...}, AT_SYMLINK_NOFOLLOW) = 0
newfstatat(9, "lastb", {st_mode=S_IFREG|0755, st_size=19568, ...}, 0) = 0
newfstatat(9, "sh", {st_mode=S_IFLNK|0777, st_size=4, ...}, AT_SYMLINK_NOFOLLOW) = 0
newfstatat(9, "sh", {st_mode=S_IFREG|0755, st_size=964536, ...}, 0) = 0
newfstatat(9, "geqn", {st_mode=S_IFLNK|0777, st_size=3, ...}, AT_SYMLINK_NOFOLLOW) = 0
newfstatat(9, "geqn", {st_mode=S_IFREG|0755, st_size=147880, ...}, 0) = 0
newfstatat(9, "ex", {st_mode=S_IFLNK|0777, st_size=2, ...}, AT_SYMLINK_NOFOLLOW) = 0
newfstatat(9, "ex", {st_mode=S_IFREG|0755, st_size=928200, ...}, 0) = 0
newfstatat(9, "domainname", {st_mode=S_IFLNK|0777, st_size=8, ...}, AT_SYMLINK_NOFOLLOW) = 0
newfstatat(9, "domainname", {st_mode=S_IFREG|0755, st_size=15784, ...}, 0) = 0
newfstatat(9, "gneqn", {st_mode=S_IFLNK|0777, st_size=4, ...}, AT_SYMLINK_NOFOLLOW) = 0
newfstatat(9, "gneqn", {st_mode=S_IFREG|0755, st_size=271, ...}, 0) = 0
newfstatat(9, "gnroff", {st_mode=S_IFLNK|0777, st_size=5, ...}, AT_SYMLINK_NOFOLLOW) = 0
newfstatat(9, "gnroff", {st_mode=S_IFREG|0755, st_size=3392, ...}, 0) = 0
newfstatat(9, "gpic", {st_mode=S_IFLNK|0777, st_size=3, ...}, AT_SYMLINK_NOFOLLOW) = 0
newfstatat(9, "gpic", {st_mode=S_IFREG|0755, st_size=184736, ...}, 0) = 0
newfstatat(9, "rvi", {st_mode=S_IFLNK|0777, st_size=2, ...}, AT_SYMLINK_NOFOLLOW) = 0
newfstatat(9, "rvi", {st_mode=S_IFREG|0755, st_size=928200, ...}, 0) = 0
newfstatat(9, "awk", {st_mode=S_IFLNK|0777, st_size=4, ...}, AT_SYMLINK_NOFOLLOW) = 0

User avatar
botg
Site Admin
Posts: 35492
Joined: 2004-02-23 20:49
First name: Tim
Last name: Kosse

Re: Filezilla not starting after funtion local_filesys::begin_find_files

#2 Post by botg » 2021-09-21 13:47

For correct display of the local directory tree, the currently active directory as well as its parents need to be accessed, as well as any other expanded items. Unexpanded items too need to be accessed to determine whether to display the expand button.

There is a problem with your system if it just hangs, that's but a bug in FileZilla.

t1mb0
500 Command not understood
Posts: 4
Joined: 2021-09-21 10:31

Re: Filezilla not starting after funtion local_filesys::begin_find_files

#3 Post by t1mb0 » 2021-09-21 14:40

The issue itself is that, some of the users are having inaccessible storage paths, which lags the software, making it unresponsive.
And indeed it is a specific enterprise configuration (not blaming anyone).
In this sense, can we just strict the search to a selected directory, not recursively browsing everywhere,
or just listing the top level of the / (root fs) only?

I've found the issue line inside:

libfilezilla-0.32.0/lib/local_filesys.cpp +409
--------
dir_ = opendir(path.c_str());
--------

and replaced that to:
--------
dir_ = opendir(".");
--------

I know it is not a smart solution (since i am not a CPP developer),
but it is a temporary workaround for me anyway.

Maybe you will suggest better one.

Thanks :)

User avatar
botg
Site Admin
Posts: 35492
Joined: 2004-02-23 20:49
First name: Tim
Last name: Kosse

Re: Filezilla not starting after funtion local_filesys::begin_find_files

#4 Post by botg » 2021-09-21 16:33

Your proposed change breaks everything, I'm surprised FileZilla even starts with it. Don't use it.

One option you could try us to short-circuit CLocalTreeView::HasSubdir and have it always return true.

t1mb0
500 Command not understood
Posts: 4
Joined: 2021-09-21 10:31

Re: Filezilla not starting after funtion local_filesys::begin_find_files

#5 Post by t1mb0 » 2021-09-23 06:06

Yes it is sort of destructive, but i wanted to break the deep search (scanning the whole root FS). :/
I don't think it is a good idea overall, to walk through everything since you're usually going to a certain directory.
For a bunch of filesystems and NFS shares it is a serious problem. And i believe, that this function should be optimized for sure!

Anyways, in which line of the file "src/interface/LocalTreeView.cpp" i suppose to set this option "CLocalTreeView::HasSubdir" ??

Thanks.

User avatar
botg
Site Admin
Posts: 35492
Joined: 2004-02-23 20:49
First name: Tim
Last name: Kosse

Re: Filezilla not starting after funtion local_filesys::begin_find_files

#6 Post by botg » 2021-09-23 09:20

FileZilla doesn't scan the entire filesystem on start. As I said before, for correct display of the local directory tree, the currently active directory as well as its parents need to be accessed, as well as any other expanded items. Unexpanded items too need to be accessed to determine whether to display the expand button.

t1mb0
500 Command not understood
Posts: 4
Joined: 2021-09-21 10:31

Re: Filezilla not starting after funtion local_filesys::begin_find_files

#7 Post by t1mb0 » 2021-09-23 10:01

If not scanning, then how all of that (in strace) can be explained?:

Code: Select all

openat(AT_FDCWD, "/home", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 16
getdents(16, /* 1029 entries */, 32768) = 32768
newfstatat(16, "nambugah", {st_mode=S_IFDIR|0555, st_size=0, ...}, AT_SYMLINK_NOFOLLOW) = 0
openat(AT_FDCWD, "/home/nam...", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 17
brk(NULL)                               = 0x2d10000
brk(0x2d33000)                          = 0x2d33000
close(17)                               = 0
newfstatat(16, "iotonche", {st_mode=S_IFDIR|0555, st_size=0, ...}, AT_SYMLINK_NOFOLLOW) = 0
openat(AT_FDCWD, "/home/iot...", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 17
close(17)                               = 0
newfstatat(16, "alcoelho", {st_mode=S_IFDIR|0555, st_size=0, ...}, AT_SYMLINK_NOFOLLOW) = 0
openat(AT_FDCWD, "/home/alc...", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 17
close(17)                               = 0
newfstatat(16, "krlehaen", {st_mode=S_IFDIR|0555, st_size=0, ...}, AT_SYMLINK_NOFOLLOW) = 0
openat(AT_FDCWD, "/home/krl...", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 17
close(17)                               = 0
newfstatat(16, "gscalora", {st_mode=S_IFDIR|0555, st_size=0, ...}, AT_SYMLINK_NOFOLLOW) = 0
openat(AT_FDCWD, "/home/gsc...", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 17
close(17)                               = 0
newfstatat(16, "weifu", {st_mode=S_IFDIR|0555, st_size=0, ...}, AT_SYMLINK_NOFOLLOW) = 0
openat(AT_FDCWD, "/home/wei...", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 17
close(17)                               = 0
newfstatat(16, "ksvrdlan", {st_mode=S_IFDIR|0555, st_size=0, ...}, AT_SYMLINK_NOFOLLOW) = 0
openat(AT_FDCWD, "/home/ksv...", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 17
close(17)                               = 0
newfstatat(16, "janeck", {st_mode=S_IFDIR|0555, st_size=0, ...}, AT_SYMLINK_NOFOLLOW) = 0
openat(AT_FDCWD, "/home/jan...", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 17
close(17)                               = 0
newfstatat(16, "aichim", {st_mode=S_IFDIR|0555, st_size=0, ...}, AT_SYMLINK_NOFOLLOW) = 0
openat(AT_FDCWD, "/home/aic...", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = -1 EACCES (Permission denied)
newfstatat(16, "rkumari", {st_mode=S_IFDIR|0555, st_size=0, ...}, AT_SYMLINK_NOFOLLOW) = 0
openat(AT_FDCWD, "/home/rku...", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = -1 EACCES (Permission denied)
newfstatat(16, "mintran", {st_mode=S_IFDIR|0555, st_size=0, ...}, AT_SYMLINK_NOFOLLOW) = 0
openat(AT_FDCWD, "/home/min...", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 17
close(17)                               = 0
....
What the function "local_filesys::begin_find_files" does in the home directories, to the other users?
Also, during that scan, the GUI doesn't run at all...

User avatar
botg
Site Admin
Posts: 35492
Joined: 2004-02-23 20:49
First name: Tim
Last name: Kosse

Re: Filezilla not starting after funtion local_filesys::begin_find_files

#8 Post by botg » 2021-09-24 08:12

Third time's a charm: For correct display of the local directory tree, the currently active directory as well as its parents need to be accessed, as well as any other expanded items. Unexpanded items too need to be accessed to determine whether to display the expand button.

Post Reply