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

Crashes when using "Open..." #28

Closed
nurupo opened this issue Apr 18, 2020 · 6 comments
Closed

Crashes when using "Open..." #28

nurupo opened this issue Apr 18, 2020 · 6 comments

Comments

@nurupo
Copy link

nurupo commented Apr 18, 2020

When opening k4dirstat from applications menu and clicking on "Open...", an empty file picker dialog window appears and k4dirstat crashes.

k4dirstat_crash

(Black bars is me censoring things).

Stacktrace indicates that the crash happens in QStandardItemModel::itemFromIndex

Application: k4dirstat (k4dirstat), signal: Segmentation fault
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[Current thread is 1 (Thread 0x7f53fc9fc000 (LWP 19937))]

Thread 7 (Thread 0x7f53e7fff700 (LWP 19943)):
#0  futex_wait_cancelable (private=0, expected=0, futex_word=0x5650fee8c0c8) at ../sysdeps/unix/sysv/linux/futex-internal.h:80
#1  __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x5650fee8c078, cond=0x5650fee8c0a0) at pthread_cond_wait.c:508
#2  __pthread_cond_wait (cond=0x5650fee8c0a0, mutex=0x5650fee8c078) at pthread_cond_wait.c:638
#3  0x00007f53f26519fb in ?? () from /usr/lib/x86_64-linux-gnu/dri/i965_dri.so
#4  0x00007f53f2651617 in ?? () from /usr/lib/x86_64-linux-gnu/dri/i965_dri.so
#5  0x00007f53ff951f27 in start_thread (arg=<optimized out>) at pthread_create.c:479
#6  0x00007f540016d2ef in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 6 (Thread 0x7f53f0da0700 (LWP 19942)):
#0  futex_wait_cancelable (private=0, expected=0, futex_word=0x5650fee8c0c8) at ../sysdeps/unix/sysv/linux/futex-internal.h:80
#1  __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x5650fee8c078, cond=0x5650fee8c0a0) at pthread_cond_wait.c:508
#2  __pthread_cond_wait (cond=0x5650fee8c0a0, mutex=0x5650fee8c078) at pthread_cond_wait.c:638
#3  0x00007f53f26519fb in ?? () from /usr/lib/x86_64-linux-gnu/dri/i965_dri.so
#4  0x00007f53f2651617 in ?? () from /usr/lib/x86_64-linux-gnu/dri/i965_dri.so
#5  0x00007f53ff951f27 in start_thread (arg=<optimized out>) at pthread_create.c:479
#6  0x00007f540016d2ef in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 5 (Thread 0x7f53f15a1700 (LWP 19941)):
#0  futex_wait_cancelable (private=0, expected=0, futex_word=0x5650fee8c0c8) at ../sysdeps/unix/sysv/linux/futex-internal.h:80
#1  __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x5650fee8c078, cond=0x5650fee8c0a0) at pthread_cond_wait.c:508
#2  __pthread_cond_wait (cond=0x5650fee8c0a0, mutex=0x5650fee8c078) at pthread_cond_wait.c:638
#3  0x00007f53f26519fb in ?? () from /usr/lib/x86_64-linux-gnu/dri/i965_dri.so
#4  0x00007f53f2651617 in ?? () from /usr/lib/x86_64-linux-gnu/dri/i965_dri.so
#5  0x00007f53ff951f27 in start_thread (arg=<optimized out>) at pthread_create.c:479
#6  0x00007f540016d2ef in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 4 (Thread 0x7f53f1da2700 (LWP 19940)):
#0  futex_wait_cancelable (private=0, expected=0, futex_word=0x5650fee8c0c8) at ../sysdeps/unix/sysv/linux/futex-internal.h:80
#1  __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x5650fee8c078, cond=0x5650fee8c0a0) at pthread_cond_wait.c:508
#2  __pthread_cond_wait (cond=0x5650fee8c0a0, mutex=0x5650fee8c078) at pthread_cond_wait.c:638
#3  0x00007f53f26519fb in ?? () from /usr/lib/x86_64-linux-gnu/dri/i965_dri.so
#4  0x00007f53f2651617 in ?? () from /usr/lib/x86_64-linux-gnu/dri/i965_dri.so
#5  0x00007f53ff951f27 in start_thread (arg=<optimized out>) at pthread_create.c:479
#6  0x00007f540016d2ef in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 3 (Thread 0x7f53f9ae6700 (LWP 19939)):
#0  0x00007f5400162b4f in __GI___poll (fds=0x7f53ec01f260, nfds=1, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
#1  0x00007f53ff1487fe in ?? () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007f53ff14891f in g_main_context_iteration () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007f54008177db in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#4  0x00007f54007c06db in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#5  0x00007f54006016f1 in QThread::exec() () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#6  0x00007f53ffbbc4e6 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5DBus.so.5
#7  0x00007f5400602872 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#8  0x00007f53ff951f27 in start_thread (arg=<optimized out>) at pthread_create.c:479
#9  0x00007f540016d2ef in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 2 (Thread 0x7f53fb9e0700 (LWP 19938)):
#0  0x00007f5400162b4f in __GI___poll (fds=0x7f53fb9dfca8, nfds=1, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
#1  0x00007f53fef24d02 in ?? () from /usr/lib/x86_64-linux-gnu/libxcb.so.1
#2  0x00007f53fef2698a in xcb_wait_for_event () from /usr/lib/x86_64-linux-gnu/libxcb.so.1
#3  0x00007f53fc5caca0 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5XcbQpa.so.5
#4  0x00007f5400602872 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#5  0x00007f53ff951f27 in start_thread (arg=<optimized out>) at pthread_create.c:479
#6  0x00007f540016d2ef in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 1 (Thread 0x7f53fc9fc000 (LWP 19937)):
[KCrash Handler]
#6  0x00007f5400f3ff1c in QStandardItemModel::itemFromIndex(QModelIndex const&) const () from /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
#7  0x00005650fd54e9d7 in KDirSortFilterProxyModel::lessThan(QModelIndex const&, QModelIndex const&) const ()
#8  0x00007f54007a5047 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#9  0x00007f54007a5261 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#10 0x00007f54007a7a80 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#11 0x00007f5400797bba in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#12 0x00007f540079c6df in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#13 0x00007f540079fcf6 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#14 0x00007f54007a08e3 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#15 0x00007f54007ec388 in QMetaObject::activate(QObject*, int, int, void**) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#16 0x00007f540076f5de in QAbstractItemModel::rowsInserted(QModelIndex const&, int, int, QAbstractItemModel::QPrivateSignal) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#17 0x00007f5400777d84 in QAbstractItemModel::endInsertRows() () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#18 0x00007f5401d82a2c in ?? () from /usr/lib/x86_64-linux-gnu/libKF5KIOWidgets.so.5
#19 0x00007f54007ec4e8 in QMetaObject::activate(QObject*, int, int, void**) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#20 0x00007f5401b952ba in KCoreDirLister::itemsAdded(QUrl const&, KFileItemList const&) () from /usr/lib/x86_64-linux-gnu/libKF5KIOCore.so.5
#21 0x00007f5401b97bc3 in ?? () from /usr/lib/x86_64-linux-gnu/libKF5KIOCore.so.5
#22 0x00007f5401baa367 in ?? () from /usr/lib/x86_64-linux-gnu/libKF5KIOCore.so.5
#23 0x00007f54007ec4e8 in QMetaObject::activate(QObject*, int, int, void**) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#24 0x00007f5401b41fa4 in KIO::ListJob::entries(KIO::Job*, QList<KIO::UDSEntry> const&) () from /usr/lib/x86_64-linux-gnu/libKF5KIOCore.so.5
#25 0x00007f5401b438d2 in ?? () from /usr/lib/x86_64-linux-gnu/libKF5KIOCore.so.5
#26 0x00007f54007ec4e8 in QMetaObject::activate(QObject*, int, int, void**) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#27 0x00007f5401b18c55 in KIO::SlaveInterface::listEntries(QList<KIO::UDSEntry> const&) () from /usr/lib/x86_64-linux-gnu/libKF5KIOCore.so.5
#28 0x00007f5401b1b176 in KIO::SlaveInterface::dispatch(int, QByteArray const&) () from /usr/lib/x86_64-linux-gnu/libKF5KIOCore.so.5
#29 0x00007f5401b192fb in KIO::SlaveInterface::dispatch() () from /usr/lib/x86_64-linux-gnu/libKF5KIOCore.so.5
#30 0x00007f5401b22eaa in KIO::Slave::gotInput() () from /usr/lib/x86_64-linux-gnu/libKF5KIOCore.so.5
#31 0x00007f54007ec4e8 in QMetaObject::activate(QObject*, int, int, void**) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#32 0x00007f5401a9d64e in ?? () from /usr/lib/x86_64-linux-gnu/libKF5KIOCore.so.5
#33 0x00007f54007ecdaa in QObject::event(QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#34 0x00007f54011bcc32 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#35 0x00007f54011c6190 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#36 0x00007f54007c1a52 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#37 0x00007f54007c4648 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#38 0x00007f5400818183 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#39 0x00007f53ff14860d in g_main_context_dispatch () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#40 0x00007f53ff148890 in ?? () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#41 0x00007f53ff14891f in g_main_context_iteration () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#42 0x00007f54008177c1 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#43 0x00007f54007c06db in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#44 0x00007f54013b9e9d in QDialog::exec() () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#45 0x00007f54013b9d9d in QDialog::exec() () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#46 0x00007f54013cd986 in QFileDialog::getExistingDirectoryUrl(QWidget*, QString const&, QUrl const&, QFlags<QFileDialog::Option>, QStringList const&) () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#47 0x00005650fd53e298 in k4dirstat::fileAskOpenDir() ()
#48 0x00007f54007ec388 in QMetaObject::activate(QObject*, int, int, void**) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#49 0x00007f54011b6812 in QAction::triggered(bool) () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#50 0x00007f54011b8e52 in QAction::activate(QAction::ActionEvent) () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#51 0x00007f54012b080c in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#52 0x00007f54012b0a35 in QAbstractButton::mouseReleaseEvent(QMouseEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#53 0x00007f540139ff0a in QToolButton::mouseReleaseEvent(QMouseEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#54 0x00007f54011fe776 in QWidget::event(QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#55 0x00007f540139ffb4 in QToolButton::event(QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#56 0x00007f54011bcc32 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#57 0x00007f54011c63e3 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#58 0x00007f54007c1a52 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#59 0x00007f54011c54f3 in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool, bool) () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#60 0x00007f540121a039 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#61 0x00007f540121cec4 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#62 0x00007f54011bcc32 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#63 0x00007f54011c6190 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#64 0x00007f54007c1a52 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#65 0x00007f5400ba0a13 in QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
#66 0x00007f5400ba226b in QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
#67 0x00007f5400b7cecb in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
#68 0x00007f53fc5cbcda in ?? () from /usr/lib/x86_64-linux-gnu/libQt5XcbQpa.so.5
#69 0x00007f53ff14860d in g_main_context_dispatch () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#70 0x00007f53ff148890 in ?? () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#71 0x00007f53ff14891f in g_main_context_iteration () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#72 0x00007f54008177c1 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#73 0x00007f54007c06db in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#74 0x00007f54007c8182 in QCoreApplication::exec() () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#75 0x00005650fd536822 in main ()
[Inferior 1 (process 19937) detached]

When running from console with no arguments k4dirstat opens the dialog window right away, crashing right away, printing the following to the console:

$ k4dirstat
No exclude rules defined 

kf5.kio.core: "Could not enter folder tags:/."
KCrash: crashing... crashRecursionCounter = 2
KCrash: Application Name = k4dirstat path = /usr/bin pid = 19581
KCrash: Arguments: /usr/bin/k4dirstat 
KCrash: Attempting to start /usr/lib/x86_64-linux-gnu/libexec/drkonqi from kdeinit
sock_file=/run/user/1000/kdeinit5__0

[1]+  Stopped                 k4dirstat

However, it works as expected, without crashes, if you run it from console and specify a path as an argument. Of course, clicking on "Open..." to invoke the dialog window makes it crash again, but at least that's some workaround.

That's k4dirstat 3.2.0 as packaged in Debian Testing, using with KDE Plasma as DE, if that matters as far as file picker dialog windows go.

No other application crashes when opening a file picker dialog window, e.g. Kate's "Open..." works just fine.

@jeromerobert
Copy link
Owner

So far I'm not able to reproduce that bug. I guess it's related to a particular KIO slave that I don't have. Do you have something like a gdrive mount ?

@jeromerobert
Copy link
Owner

jeromerobert commented Apr 19, 2020

Could you tell me the protocols used by the remotes hidden under your black bars ?

@nurupo
Copy link
Author

nurupo commented Apr 19, 2020

Remote: one is the standard remote:/ that Plasma adds by default, another is a sftp:// into another machine. It also misses all my hard drives from Devices section but somehow has reserved space for them, showing only KDE Connect'ed phone, which I blackbarred, under all that reserved space.

k4dirstat 3.1.4 used to work without crashes.

@nurupo
Copy link
Author

nurupo commented Apr 19, 2020

Looks like this is where the dialog gets created:

k4dirstat/src/k4dirstat.cpp

Lines 413 to 414 in e4d350d

QUrl url =
QFileDialog::getExistingDirectoryUrl(this, i18n("Open Directory..."));

So I tried to replicate it, made a small Qt app:

#include <QApplication>
#include <QDebug>
#include <QFileDialog>
#include <QObject>
#include <QPushButton>

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    QPushButton button("Open...");
    QObject::connect(&button, &QPushButton::clicked, [&](){
        qDebug() << QFileDialog::getExistingDirectoryUrl(&button);
    });
    button.show();
    return a.exec();
}

yet it works just fine, without crashes, and prints the QUrl to console. It also shows all my hard drives.

qfiledialog_test

@nurupo
Copy link
Author

nurupo commented Apr 19, 2020

This PR sounds like my issue #27.

@nurupo
Copy link
Author

nurupo commented May 2, 2020

Didn't notice that the PR got merged, new release created and the package updated on Debian.

Just checked the 3.2.1 version and it no longer crashes! Thank you @jpalecek and @jeromerobert!

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