Bug 473377 - Dolphin crashes if you remove a tab after deleting a folder
Summary: Dolphin crashes if you remove a tab after deleting a folder
Status: RESOLVED FIXED
Alias: None
Product: dolphin
Classification: Applications
Component: general (show other bugs)
Version: 23.04.3
Platform: Other Linux
: NOR crash
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords:
: 479189 (view as bug list)
Depends on:
Blocks:
 
Reported: 2023-08-14 15:56 UTC by Жора Змейкин
Modified: 2024-10-08 09:20 UTC (History)
3 users (show)

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


Attachments
Demonstration (3.38 MB, image/gif)
2023-08-14 15:56 UTC, Жора Змейкин
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Жора Змейкин 2023-08-14 15:56:12 UTC
Created attachment 160956 [details]
Demonstration

If you go to any folder, open it in a new tab, and then delete that folder and remove the tab, almost any next action with the file system will cause Dolphin to crash (e.g. if you try to create another folder afterwards, or delete something)

STEPS TO REPRODUCE
1. Open any folder in a new tab
2. Delete this folder
3. Remove the deleted folder tab
4. Attempt to create any folder, file, or rename.

OBSERVED RESULT
Dolphin is crashing.

EXPECTED RESULT
Nothing's supposed to happen.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: EndeavourOS
KDE Plasma Version: 5.27.7
KDE Frameworks Version: 5.108.0
Qt Version: 5.15.10
Graphics platform: Wayland

ADDITIONAL INFORMATION
Application: Dolphin (dolphin), signal: Segmentation fault
Content of s_kcrashErrorMessage: std::unique_ptr<char []> = {get() = <optimized out>}
[KCrash Handler]
#6  0x00007f6ce41b78a8 in KCoreDirLister::requestMimeTypeWhileListing() const (this=0x55c5fd2cec00) at /usr/include/c++/13.1.1/bits/unique_ptr.h:199
#7  0x00007f6ce41b1bc5 in operator() (lister=<optimized out>, __closure=<synthetic pointer>) at /usr/src/debug/kio/kio-5.108.0/src/core/kcoredirlister.cpp:667
#8  __gnu_cxx::__ops::_Iter_pred<KCoreDirListerCache::updateDirectory(const QUrl&)::<lambda(KCoreDirLister*)> >::operator()<QList<KCoreDirLister*>::const_iterator> (__it=..., this=<synthetic pointer>) at /usr/include/c++/13.1.1/bits/predefined_ops.h:318
#9  std::__find_if<QList<KCoreDirLister*>::const_iterator, __gnu_cxx::__ops::_Iter_pred<KCoreDirListerCache::updateDirectory(const QUrl&)::<lambda(KCoreDirLister*)> > > (__pred=..., __last=..., __first=...) at /usr/include/c++/13.1.1/bits/stl_algobase.h:2102
#10 std::__find_if<QList<KCoreDirLister*>::const_iterator, __gnu_cxx::__ops::_Iter_pred<KCoreDirListerCache::updateDirectory(const QUrl&)::<lambda(KCoreDirLister*)> > > (__first=..., __last=..., __pred=...) at /usr/include/c++/13.1.1/bits/stl_algobase.h:2118
#11 std::find_if<QList<KCoreDirLister*>::const_iterator, KCoreDirListerCache::updateDirectory(const QUrl&)::<lambda(KCoreDirLister*)> > (__pred=..., __last=..., __first=...) at /usr/include/c++/13.1.1/bits/stl_algo.h:3924
#12 std::none_of<QList<KCoreDirLister*>::const_iterator, KCoreDirListerCache::updateDirectory(const QUrl&)::<lambda(KCoreDirLister*)> > (__first=..., __pred=..., __last=...) at /usr/include/c++/13.1.1/bits/stl_algo.h:477
#13 std::any_of<QList<KCoreDirLister*>::const_iterator, KCoreDirListerCache::updateDirectory(const QUrl&)::<lambda(KCoreDirLister*)> > (__first=..., __last=..., __pred=...) at /usr/include/c++/13.1.1/bits/stl_algo.h:496
#14 KCoreDirListerCache::updateDirectory(QUrl const&) (this=this@entry=0x7f6ce4240560 <_ZZN12_GLOBAL__N_121Q_QGS_kDirListerCache13innerFunctionEvE6holder.lto_priv.0>, _dir=...) at /usr/src/debug/kio/kio-5.108.0/src/core/kcoredirlister.cpp:666
#15 0x00007f6ce41b257f in KCoreDirListerCache::itemsAddedInDirectory(QUrl const&) (this=this@entry=0x7f6ce4240560 <_ZZN12_GLOBAL__N_121Q_QGS_kDirListerCache13innerFunctionEvE6holder.lto_priv.0>, urlDir=...) at /usr/src/debug/kio/kio-5.108.0/src/core/kcoredirlister.cpp:800
#16 0x00007f6ce41b2646 in KCoreDirListerCache::slotFilesAdded(QString const&) (this=0x7f6ce4240560 <_ZZN12_GLOBAL__N_121Q_QGS_kDirListerCache13innerFunctionEvE6holder.lto_priv.0>, dir=<optimized out>) at /usr/src/debug/kio/kio-5.108.0/src/core/kcoredirlister.cpp:792
#17 0x00007f6ce24d1637 in QtPrivate::QSlotObjectBase::call(QObject*, void**) (a=0x7fff1b8438d0, r=<optimized out>, this=0x55c5fcc0df60, this=<optimized out>, r=<optimized out>, a=<optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
#18 doActivate<false>(QObject*, int, void**) (sender=0x55c5fcbc0de0, signal_index=6, argv=0x7fff1b8438d0) at kernel/qobject.cpp:3925
#19 0x00007f6ce4116ada in OrgKdeKDirNotifyInterface::FilesAdded(QString const&) (this=<optimized out>, _t1=<optimized out>) at /usr/src/debug/kio/build/src/core/KF5KIOCore_autogen/EWIEGA46WW/moc_kdirnotify.cpp:239
#20 0x00007f6ce4116dba in OrgKdeKDirNotifyInterface::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (_o=_o@entry=0x55c5fcbc0de0, _c=_c@entry=QMetaObject::InvokeMetaMethod, _id=_id@entry=3, _a=_a@entry=0x7fff1b8439f0) at /usr/src/debug/kio/build/src/core/KF5KIOCore_autogen/EWIEGA46WW/moc_kdirnotify.cpp:106
#21 0x00007f6ce411cc43 in OrgKdeKDirNotifyInterface::qt_metacall(QMetaObject::Call, int, void**) (this=0x55c5fcbc0de0, _c=QMetaObject::InvokeMetaMethod, _id=3, _a=0x7fff1b8439f0) at /usr/src/debug/kio/build/src/core/KF5KIOCore_autogen/EWIEGA46WW/moc_kdirnotify.cpp:204
#22 0x00007f6ce384c76e in QDBusConnectionPrivate::deliverCall(QObject*, int, QDBusMessage const&, QVector<int> const&, int) (this=<optimized out>, object=<optimized out>, msg=<optimized out>, metaTypes=<optimized out>, slotIdx=<optimized out>) at /usr/src/debug/qt5-base/qtbase/src/dbus/qdbusintegrator.cpp:1001
#23 0x00007f6ce24c4174 in QObject::event(QEvent*) (this=0x55c5fcbc0de0, e=0x7f6cd4012e80) at kernel/qobject.cpp:1347
#24 0x00007f6ce317893f in QApplicationPrivate::notify_helper(QObject*, QEvent*) (this=<optimized out>, receiver=0x55c5fcbc0de0, e=0x7f6cd4012e80) at kernel/qapplication.cpp:3640
#25 0x00007f6ce249c6f8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) (receiver=0x55c5fcbc0de0, event=0x7f6cd4012e80) at kernel/qcoreapplication.cpp:1064
#26 0x00007f6ce24a165b in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) (receiver=0x0, event_type=0, data=0x55c5fc9cc550) at kernel/qcoreapplication.cpp:1821
#27 0x00007f6ce24e76d8 in postEventSourceDispatch(GSource*, GSourceFunc, gpointer) (s=0x55c5fca2e510) at kernel/qeventdispatcher_glib.cpp:277
#28 0x00007f6ce050fa31 in g_main_dispatch (context=0x7f6cd4000ee0) at ../glib/glib/gmain.c:3460
#29 g_main_context_dispatch (context=0x7f6cd4000ee0) at ../glib/glib/gmain.c:4200
#30 0x00007f6ce056ccc9 in g_main_context_iterate.isra.0 (context=context@entry=0x7f6cd4000ee0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/glib/gmain.c:4276
#31 0x00007f6ce050d0e2 in g_main_context_iteration (context=0x7f6cd4000ee0, may_block=1) at ../glib/glib/gmain.c:4343
#32 0x00007f6ce24eb51c in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=0x55c5fca32870, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#33 0x00007f6ce249b404 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (this=this@entry=0x7fff1b843ec0, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:69
#34 0x00007f6ce249c8a3 in QCoreApplication::exec() () at ../../include/QtCore/../../src/corelib/global/qflags.h:121
#35 0x00007f6ce293bef2 in QGuiApplication::exec() () at kernel/qguiapplication.cpp:1870
#36 0x00007f6ce3176cda in QApplication::exec() () at kernel/qapplication.cpp:2832
#37 0x000055c5fad1dda8 in main(int, char**) (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/dolphin/dolphin-23.04.3/src/main.cpp:249
[Inferior 1 (process 83537) detached]
Comment 1 Bug Janitor Service 2023-09-04 05:56:26 UTC
A possibly relevant merge request was started @ https://invent.kde.org/system/dolphin/-/merge_requests/614
Comment 2 Amol Godbole 2023-09-04 06:57:56 UTC
Git commit 9ba09040134f743ca3a2082589cc943c2d4bf175 by Amol Godbole.
Committed on 04/09/2023 at 07:53.
Pushed by meven into branch 'master'.

KFileItemModel: Delay emitting currentDirectoryRemoved() signal

The KCoreDirLister object is modified before KCoreDirListerCache::deleteDir()
returns because the signal currentDirectoryRemoved() is emitted.
This prevents removal of the deleted lister from dirData.listersCurrentlyHolding
in KCoreDirListerCache::forgetDirs() when the tab is closed, which causes the
crash described in the bug. Hence, the signal currentDirectoryRemoved()
is delayed to ensure this does not occur.

M  +6    -1    src/kitemviews/kfileitemmodel.cpp

https://invent.kde.org/system/dolphin/-/commit/9ba09040134f743ca3a2082589cc943c2d4bf175
Comment 3 Akseli Lahtinen 2024-01-16 13:04:12 UTC
*** Bug 479189 has been marked as a duplicate of this bug. ***
Comment 4 Méven 2024-10-08 09:20:20 UTC
Git commit 2328cb7f923e5c6eeb7617eebf3ee73c0bb8e50b by Méven Car, on behalf of Amol Godbole.
Committed on 08/10/2024 at 09:15.
Pushed by meven into branch 'master'.

DolphinViewContainer: Delay changing the url

KCoreDirLister::itemsDeleted() signal is being emitted twice for the
same url. This results in Dolphin displaying an incorrect location.
Delay changing the url instead of delaying
DolphinView::currentDirectoryRemoved() so that the check for current
directory being removed in KFileItemModel::slotItemsDeleted() occurs
correctly, while still ensuring that KCoreDirLister is not prematurely
modified.
Related: bug 492277

M  +7    -4    src/dolphinviewcontainer.cpp
M  +1    -2    src/views/dolphinview.cpp

https://invent.kde.org/system/dolphin/-/commit/2328cb7f923e5c6eeb7617eebf3ee73c0bb8e50b