Bug 484289 - Crash upon saving when you delete newly created folder in file dialog
Summary: Crash upon saving when you delete newly created folder in file dialog
Status: RESOLVED FIXED
Alias: None
Product: frameworks-kio
Classification: Frameworks and Libraries
Component: Open/save dialogs (other bugs)
Version First Reported In: git master
Platform: Manjaro Linux
: NOR crash
Target Milestone: ---
Assignee: KIO Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-03-22 23:50 UTC by Vadim
Modified: 2024-05-28 18:49 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vadim 2024-03-22 23:50:13 UTC
SUMMARY
Crash upon saving when you delete a newly created folder in the file dialog.


STEPS TO REPRODUCE
1. Start Kate
2. Create empty new document
3. Type anything
4. Press CTRL+S to save
5. Right click any current folder, Create folder inside it as a subfolder. Now you are inside the folder
6. Go back (Mouse Back), you are now viewing the tree view of parent folder and the newly created subfolder is selected
7. Right click the subfolder, Move to Trash
8. Kate crashes as segv, the file progress is lost

OBSERVED RESULT
Crash and lose all progress

EXPECTED RESULT
Unsaved buffers are not lost https://bugs.kde.org/show_bug.cgi?id=274102

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Manjaro
KDE Plasma Version: 5.27.11
KDE Frameworks Version: 5.115.0
Qt Version: 5.15.1

ADDITIONAL INFORMATION
The crash is either trivially reproducible or not in upstream. Sorry about no symbols.
Did the same actions inside Libreoffice Writer's file dialog - not crashing.
Comment 1 Waqar Ahmed 2024-03-30 21:51:39 UTC
Crash is in kio

    #0 0x7fa9fd94bb48 in QSortFilterProxyModel::parent(QModelIndex const&) const (/usr/lib/libQt6Core.so.6+0x34bb48)
    #1 0x7fa9fd914d63 in QAbstractItemModelPrivate::rowsAboutToBeRemoved(QModelIndex const&, int, int) (/usr/lib/libQt6Core.so.6+0x314d63)
    #2 0x7fa9fd94b56c  (/usr/lib/libQt6Core.so.6+0x34b56c)
    #3 0x7fa9fd94c820  (/usr/lib/libQt6Core.so.6+0x34c820)
    #4 0x7fa9fd790ca8  (/usr/lib/libQt6Core.so.6+0x190ca8)
    #5 0x7fa9fd91ed19 in QAbstractItemModel::beginRemoveRows(QModelIndex const&, int, int) (/usr/lib/libQt6Core.so.6+0x31ed19)
    #6 0x7faa00c7795d in KDirModelPrivate::_k_slotDeleteItems(KFileItemList const&) kio/src/widgets/kdirmodel.cpp:631:12
    #7 0x7faa00c85765 in KDirModel::setDirLister(KDirLister*)::$_2::operator()(KFileItemList const&) const kio/src/widgets/kdirmodel.cpp:465:12
    #8 0x7faa00c85765 in QtPrivate::FunctorCall<QtPrivate::IndexesList<0>, QtPrivate::List<KFileItemList const&>, void, KDirModel::setDirLister(KDirLister*)::$_2>::call(KDirModel::setDirLister(KDirLister*)::$_2&, void**) /usr/include/qt6/QtCore/qobjectdefs_impl.h:137:13
    #9 0x7faa00c85765 in void QtPrivate::Functor<KDirModel::setDirLister(KDirLister*)::$_2, 1>::call<QtPrivate::List<KFileItemList const&>, void>(KDirModel::setDirLister(KDirLister*)::$_2&, void*, void**) /usr/include/qt6/QtCore/qobjectdefs_impl.h:339:13
    #10 0x7faa00c85765 in QtPrivate::QCallableObject<KDirModel::setDirLister(KDirLister*)::$_2, QtPrivate::List<KFileItemList const&>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) /usr/include/qt6/QtCore/qobjectdefs_impl.h:522:21
    #11 0x7fa9fd790ca8  (/usr/lib/libQt6Core.so.6+0x190ca8)
    #12 0x7faa0030838c in KCoreDirLister::itemsDeleted(KFileItemList const&) kio/src/core/KF6KIOCore_autogen/include/moc_kcoredirlister.cpp:694:5
    #13 0x7faa0030838c in KCoreDirListerPrivate::emitItemsDeleted(KFileItemList const&) kio/src/core/kcoredirlister.cpp:2520:19
    #14 0x7faa002fcc92 in KCoreDirListerCache::itemsDeleted(QList<KCoreDirLister*> const&, KFileItemList const&) kio/src/core/kcoredirlister.cpp:1900:17
    #15 0x7faa002fc5d2 in KCoreDirListerCache::slotFilesRemoved(QList<QUrl> const&) kio/src/core/kcoredirlister.cpp:848:13
    #16 0x7faa002dd5f1 in KCoreDirListerCache::slotFilesRemoved(QList<QString> const&) kio/src/core/kcoredirlister.cpp:798:5
    #17 0x7faa0032ceb3 in QtPrivate::FunctorCall<QtPrivate::IndexesList<0>, QtPrivate::List<QList<QString> const&>, void, void (KCoreDirListerCache::*)(QList<QString> const&)>::call(void (KCoreDirListerCache::*)(QList<QString> const&), KCoreDirListerCache*, void**) /usr/include/qt6/QtCore/qobjectdefs_impl.h:145:13
    #18 0x7faa0032ceb3 in void QtPrivate::FunctionPointer<void (KCoreDirListerCache::*)(QList<QString> const&)>::call<QtPrivate::List<QList<QString> const&>, void>(void (KCoreDirListerCache::*)(QList<QString> const&), KCoreDirListerCache*, void**) /usr/include/qt6/QtCore/qobjectdefs_impl.h:182:13
    #19 0x7faa0032ceb3 in QtPrivate::QCallableObject<void (KCoreDirListerCache::*)(QList<QString> const&), QtPrivate::List<QList<QString> const&>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) /usr/include/qt6/QtCore/qobjectdefs_impl.h:520:21
    #20 0x7fa9fd790ca8  (/usr/lib/libQt6Core.so.6+0x190ca8)
    #21 0x7faa0039cc34 in OrgKdeKDirNotifyInterface::FilesRemoved(QList<QString> const&) kio/src/core/KF6KIOCore_autogen/include/moc_kdirnotify.cpp:343:5
    #22 0x7faa0039cc34 in OrgKdeKDirNotifyInterface::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) kio/src/core/KF6KIOCore_autogen/include/moc_kdirnotify.cpp:208:21
    #23 0x7faa0039dc6d in OrgKdeKDirNotifyInterface::qt_metacall(QMetaObject::Call, int, void**) kio/src/core/KF6KIOCore_autogen/include/moc_kdirnotify.cpp:294:13
    #24 0x7fa9fed860cd  (/usr/lib/libQt6DBus.so.6+0x390cd)
    #25 0x7fa9fd77c2c6 in QObject::event(QEvent*) (/usr/lib/libQt6Core.so.6+0x17c2c6)
    #26 0x7fa9fe6f438a in QApplicationPrivate::notify_helper(QObject*, QEvent*) (/usr/lib/libQt6Widgets.so.6+0xf438a)
    #27 0x7fa9fd739817 in QCoreApplication::notifyInternal2(QObject*, QEvent*) (/usr/lib/libQt6Core.so.6+0x139817)
    #28 0x7fa9fd739b9a in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) (/usr/lib/libQt6Core.so.6+0x139b9a)
    #29 0x7fa9fd9758a3  (/usr/lib/libQt6Core.so.6+0x3758a3)
    #30 0x7fa9fbb0df68  (/usr/lib/libglib-2.0.so.0+0x59f68)
    #31 0x7fa9fbb6c3a6  (/usr/lib/libglib-2.0.so.0+0xb83a6)
    #32 0x7fa9fbb0c161 in g_main_context_iteration (/usr/lib/libglib-2.0.so.0+0x58161)
    #33 0x7fa9fd9739c3 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (/usr/lib/libQt6Core.so.6+0x3739c3)
    #34 0x7fa9fd743d6d in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (/usr/lib/libQt6Core.so.6+0x143d6d)
    #35 0x7fa9fe941de2 in QDialog::exec() (/usr/lib/libQt6Widgets.so.6+0x341de2)
    #36 0x7fa9f29450be in KDEPlatformFileDialogHelper::exec() plasma/plasma-integration/qt6/src/platformtheme/kdeplatformfiledialoghelper.cpp:352:15
    #37 0x7fa9fe941ce4 in QDialog::exec() (/usr/lib/libQt6Widgets.so.6+0x341ce4)
    #38 0x7fa9fe9574bc in QFileDialog::getSaveFileUrl(QWidget*, QString const&, QUrl const&, QString const&, QString*, QFlags<QFileDialog::Option>, QList<QString> const&) (/usr/lib/libQt6Widgets.so.6+0x3574bc)
    #39 0x7faa018b7673 in KTextEditor::DocumentPrivate::getSaveFileUrl(QString const&) ktexteditor/src/document/katedocument.cpp:1784:12
    #40 0x7faa018fd761 in KTextEditor::DocumentPrivate::documentSaveAs() ktexteditor/src/document/katedocument.cpp:4917:26
    #41 0x7faa0190e810 in KTextEditor::DocumentPrivate::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) ktexteditor/src/KF6TextEditor_autogen/include/moc_katedocument.cpp:1076:34
    #42 0x7fa9fd790faa  (/usr/lib/libQt6Core.so.6+0x190faa)
    #43 0x7fa9fe0e2076 in QAction::activate(QAction::ActionEvent) (/usr/lib/libQt6Gui.so.6+0x4e2076)
    #44 0x7fa9fe0e3d97 in QAction::event(QEvent*) (/usr/lib/libQt6Gui.so.6+0x4e3d97)
    #45 0x7fa9fe6f438a in QApplicationPrivate::notify_helper(QObject*, QEvent*) (/usr/lib/libQt6Widgets.so.6+0xf438a)
    #46 0x7fa9fd739817 in QCoreApplication::notifyInternal2(QObject*, QEvent*) (/usr/lib/libQt6Core.so.6+0x139817)
    #47 0x7fa9fe0f2d19 in QShortcutMap::dispatchEvent(QKeyEvent*) (/usr/lib/libQt6Gui.so.6+0x4f2d19)
    #48 0x7fa9fddde375 in QWindowSystemInterface::handleShortcutEvent(QWindow*, unsigned long, int, QFlags<Qt::KeyboardModifier>, unsigned int, unsigned int, unsigned int, QString const&, bool, unsigned short) (/usr/lib/libQt6Gui.so.6+0x1de375)
    #49 0x7fa9fdd718a1 in QGuiApplicationPrivate::processKeyEvent(QWindowSystemInterfacePrivate::KeyEvent*) (/usr/lib/libQt6Gui.so.6+0x1718a1)
    #50 0x7fa9fddda85b in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) (/usr/lib/libQt6Gui.so.6+0x1da85b)
    #51 0x7fa9f76afbde  (/usr/lib/qt6/plugins/platforms/../../../libQt6XcbQpa.so.6+0x4cbde)
    #52 0x7fa9fbb0df68  (/usr/lib/libglib-2.0.so.0+0x59f68)
    #53 0x7fa9fbb6c3a6  (/usr/lib/libglib-2.0.so.0+0xb83a6)
    #54 0x7fa9fbb0c161 in g_main_context_iteration (/usr/lib/libglib-2.0.so.0+0x58161)
    #55 0x7fa9fd9739c3 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (/usr/lib/libQt6Core.so.6+0x3739c3)
    #56 0x7fa9fd743d6d in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (/usr/lib/libQt6Core.so.6+0x143d6d)
    #57 0x7fa9fd73c2b7 in QCoreApplication::exec() (/usr/lib/libQt6Core.so.6+0x13c2b7)
    #58 0x55da411202a8 in main kate/apps/kate/main.cpp:527:12
    #59 0x7fa9fd043ccf  (/usr/lib/libc.so.6+0x29ccf)
    #60 0x7fa9fd043d89 in __libc_start_main (/usr/lib/libc.so.6+0x29d89)
    #61 0x55da40fd9f24 in _start (usr/bin/kate+0x28f24)
Comment 2 Vadim 2024-05-28 18:49:47 UTC
It's fixed now. Tested with the recent KDE 6 packages in Manjaro. No longer crashes. Thanks Waqar, I don't know if it was fixed in some refactoring or noticed independently or you did it yourself :)

KDE Frameworks 6.1.0 (6.1.0-1 package)
Kate 24.02.2
Qt 6.7.0