lxqt / libfm-qt

Core library of PCManFM-Qt (Qt binding for libfm)
https://lxqt-project.org
GNU Lesser General Public License v2.1
73 stars 51 forks source link

Random crash in file dialog #251

Closed tsujan closed 6 years ago

tsujan commented 6 years ago

I found this backtrace in /var/lib/systemd/coredump after the recent changes in lxqt-qtplugin + libfm-qt (although I don't see any relation yet):

#0  0x00007f93010b8388 in QtSharedPointer::ExternalRefCountData::getAndRef(QObject const*) ()
    at /usr/lib/libQt5Core.so.5
#1  0x00007f93012302f3 in  () at /usr/lib/libQt5Core.so.5
#2  0x00007f9301230474 in QTimer::singleShotImpl(int, Qt::TimerType, QObject const*, QtPrivate::QSlotObjectBase*) ()
    at /usr/lib/libQt5Core.so.5
#3  0x00007f92e29e391f in Fm::FileDialog::selectFilePathWithDelay(Fm::FilePath const&) () at /usr/lib/libfm-qt.so
#4  0x00007f9301223c50 in QMetaObject::activate(QObject*, int, int, void**) () at /usr/lib/libQt5Core.so.5
#5  0x00007f92e2988275 in Fm::Folder::onDirListFinished() () at /usr/lib/libfm-qt.so
#6  0x00007f93012243d2 in QObject::event(QEvent*) () at /usr/lib/libQt5Core.so.5
#7  0x00007f9302513a74 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/libQt5Widgets.so.5
#8  0x00007f930251b341 in QApplication::notify(QObject*, QEvent*) () at /usr/lib/libQt5Widgets.so.5
#9  0x00007f93011f9cb9 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/libQt5Core.so.5
#10 0x00007f93011fcd4c in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) ()
    at /usr/lib/libQt5Core.so.5
#11 0x00007f930124da54 in  () at /usr/lib/libQt5Core.so.5
#12 0x00007f92fd999368 in g_main_context_dispatch () at /usr/lib/libglib-2.0.so.0
#13 0x00007f92fd9995b1 in  () at /usr/lib/libglib-2.0.so.0
#14 0x00007f92fd99963e in g_main_context_iteration () at /usr/lib/libglib-2.0.so.0
#15 0x00007f930124d039 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
    at /usr/lib/libQt5Core.so.5
#16 0x00007f92f9768722 in  () at /usr/lib/libQt5XcbQpa.so.5
#17 0x00007f93011f894c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Core.so.5
#18 0x00007f9301200c46 in QCoreApplication::exec() () at /usr/lib/libQt5Core.so.5
#19 0x00005587fe285356 in  ()
#20 0x00007f930064e06b in __libc_start_main () at /usr/lib/libc.so.6
#21 0x00005587fe2871aa in  ()
tsujan commented 6 years ago

Back to this:

The crash was reproducible here but only randomly and only with frequent folder reloading. The backtrace was always the same and its meaning was obvious: the folder lambda connections needed this as their context. Once I added the context, I couldn't make it crash.

I didn't investigate why no context was needed before the recent changes to lxqt-qtplugin but there's no doubt that it's needed now. Will make a PR soon.