Bug 378051 - crash when you drag file from trash to trash
Summary: crash when you drag file from trash to trash
Status: RESOLVED FIXED
Alias: None
Product: frameworks-kio
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 5.32.0
Platform: Other Linux
: NOR crash
Target Milestone: ---
Assignee: David Hallas
URL:
Keywords:
: 379343 379982 386293 387432 424052 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-03-25 04:53 UTC by i9i7
Modified: 2020-07-10 11:50 UTC (History)
10 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.56.0


Attachments
Additional stack trace (5.90 KB, text/plain)
2018-03-28 13:00 UTC, Sefa Eyeoglu
Details
New crash information added by DrKonqi (8.39 KB, text/plain)
2018-10-19 12:41 UTC, Thomas Förster
Details

Note You need to log in before you can comment on or make changes to this bug.
Description i9i7 2017-03-25 04:53:26 UTC
if you click and drag a file in the trash folder and let go of it in the trash folder, it completely crashes dolphin.
Comment 1 Elvis Angelaccio 2017-03-25 17:07:07 UTC
Thanks for reporing. Stacktrace:

Thread 1 (Thread 0x7f0a952d7800 (LWP 3260)):
[KCrash Handler]
#6  0x00007f0a92eb0a86 in std::__atomic_base<int>::operator++ (this=0x21) at /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/6.3.1/../../../../include/c++/6.3.1/bits/atomic_base.h:296
#7  0x00007f0a92eb0a55 in QAtomicOps<int>::ref<int> (_q_value=...) at /usr/include/qt/QtCore/qatomic_cxx11.h:265
#8  0x00007f0a92eb0a35 in QBasicAtomicInteger<int>::ref (this=0x21) at /usr/include/qt/QtCore/qbasicatomic.h:113
#9  0x00007f0a92f6509b in QSharedDataPointer<KIO::UDSEntryPrivate>::QSharedDataPointer (this=0x7ffeca1eb0a0, o=...) at /usr/include/qt/QtCore/qshareddata.h:92
#10 0x00007f0a92f6439d in KIO::UDSEntry::UDSEntry (this=0x7ffeca1eb0a0, other=...) at /home/elvis/dev/kde/src/kio/src/core/udsentry.cpp:76
#11 0x00007f0a92ede0db in KFileItem::entry (this=0x19bc860) at /home/elvis/dev/kde/src/kio/src/core/kfileitem.cpp:1486
#12 0x00007f0a92f75f63 in KCoreDirListerCache::slotFileRenamed (this=0x7f0a9322c580 <(anonymous namespace)::Q_QGS_kDirListerCache::innerFunction()::holder>, _src=..., _dst=..., dstPath=...) at /home/elvis/dev/kde/src/kio/src/core/kcoredirlister.cpp:989
#13 0x00007f0a92f92a0d in QtPrivate::FunctorCall<QtPrivate::IndexesList<0, 1, 2>, QtPrivate::List<QString const&, QString const&, QString const&>, void, void (KCoreDirListerCache::*)(QString const&, QString const&, QString const&)>::call (f=(void (KCoreDirListerCache::*)(KCoreDirListerCache * const, const QString &, const QString &, const QString &)) 0x7f0a92f75bf0 <KCoreDirListerCache::slotFileRenamed(QString const&, QString const&, QString const&)>, o=0x7f0a9322c580 <(anonymous namespace)::Q_QGS_kDirListerCache::innerFunction()::holder>, arg=0x7ffeca1eb430) at /usr/include/qt/QtCore/qobjectdefs_impl.h:143
#14 0x00007f0a92f92950 in QtPrivate::FunctionPointer<void (KCoreDirListerCache::*)(QString const&, QString const&, QString const&)>::call<QtPrivate::List<QString const&, QString const&, QString const&>, void> (f=(void (KCoreDirListerCache::*)(KCoreDirListerCache * const, const QString &, const QString &, const QString &)) 0x7f0a92f75bf0 <KCoreDirListerCache::slotFileRenamed(QString const&, QString const&, QString const&)>, o=0x7f0a9322c580 <(anonymous namespace)::Q_QGS_kDirListerCache::innerFunction()::holder>, arg=0x7ffeca1eb430) at /usr/include/qt/QtCore/qobjectdefs_impl.h:162
#15 0x00007f0a92f92846 in QtPrivate::QSlotObject<void (KCoreDirListerCache::*)(QString const&, QString const&, QString const&), QtPrivate::List<QString const&, QString const&, QString const&>, void>::impl (which=1, this_=0x1719f10, r=0x7f0a9322c580 <(anonymous namespace)::Q_QGS_kDirListerCache::innerFunction()::holder>, a=0x7ffeca1eb430, ret=0x0) at /usr/include/qt/QtCore/qobject_impl.h:120
#16 0x00007f0a8d75b0be in QMetaObject::activate(QObject*, int, int, void**) () from /usr/lib/libQt5Core.so.5
#17 0x00007f0a92fb607e in OrgKdeKDirNotifyInterface::FileRenamedWithLocalPath (this=0x1716ef0, _t1=..., _t2=..., _t3=...) at src/core/KF5KIOCore_automoc.dir/moc_kdirnotify_FWCYUVFJ2BRI4B.cpp:221
#18 0x00007f0a92fb5c79 in OrgKdeKDirNotifyInterface::qt_static_metacall (_o=0x1716ef0, _c=QMetaObject::InvokeMetaMethod, _id=1, _a=0x7ffeca1eb610) at src/core/KF5KIOCore_automoc.dir/moc_kdirnotify_FWCYUVFJ2BRI4B.cpp:103
#19 0x00007f0a92fb63e5 in OrgKdeKDirNotifyInterface::qt_metacall (this=0x1716ef0, _c=QMetaObject::InvokeMetaMethod, _id=1, _a=0x7ffeca1eb610) at src/core/KF5KIOCore_automoc.dir/moc_kdirnotify_FWCYUVFJ2BRI4B.cpp:200
#20 0x00007f0a8dba5430 in ?? () from /usr/lib/libQt5DBus.so.5
#21 0x00007f0a8d75bba9 in QObject::event(QEvent*) () from /usr/lib/libQt5Core.so.5
#22 0x00007f0a8e8de34c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQt5Widgets.so.5
#23 0x00007f0a8e8e5b61 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQt5Widgets.so.5
#24 0x00007f0a8d72f440 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib/libQt5Core.so.5
#25 0x00007f0a8d731bcd in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /usr/lib/libQt5Core.so.5
#26 0x00007f0a8d783c43 in ?? () from /usr/lib/libQt5Core.so.5
#27 0x00007f0a869c65a7 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#28 0x00007f0a869c6810 in ?? () from /usr/lib/libglib-2.0.so.0
#29 0x00007f0a869c68bc in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#30 0x00007f0a8d78404f in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
#31 0x00007f0a8d72d89a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
#32 0x00007f0a8d735de4 in QCoreApplication::exec() () from /usr/lib/libQt5Core.so.5
#33 0x00007f0a94f1146b in kdemain (argc=1, argv=0x7ffeca1ec318) at /home/elvis/dev/kde/src/dolphin/src/main.cpp:163
#34 0x0000000000400ab2 in main (argc=1, argv=0x7ffeca1ec318) at src/dolphin_dummy.cpp:3
Comment 2 Christoph Feck 2017-05-07 11:36:52 UTC
*** Bug 379343 has been marked as a duplicate of this bug. ***
Comment 3 Elvis Angelaccio 2017-05-19 07:55:55 UTC
*** Bug 379982 has been marked as a duplicate of this bug. ***
Comment 4 Elvis Angelaccio 2017-10-28 20:54:32 UTC
*** Bug 386293 has been marked as a duplicate of this bug. ***
Comment 5 Patrick Silva 2017-11-29 12:45:47 UTC
*** Bug 387432 has been marked as a duplicate of this bug. ***
Comment 6 Sefa Eyeoglu 2018-03-28 13:00:34 UTC
Created attachment 111702 [details]
Additional stack trace

I can confirm this bug
Comment 7 Thomas Förster 2018-10-19 12:41:09 UTC
Created attachment 115749 [details]
New crash information added by DrKonqi

dolphin (18.08.2) using Qt 5.11.2

- What I was doing when the application crashed:

- Unusual behavior I noticed:


If I mark a file in the trash to delete, the whole system hangs and after a few minutes it works again or Dolphin crashes.

-- Backtrace (Reduced):
#6  std::__atomic_base<int>::operator++ (this=0x21) at /usr/include/c++/7/bits/atomic_base.h:296
#7  QAtomicOps<int>::ref<int> (_q_value=...) at /usr/include/qt5/QtCore/qatomic_cxx11.h:265
[...]
#9  QSharedDataPointer<KIO::UDSEntryPrivate>::QSharedDataPointer (o=..., this=0x7ffc304cc5a8) at /usr/include/qt5/QtCore/qshareddata.h:92
#10 KIO::UDSEntry::UDSEntry (this=0x7ffc304cc5a8) at /usr/src/debug/kio-5.51.0-lp150.232.1.x86_64/src/core/udsentry.h:76
#11 0x00007fe9da0c4105 in KFileItem::entry (this=this@entry=0x55a8738f6320) at /usr/src/debug/kio-5.51.0-lp150.232.1.x86_64/src/core/kfileitem.cpp:1516
Comment 8 David Hallas 2019-02-18 14:29:37 UTC
I have just reproduced this with a debug build of KIO and I get the following assert failure:

ASSERT: "it != dirItem->lstItems.end()" in file /home/dha/workspace/kde/kio/src/core/kcoredirlister_p.h, line 308

I will look into the root cause of this and post and update.
Comment 9 David Hallas 2019-02-19 19:58:52 UTC
Pushed the following fix:

https://phabricator.kde.org/D19168

Please test it out :)
Comment 10 David Hallas 2019-02-25 10:08:06 UTC
Git commit f56af9e2ea0aa61d3faa9c57aa477016b1223f96 by David Hallas.
Committed on 25/02/2019 at 10:07.
Pushed by hallas into branch 'master'.

Fix crash in Dolphin when dropping trashed file in trash

Summary:
Fix crash in Dolphin when dropping trashed file in trash. The actual
crash happens because of an assertion failure in kcoredirlister_p.h:308
and this is triggered from kcoredirlister.cpp:995. What actually happens
is that the dropjob determines that it should perform a move action
which ends up being a rename operation for kio_trash. But it ends up
moving the file to itself and this triggers the above crash. The
solution is to error out in the dropjob with a KIO::ERR_DROP_ON_ITSELF
error so that the user can see that it doesn't make sense to drop a
file from the trash inside the trash again.

Test Plan:
Put a file in trash
Drag and drop the file to the trash

Reviewers: #frameworks, elvisangelaccio, ngraham, dfaure

Reviewed By: dfaure

Subscribers: kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D19168

M  +25   -0    autotests/dropjobtest.cpp
M  +4    -0    src/widgets/dropjob.cpp

https://commits.kde.org/kio/f56af9e2ea0aa61d3faa9c57aa477016b1223f96
Comment 11 David Hallas 2019-02-25 10:15:15 UTC
This should be fixed in Framework 5.56.0
Comment 12 Patrick Silva 2020-07-10 11:50:14 UTC
*** Bug 424052 has been marked as a duplicate of this bug. ***