Summary: | Dolphin crashes due to nested eventloops of the RenameDialog | ||
---|---|---|---|
Product: | [Frameworks and Libraries] frameworks-kio | Reporter: | kb |
Component: | general | Assignee: | David Faure <faure> |
Status: | RESOLVED DUPLICATE | ||
Severity: | crash | CC: | a.samirh78, elvis.angelaccio, kde, kdelibs-bugs, meven29, nate |
Priority: | NOR | Keywords: | drkonqi |
Version: | 5.45.0 | ||
Target Milestone: | --- | ||
Platform: | openSUSE | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
kb
2019-07-08 07:20:36 UTC
askFileRename spawns an event loop and when it finishes the job might have been deleted under us. Naive fix: QPointer<KJob> guard(q); RenameDialog_Result r = q->uiDelegateExtension()->askFileRename(...); if (!guard) { return; } #0 QObject::thread (this=this@entry=0x555555e02e20) at kernel/qobject.cpp:1433 #1 0x00007ffff5dbe33d in QObject::killTimer (this=this@entry=0x555555e02e20, id=1440507520) at kernel/qobject.cpp:1711 #2 0x00007ffff5dc7569 in QTimer::stop (this=this@entry=0x555555e02e20) at kernel/qtimer.cpp:241 #3 0x00007ffff5dc75df in QTimer::start (this=0x555555e02e20) at kernel/qtimer.cpp:209 #4 0x00007ffff75f0e9d in KIO::CopyJobPrivate::slotResultConflictCreatingDirs (this=0x555555df8760, job=0x555555def920) at /home/ahmad/rpmbuild/dev/kio/git/src/core/copyjob.cpp:1215 #5 0x00007ffff75f8212 in KIO::CopyJob::slotResult (this=0x555555dec520, job=0x555555def920) at /home/ahmad/rpmbuild/dev/kio/git/src/core/copyjob.cpp:2199 #6 0x00007ffff5dba638 in QtPrivate::QSlotObjectBase::call (a=0x7fffffffd020, r=0x555555dec520, this=0x555555dc66c0) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:394 #7 QMetaObject::activate (sender=0x555555def920, signalOffset=<optimized out>, local_signal_index=<optimized out>, argv=<optimized out>) at kernel/qobject.cpp:3789 #8 0x00007ffff6e7c1dc in KJob::result (this=this@entry=0x555555def920, _t1=<optimized out>, _t1@entry=0x555555def920, _t2=...) at /usr/src/debug/kcoreaddons-5.62.0git.20190916T015939~7e73774-ku.7.1.x86_64/build/src/lib/KF5CoreAddons_autogen/include/moc_kjob.cpp:574 #9 0x00007ffff6e80c93 in KJob::finishJob (this=0x555555def920, emitResult=<optimized out>) at /usr/src/debug/kcoreaddons-5.62.0git.20190916T015939~7e73774-ku.7.1.x86_64/src/lib/jobs/kjob.cpp:107 #10 0x00007ffff763fc20 in KIO::SimpleJob::slotFinished (this=0x555555def920) at /home/ahmad/rpmbuild/dev/kio/git/src/core/simplejob.cpp:232 #11 0x00007ffff764394f in KIO::StatJob::slotFinished (this=0x555555def920) at /home/ahmad/rpmbuild/dev/kio/git/src/core/statjob.cpp:168 #12 0x00007ffff7642bbb in QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, void (KIO::SimpleJob::*)()>::call(void (KIO::SimpleJob::*)(), KIO::SimpleJob*, void**) (f=&virtual KIO::SimpleJob::slotFinished(), o=0x555555def920, arg=0x7fffffffd320) at /usr/include/qt5/QtCore/qobjectdefs_impl.h:152 #13 0x00007ffff7642903 in QtPrivate::FunctionPointer<void (KIO::SimpleJob::*)()>::call<QtPrivate::List<>, void>(void (KIO::SimpleJob::*)(), KIO::SimpleJob*, void**) (f=&virtual KIO::SimpleJob::slotFinished(), o=0x555555def920, arg=0x7fffffffd320) at /usr/include/qt5/QtCore/qobjectdefs_impl.h:185 #14 0x00007ffff764278e in QtPrivate::QSlotObject<void (KIO::SimpleJob::*)(), QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) (which=1, this_=0x555555df2690, r=0x555555def920, a=0x7fffffffd320, ret=0x0) at /usr/include/qt5/QtCore/qobjectdefs_impl.h:414 #15 0x00007ffff5dba638 in QtPrivate::QSlotObjectBase::call (a=0x7fffffffd320, r=0x555555def920, this=0x555555df2690) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:394 #16 QMetaObject::activate (sender=0x555555c87460, signalOffset=<optimized out>, local_signal_index=<optimized out>, argv=<optimized out>) at kernel/qobject.cpp:3789 #17 0x00007ffff7621211 in KIO::SlaveInterface::finished (this=0x555555c87460) at /home/ahmad/rpmbuild/dev/kio/git/building-dir/src/core/KF5KIOCore_autogen/include/moc_slaveinterface.cpp:453 #18 0x00007ffff761ec2f in KIO::SlaveInterface::dispatch (this=0x555555c87460, _cmd=104, rawdata=...) at /home/ahmad/rpmbuild/dev/kio/git/src/core/slaveinterface.cpp:156 #19 0x00007ffff761e883 in KIO::SlaveInterface::dispatch (this=0x555555c87460) at /home/ahmad/rpmbuild/dev/kio/git/src/core/slaveinterface.cpp:85 #20 0x00007ffff7623bfc in KIO::Slave::gotInput (this=0x555555c87460) at /home/ahmad/rpmbuild/dev/kio/git/src/core/slave.cpp:406 --Type <RET> for more, q to quit, c to continue without paging-- #21 0x00007ffff7626fe4 in QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, void (KIO::Slave::*)()>::call(void (KIO::Slave::*)(), KIO::Slave*, void**) (f=(void (KIO::Slave::*)(KIO::Slave * const)) 0x7ffff7623b96 <KIO::Slave::gotInput()>, o=0x555555c87460, arg=0x7fffffffd6a0) at /usr/include/qt5/QtCore/qobjectdefs_impl.h:152 #22 0x00007ffff7626eab in QtPrivate::FunctionPointer<void (KIO::Slave::*)()>::call<QtPrivate::List<>, void>(void (KIO::Slave::*)(), KIO::Slave*, void**) (f=(void (KIO::Slave::*)(KIO::Slave * const)) 0x7ffff7623b96 <KIO::Slave::gotInput()>, o=0x555555c87460, arg=0x7fffffffd6a0) at /usr/include/qt5/QtCore/qobjectdefs_impl.h:185 #23 0x00007ffff7626b02 in QtPrivate::QSlotObject<void (KIO::Slave::*)(), QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) (which=1, this_=0x555555c88650, r=0x555555c87460, a=0x7fffffffd6a0, ret=0x0) at /usr/include/qt5/QtCore/qobjectdefs_impl.h:414 #24 0x00007ffff5dba638 in QtPrivate::QSlotObjectBase::call (a=0x7fffffffd6a0, r=0x555555c87460, this=0x555555c88650) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:394 #25 QMetaObject::activate (sender=0x555555c87b40, signalOffset=<optimized out>, local_signal_index=<optimized out>, argv=<optimized out>) at kernel/qobject.cpp:3789 #26 0x00007ffff75bbeaf in KIO::Connection::readyRead (this=0x555555c87b40) at /home/ahmad/rpmbuild/dev/kio/git/building-dir/src/core/KF5KIOCore_autogen/include/moc_connection_p.cpp:148 #27 0x00007ffff75baafc in KIO::ConnectionPrivate::dequeue (this=0x555555c87e50) at /home/ahmad/rpmbuild/dev/kio/git/src/core/connection.cpp:44 #28 0x00007ffff75bbcb2 in KIO::Connection::qt_static_metacall (_o=0x555555c87b40, _c=QMetaObject::InvokeMetaMethod, _id=1, _a=0x555555d26fd0) at /home/ahmad/rpmbuild/dev/kio/git/building-dir/src/core/KF5KIOCore_autogen/include/moc_connection_p.cpp:88 #29 0x00007ffff5dbaeea in QObject::event (this=0x555555c87b40, e=<optimized out>) at kernel/qobject.cpp:1260 #30 0x00007ffff688fc62 in QApplicationPrivate::notify_helper (this=this@entry=0x55555557ebe0, receiver=receiver@entry=0x555555c87b40, e=e@entry=0x555555d234a0) at kernel/qapplication.cpp:3703 #31 0x00007ffff68991e0 in QApplication::notify (this=0x7fffffffde10, receiver=0x555555c87b40, e=0x555555d234a0) at kernel/qapplication.cpp:3449 #32 0x00007ffff5d8f572 in QCoreApplication::notifyInternal2 (receiver=0x555555c87b40, event=0x555555d234a0) at ../../include/QtCore/../../src/corelib/kernel/qobject.h:143 #33 0x00007ffff5d92208 in QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x5555555747c0) at kernel/qcoreapplication.cpp:1840 #34 0x00007ffff5de6343 in postEventSourceDispatch (s=0x5555556403a0) at kernel/qeventdispatcher_glib.cpp:277 #35 0x00007ffff3d156b3 in g_main_dispatch (context=0x7fffec004fd0) at ../glib/gmain.c:3189 #36 g_main_context_dispatch (context=context@entry=0x7fffec004fd0) at ../glib/gmain.c:3854 #37 0x00007ffff3d17460 in g_main_context_iterate (context=context@entry=0x7fffec004fd0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/gmain.c:3927 #38 0x00007ffff3d1749f in g_main_context_iteration (context=0x7fffec004fd0, may_block=may_block@entry=1) at ../glib/gmain.c:3988 #39 0x00007ffff5de5981 in QEventDispatcherGlib::processEvents (this=0x55555564fc70, flags=...) at kernel/qeventdispatcher_glib.cpp:423 #40 0x00007ffff5d8e0db in QEventLoop::exec (this=this@entry=0x7fffffffdd10, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:140 #41 0x00007ffff5d95d42 in QCoreApplication::exec () at ../../include/QtCore/../../src/corelib/global/qflags.h:120 #42 0x00007ffff6252d5c in QGuiApplication::exec () at kernel/qguiapplication.cpp:1788 --Type <RET> for more, q to quit, c to continue without paging-- #43 0x00007ffff688fbd5 in QApplication::exec () at kernel/qapplication.cpp:2859 #44 0x00007ffff7dad363 in kdemain (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/dolphin-19.08.1-1.1.x86_64/src/main.cpp:166 #45 0x00007ffff7e0cbcb in __libc_start_main (main=0x555555555050 <main(int, char**)>, argc=1, argv=0x7fffffffdf78, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffdf68) at ../csu/libc-start.c:308 #46 0x000055555555508a in _start () at ../sysdeps/x86_64/start.S:120 Steps to reproduce: - Open dolpin, copy folder A to some destination twice and keep the asFileRename dialog open - Repeat for folder B - Now from the plasma widget cancel the job for folder A (order is important), the dialog is closed as expected - Then cancel the job for folder B, from the widget or the dialog, doesn't matter, and dolphin seg faults The crash seems to happen in NotificationManager::JobPrivate::kill()[1], it emits cancelRequested() and the copy job is finished and askFileRename is closed correctly, but KIO::JobUiDelegate::askFileRename doesn't return; only after you cancel the second dialog, askFileRename returns twice (for both jobs), so the first one doesn't return until the second returns (confirmed by throwing some debug lines in KIO::JobUiDelegate::askFileRename). [1]https://cgit.kde.org/plasma-workspace.git/tree/libnotificationmanager/job_p.cpp#n207 Clean solution described in https://phabricator.kde.org/T12193 *** This bug has been marked as a duplicate of bug 364039 *** https://invent.kde.org/frameworks/kio/-/merge_requests/375 should help prevent the situation where the can happen in the first place (rename dialog should be modal). |