Bug 392033

Summary: SIGABORT opening file dialogue to add second include directory path [crash in concatPaths]
Product: [Frameworks and Libraries] frameworks-kio Reporter: redmaw
Component: generalAssignee: KIO Bugs <kio-bugs-null>
Status: CONFIRMED ---    
Severity: normal CC: kde, kdelibs-bugs-null
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description redmaw 2018-03-19 01:15:37 UTC
When trying to add multiple include paths at the same time, after adding one path opening the file dialogue again causes an abort. Nothing immediately goes wrong if I just select one path and continue.

Steps taken:
1. Project->Open Configuration
2. Select Language Support tab
3. Open file dialogue (on includes/imports tab)
4. Select directory and click "open"
> I selected <project root>/includes here.
5. Click the '+' button to add the path
6. Open file dialogue again.

Project/Source files: LLVM (revision 316824)
KDevelop version: Built with kdesrc-build on an Arch system last updated 2018-3-18.

#0  0x00007fffedff2860 in raise () at /usr/lib/libc.so.6
#1  0x00007fffedff3ec9 in abort () at /usr/lib/libc.so.6
#2  0x00007fffeecf88e8 in  () at /usr/lib/libQt5Core.so.5
#3  0x00007fffeecf34c7 in  () at /usr/lib/libQt5Core.so.5
#4  0x00007fffed3350d7 in concatPaths(QString const&, QString const&) (path1=..., path2=...) at /home//kde/src/frameworks/kio/src/filewidgets/../pathhelpers_p.h:31
#5  0x00007fffed35204c in KFileWidgetPrivate::_k_slotLoadingFinished() (this=0x7ffe18008fc0) at /home//kde/src/frameworks/kio/src/filewidgets/kfilewidget.cpp:1600
#6  0x00007fffed35941a in KFileWidget::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (_o=0x55555a406330, _c=QMetaObject::InvokeMetaMethod, _id=16, _a=0x7fffffffc2e0)
    at /home//kde/src/build/frameworks/kio/src/filewidgets/KF5KIOFileWidgets_autogen/include/moc_kfilewidget.cpp:183
#7  0x00007fffeef2c6c6 in QMetaObject::activate(QObject*, int, int, void**) () at /usr/lib/libQt5Core.so.5
#8  0x00007fffed333ac5 in KDirOperator::finishedLoading() (this=0x555560656760) at /home//kde/src/build/frameworks/kio/src/filewidgets/KF5KIOFileWidgets_autogen/include/moc_kdiroperator.cpp:622
#9  0x00007fffed330b5e in KDirOperator::Private::_k_slotIOFinished() (this=0x555558ea1200) at /home//kde/src/frameworks/kio/src/filewidgets/kdiroperator.cpp:2291
#10 0x00007fffed332f86 in KDirOperator::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (_o=0x555560656760, _c=QMetaObject::InvokeMetaMethod, _id=56, _a=0x7fffffffc510)
    at /home//kde/src/build/frameworks/kio/src/filewidgets/KF5KIOFileWidgets_autogen/include/moc_kdiroperator.cpp:400
#11 0x00007fffeef2c6c6 in QMetaObject::activate(QObject*, int, int, void**) () at /usr/lib/libQt5Core.so.5
#12 0x00007ffff21b90f3 in KCoreDirLister::completed() (this=0x55555da3e700) at /home//kde/src/build/frameworks/kio/src/core/KF5KIOCore_autogen/include/moc_kcoredirlister.cpp:481
#13 0x00007ffff21a6a59 in KCoreDirListerCache::emitItemsFromCache(KCoreDirLister::Private::CachedItemsJob*, KCoreDirLister*, QUrl const&, bool, bool) (this=0x7ffff246b7c0 <(anonymous namespace)::Q_QGS_kDirListerCache::innerFunction()::holder>, cachedItemsJob=0x555558d114b0, lister=0x55555da3e700, _url=..., _reload=false, _emitCompleted=true) at /home//kde/src/frameworks/kio/src/core/kcoredirlister.cpp:371
#14 0x00007ffff21a64f5 in KCoreDirLister::Private::CachedItemsJob::done() (this=0x555558d114b0) at /home//kde/src/frameworks/kio/src/core/kcoredirlister.cpp:321
#15 0x00007ffff21b9bef in KCoreDirLister::Private::CachedItemsJob::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (_o=0x555558d114b0, _c=QMetaObject::InvokeMetaMethod, _id=0, _a=0x555558d40050)
    at /home//kde/src/build/frameworks/kio/src/core/KF5KIOCore_autogen/include/moc_kcoredirlister_p.cpp:248
#16 0x00007fffeef2d112 in QObject::event(QEvent*) () at /usr/lib/libQt5Core.so.5
#17 0x00007fffefc79fec in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/libQt5Widgets.so.5
#18 0x00007fffefc819c6 in QApplication::notify(QObject*, QEvent*) () at /usr/lib/libQt5Widgets.so.5
#19 0x00007fffeeefbda0 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/libQt5Core.so.5
#20 0x00007fffeeefea06 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () at /usr/lib/libQt5Core.so.5
#21 0x00007fffeef58d04 in  () at /usr/lib/libQt5Core.so.5
#22 0x00007fffe6000e38 in g_main_context_dispatch () at /usr/lib/libglib-2.0.so.0
#23 0x00007fffe6001081 in  () at /usr/lib/libglib-2.0.so.0
#24 0x00007fffe600110e in g_main_context_iteration () at /usr/lib/libglib-2.0.so.0
#25 0x00007fffeef582f1 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Core.so.5
#26 0x00007fffd515d482 in  () at /usr/lib/libQt5XcbQpa.so.5
#27 0x00007fffeeefa3db in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Core.so.5
#28 0x00007fffefe7169b in QDialog::exec() () at /usr/lib/libQt5Widgets.so.5
#29 0x00007fffefe71595 in QDialog::exec() () at /usr/lib/libQt5Widgets.so.5
#30 0x00007ffff352f974 in KUrlRequester::KUrlRequesterPrivate::_k_slotOpenDialog() (this=0x555556cd3590) at /home//kde/src/frameworks/kio/src/widgets/kurlrequester.cpp:454
#31 0x00007ffff3530880 in KUrlRequester::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (_o=0x5555587d1df0, _c=QMetaObject::InvokeMetaMethod, _id=12, _a=0x7fffffffcf20)
    at /home//kde/src/build/frameworks/kio/src/widgets/KF5KIOWidgets_autogen/include/moc_kurlrequester.cpp:168
#32 0x00007fffeef2c6c6 in QMetaObject::activate(QObject*, int, int, void**) () at /usr/lib/libQt5Core.so.5
#33 0x00007fffefd6fb03 in QAbstractButton::clicked(bool) () at /usr/lib/libQt5Widgets.so.5
#34 0x00007fffefd6fd1c in  () at /usr/lib/libQt5Widgets.so.5
#35 0x00007fffefd7115c in  () at /usr/lib/libQt5Widgets.so.5
#36 0x00007fffefd7135e in QAbstractButton::mouseReleaseEvent(QMouseEvent*) () at /usr/lib/libQt5Widgets.so.5
#37 0x00007fffefcba188 in QWidget::event(QEvent*) () at /usr/lib/libQt5Widgets.so.5
#38 0x00007fffefc79fec in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/libQt5Widgets.so.5
#39 0x00007fffefc81f41 in QApplication::notify(QObject*, QEvent*) () at /usr/lib/libQt5Widgets.so.5
#40 0x00007fffeeefbda0 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/libQt5Core.so.5
#41 0x00007fffefc80eca in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) () at /usr/lib/libQt5Widgets.so.5
#42 0x00007fffefcd5949 in  () at /usr/lib/libQt5Widgets.so.5
#43 0x00007fffefcd8060 in  () at /usr/lib/libQt5Widgets.so.5
#44 0x00007fffefc79fec in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/libQt5Widgets.so.5
#45 0x00007fffefc819c6 in QApplication::notify(QObject*, QEvent*) () at /usr/lib/libQt5Widgets.so.5
#46 0x00007fffeeefbda0 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/libQt5Core.so.5
#47 0x00007fffef46f434 in QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) () at /usr/lib/libQt5Gui.so.5
#48 0x00007fffef470f86 in QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) () at /usr/lib/libQt5Gui.so.5
#49 0x00007fffef44829c in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Gui.so.5
#50 0x00007fffd515d48d in  () at /usr/lib/libQt5XcbQpa.so.5
#51 0x00007fffeeefa3db in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Core.so.5
#52 0x00007fffeef037d8 in QCoreApplication::exec() () at /usr/lib/libQt5Core.so.5
#53 0x0000555555566ee0 in main(int, char**) (argc=1, argv=0x7fffffffde58) at /home//kde/src/extragear/kdevelop/kdevelop/app/main.cpp:824
Comment 1 Kevin Funk 2018-03-20 07:12:50 UTC
Looks like a bug in KIO Frameworks instead. Reassigning.
Comment 2 Kai Uwe Broulik 2018-03-20 09:44:14 UTC
I can't reproduce your issue but it hits the following assert: 

QString concatPaths(const QString &path1, const QString &path2)
{
    Q_ASSERT(!path2.startsWith(QLatin1Char('/')));
Comment 3 redmaw 2018-03-21 03:59:38 UTC
(In reply to Kai Uwe Broulik from comment #2)
> I can't reproduce your issue but it hits the following assert: 
> 
> QString concatPaths(const QString &path1, const QString &path2)
> {
>     Q_ASSERT(!path2.startsWith(QLatin1Char('/')));

The source/project path is /home/<user>/projects/llvm, not familiar with this code so I'm not sure what path2 is supposed to be. I did notice that my other project did not have this problem though so I'm not surprised you could not reproduce it. When I have the time I will try to find out where the bad string is coming from.