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

Extremely slow load times due to _q_fileSystemChanged #588

Open
BatchDrake opened this issue Oct 10, 2023 · 1 comment
Open

Extremely slow load times due to _q_fileSystemChanged #588

BatchDrake opened this issue Oct 10, 2023 · 1 comment

Comments

@BatchDrake
Copy link

I am using linuxdeployqt to deploy a Qt 6.2.0 application in a GitHub actions VM, that is later packed inside an AppImage file by means of appimagetool. Although the resulting AppImage opens the main window of my app almost immedately, it freezes for 3-4 seconds before repainting and being responsive. I am opening this issue here because it seems (though I am not completely sure) that this may be caused by linuxdeployqt, as moving the application binary outside the bundle (and setting LD_LIBRARY_PATH to my local install) seems to fix the issue. This behavior is not observed either if I build my application locally and run it directly from CMake's build directory (Qt version is 6.4 in this case).

After further inspection, it seems that certain Qt-specific slot _q_fileSystemChanged gets called, which enters into a very slow loop in the GUI thread that attempts to access all possible theme icons in my system (most of them do not exist). This is a typical call trace during this loop:

#0  __GI___access (file=0x5555556f0420 "/usr/local/share/icons/hicolor/96x96@2/categories/application-x-ms-dos-executable.svg", type=0) at ../sysdeps/unix/sysv/linux/access.c:27
#1  0x00007ffff68a8944 in ?? () from /tmp/.mount_TARSIS3scWGD/usr/lib/libQt6Core.so.6
#2  0x00007ffff66d2930 in QFileInfo::exists(QString const&) () from /tmp/.mount_TARSIS3scWGD/usr/lib/libQt6Core.so.6
#3  0x00007ffff6d7b39b in QIconLoader::findIconHelper(QString const&, QString const&, QList<QString>&) const () from /tmp/.mount_TARSIS3scWGD/usr/lib/libQt6Gui.so.6
#4  0x00007ffff6d7c1d1 in QIconLoader::findIconHelper(QString const&, QString const&, QList<QString>&) const () from /tmp/.mount_TARSIS3scWGD/usr/lib/libQt6Gui.so.6
#5  0x00007ffff6d7ca17 in QIconLoader::loadIcon(QString const&) const () from /tmp/.mount_TARSIS3scWGD/usr/lib/libQt6Gui.so.6
#6  0x00007ffff6d7cbec in ?? () from /tmp/.mount_TARSIS3scWGD/usr/lib/libQt6Gui.so.6
#7  0x00007ffff6d7cd68 in ?? () from /tmp/.mount_TARSIS3scWGD/usr/lib/libQt6Gui.so.6
#8  0x00007ffff6d71248 in QIcon::fromTheme(QString const&) () from /tmp/.mount_TARSIS3scWGD/usr/lib/libQt6Gui.so.6
#9  0x00007ffff72b3d28 in ?? () from /tmp/.mount_TARSIS3scWGD/usr/lib/libQt6Gui.so.6
#10 0x00007ffff72b3e0d in QGnomeTheme::fileIcon(QFileInfo const&, QFlags<QPlatformTheme::IconOption>) const () from /tmp/.mount_TARSIS3scWGD/usr/lib/libQt6Gui.so.6
#11 0x00007ffff6d65013 in QAbstractFileIconProviderPrivate::getPlatformThemeIcon(QFileInfo const&) const () from /tmp/.mount_TARSIS3scWGD/usr/lib/libQt6Gui.so.6
#12 0x00007ffff76e49b8 in QFileIconProvider::icon(QFileInfo const&) const () from /tmp/.mount_TARSIS3scWGD/usr/lib/libQt6Widgets.so.6
#13 0x00007ffff723b446 in QFileInfoGatherer::getInfo(QFileInfo const&) const () from /tmp/.mount_TARSIS3scWGD/usr/lib/libQt6Gui.so.6
#14 0x00007ffff72472a8 in QFileSystemModelPrivate::_q_fileSystemChanged(QString const&, QList<std::pair<QString, QFileInfo> > const&) () from /tmp/.mount_TARSIS3scWGD/usr/lib/libQt6Gui.so.6
#15 0x00007ffff6787e3f in QObject::event(QEvent*) () from /tmp/.mount_TARSIS3scWGD/usr/lib/libQt6Core.so.6
#16 0x00007ffff76e5e32 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /tmp/.mount_TARSIS3scWGD/usr/lib/libQt6Widgets.so.6
#17 0x00007ffff673cd1a in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /tmp/.mount_TARSIS3scWGD/usr/lib/libQt6Core.so.6
#18 0x00007ffff673faac in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /tmp/.mount_TARSIS3scWGD/usr/lib/libQt6Core.so.6
#19 0x00007ffff6992193 in ?? () from /tmp/.mount_TARSIS3scWGD/usr/lib/libQt6Core.so.6
#20 0x00007ffff5c4a17d in g_main_context_dispatch () from /tmp/.mount_TARSIS3scWGD/usr/lib/libglib-2.0.so.0
#21 0x00007ffff5c4a400 in ?? () from /tmp/.mount_TARSIS3scWGD/usr/lib/libglib-2.0.so.0
#22 0x00007ffff5c4a4a3 in g_main_context_iteration () from /tmp/.mount_TARSIS3scWGD/usr/lib/libglib-2.0.so.0
#23 0x00007ffff6991b19 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /tmp/.mount_TARSIS3scWGD/usr/lib/libQt6Core.so.6
#24 0x00007ffff674870b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /tmp/.mount_TARSIS3scWGD/usr/lib/libQt6Core.so.6
#25 0x00007ffff674441b in QCoreApplication::exec() () from /tmp/.mount_TARSIS3scWGD/usr/lib/libQt6Core.so.6
--Type <RET> for more, q to quit, c to continue without paging--
#26 0x0000555555574c3b in main (argc=1, argv=0x7fffffffde38) at /home/runner/work/TARSIS-ETC/TARSIS-ETC/CalGUI/main.cpp:15

I attempted to add -extra-plugins=iconengines hoping that there was some missing file somewhere, but this had no effect (apart from making the AppImage bigger). Adding platformthemes/libqgtk also makes the AppImage crash, as it fails to recognize a valid .png file of my current icon theme as such.

Thanks in advance,

@probonopd
Copy link
Owner

Interesting. Keep in mind that linuxdeployqt is not officially supporting Qt6, only Qt5 at this time.

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

2 participants