Unstable dolphin in Plasma 5

I'm using Qt 5.6.1 and Plasma 5 5.7.3. Dolphin is rather unstable: it can only run for minutes before it crashes.
After tracing, I found that I need to patch qt5-core and qt5-network to make it stable.
Basically, the problem is that dolphin opens too many files (>2k) and at the same time uses FD_SET() / select().
A large fd passed into FD_SET() leads to out-of-bound access, modifies the stack, and crashes dolphin.
There are 2 places which are relevant in Qt. One in src/corelib/io/qprocess_unix.cpp, another in src/network/socket/qnativesocketengine_unix.cpp. As a workaround, setting FD_SETSIZE to a large number like 16384 allows dolphin to be much more stable and usable.
I guess that the large number of open file descriptors comes from libinotify. It uses kqueue() to simulate inotify(), and the downside is that it opens all the files in the directories being monitored.
Anyone else has similar problems? Do you have a stable dolphin which does not crash?
 
At first glance, that seems like possibly unreasonable behaviour from it. Does it have a good reason for trying to actively monitor so many files? It might be worth asking in Dolphin's own forum if there's any alternative behaviour or a way to reduce that down to a more reasonable level.
 
It seems to be closely related to the Folders panel at left. When I expand a folder in the left, the number of open files increases, and it decreases when I collapse it. It seems to be opening every file and folder in the folders listed in the left panel.
 
I remember having this problem in several KDE installations. Revisiting the settings and turning off any preview and preloading options always fixed this for me.
 
Back
Top