From kdevelop-devel Sat Nov 20 16:50:31 2010 From: Milian Wolff Date: Sat, 20 Nov 2010 16:50:31 +0000 To: kdevelop-devel Subject: Killability of ImportProjectJob Message-Id: <201011201750.31482.mail () milianw ! de> X-MARC-Message: https://marc.info/?l=kdevelop-devel&m=129027195232275 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--===============0228272421==" --===============0228272421== Content-Type: multipart/signed; boundary="nextPart1987287.AsAyogGfl0"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit --nextPart1987287.AsAyogGfl0 Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hey all, currently the ImportProjectJob is not really interruptable. It has doKill t= hat=20 just waitForFinished which can easily lead to deadlocks nowadays, since we = can=20 import stuff from the background bug QMetaType::invokeMethod in the=20 projectmodel then. E.g.: Thread 2 (Thread 0x7fdb25e04710 (LWP 4580)): #0 0x00007fdb44d2f40c in pthread_cond_wait@@GLIBC_2.3.2 () from=20 /lib/libpthread.so.0 #1 0x00007fdb44fb3c2b in QWaitCondition::wait(QMutex*, unsigned long) () f= rom=20 /usr/lib/libQtCore.so.4 #2 0x00007fdb44fb0665 in QSemaphore::acquire(int) () from=20 /usr/lib/libQtCore.so.4 #3 0x00007fdb450a4abc in QMetaMethod::invoke(QObject*, Qt::ConnectionType,= =20 QGenericReturnArgument, QGenericArgument, QGenericArgument, QGenericArgumen= t,=20 QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument,=20 QGenericArgument, QGenericArgument, QGenericArgument) const () from=20 /usr/lib/libQtCore.so.4 #4 0x00007fdb450a5728 in QMetaObject::invokeMethod(QObject*, char const*,= =20 Qt::ConnectionType, QGenericReturnArgument, QGenericArgument,=20 QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument,=20 QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument,=20 QGenericArgument) () from /usr/lib/libQtCore.so.4 #5 0x00007fdb42148226 in QMetaObject::invokeMethod (obj=3D0x17a9aa0,=20 member=3D0x7fdb4215e472 "rowsAboutToBeInserted",=20 type=3DQt::BlockingQueuedConnection, val0=3D..., val1=3D...,=20 val2=3D..., val3=3D..., val4=3D..., val5=3D..., val6=3D..., val7=3D...,= val8=3D...,=20 val9=3D...) at /usr/include/QtCore/qobjectdefs.h:408 #6 0x00007fdb42144cb7 in KDevelop::ProjectBaseItem::appendRow=20 (this=3D0x7fdb1016dea0, item=3D0x7fdb182f9d40) at=20 /home/milian/projects/kde4/kdevplatform/project/projectmodel.cpp:342 #7 0x00007fdb4214377f in KDevelop::ProjectBaseItem::ProjectBaseItem=20 (this=3D0x7fdb182f9d40, project=3D0x39be940, name=3D"importImages.php",=20 parent=3D0x7fdb1016dea0) at /home/milian/projects/kde4/kdevplatform/project/projectmodel.cpp:138 #8 0x00007fdb42145cfe in KDevelop::ProjectFileItem::ProjectFileItem=20 (this=3D0x7fdb182f9d40, project=3D0x39be940, file=3D..., parent=3D0x7fdb101= 6dea0) at /home/milian/projects/kde4/kdevplatform/project/projectmodel.cpp:582 #9 0x00007fdb0e804177 in CustomMakeManager::parse (this=3D0x250aee0,=20 item=3D0x7fdb1016dea0) at=20 /home/milian/projects/kde4/kdevelop/projectmanagers/custommake/custommakema= nager.cpp:171 #10 0x00007fdb4214da5b in KDevelop::ImportProjectJobPrivate::import=20 (this=3D0x2c84620, folder=3D0x7fdb1016dea0) at /home/milian/projects/kde4/kdevplatform/project/importprojectjob.cpp= :53 =2D--Type to continue, or q to quit--- #11 0x00007fdb4214daa9 in KDevelop::ImportProjectJobPrivate::import=20 (this=3D0x2c84620, folder=3D0x261d770) at=20 /home/milian/projects/kde4/kdevplatform/project/importprojectjob.cpp:57 #12 0x00007fdb4214e090 in=20 QtConcurrent::VoidStoredMemberFunctionPointerCall1::runFunctor (this=3D0x16967a0) at=20 /usr/include/QtCore/qtconcurrentstoredfunctioncall.h:426 #13 0x00007fdb4214d7d0 in QtConcurrent::RunFunctionTask::run=20 (this=3D0x16967a0) at /usr/include/QtCore/qtconcurrentrunbase.h:120 #14 0x00007fdb44fa9b88 in ?? () from /usr/lib/libQtCore.so.4 #15 0x00007fdb44fb353e in ?? () from /usr/lib/libQtCore.so.4 #16 0x00007fdb44d2acb0 in start_thread () from /lib/libpthread.so.0 #17 0x00007fdb434089dd in clone () from /lib/libc.so.6 #18 0x0000000000000000 in ?? () Thread 1 (Thread 0x7fdb48b60760 (LWP 4287)): #0 0x00007fdb44d2f40c in pthread_cond_wait@@GLIBC_2.3.2 () from=20 /lib/libpthread.so.0 #1 0x00007fdb44fb3c2b in QWaitCondition::wait(QMutex*, unsigned long) () f= rom=20 /usr/lib/libQtCore.so.4 #2 0x00007fdb44fa3914 in QFutureInterfaceBase::waitForFinished() () from=20 /usr/lib/libQtCore.so.4 #3 0x00007fdb4214d33f in KDevelop::ImportProjectJob::doKill (this=3D0x28ce= 9f0)=20 at /home/milian/projects/kde4/kdevplatform/project/importprojectjob.cpp:104 #4 0x00007fdb486091e1 in KJob::kill(KJob::KillVerbosity) () from=20 /usr/lib/libkdecore.so.5 #5 0x00007fdb4801433b in KDevelop::RunController::stopAllProcesses=20 (this=3D0x196c5d0) at=20 /home/milian/projects/kde4/kdevplatform/shell/runcontroller.cpp:591 #6 0x00007fdb480122d7 in KDevelop::RunController::cleanup (this=3D0x196c5d= 0) at=20 /home/milian/projects/kde4/kdevplatform/shell/runcontroller.cpp:328 #7 0x00007fdb47fe57eb in KDevelop::Core::cleanup (this=3D0x162bf80) at=20 /home/milian/projects/kde4/kdevplatform/shell/core.cpp:332 #8 0x00007fdb47fd0b84 in KDevelop::MainWindow::~MainWindow (this=3D0x1477e= 20,=20 __in_chrg=3D, __vtt_parm=3D) at /home/milian/projects/kde4/kdevplatform/shell/mainwindow.cpp:127 #9 0x00007fdb47fd0c9a in KDevelop::MainWindow::~MainWindow (this=3D0x1477e= 20,=20 __in_chrg=3D, __vtt_parm=3D) at /home/milian/projects/kde4/kdevplatform/shell/mainwindow.cpp:133 #10 0x00007fdb450b01c8 in QObject::event(QEvent*) () from=20 /usr/lib/libQtCore.so.4 #11 0x00007fdb4429931d in QWidget::event(QEvent*) () from=20 /usr/lib/libQtGui.so.4 #12 0x00007fdb4465d6db in QMainWindow::event(QEvent*) () from=20 /usr/lib/libQtGui.so.4 #13 0x00007fdb4596afb3 in KXmlGuiWindow::event(QEvent*) () from=20 /usr/lib/libkdeui.so.5 #14 0x00007fdb442482b4 in QApplicationPrivate::notify_helper(QObject*,=20 QEvent*) () from /usr/lib/libQtGui.so.4 #15 0x00007fdb4424cdca in QApplication::notify(QObject*, QEvent*) () from=20 /usr/lib/libQtGui.so.4 #16 0x00007fdb45868226 in KApplication::notify(QObject*, QEvent*) () from=20 /usr/lib/libkdeui.so.5 =2D--Type to continue, or q to quit--- #17 0x000000000040528c in KDevelopApplication::notify (this=3D0x7fff7abb945= 0,=20 receiver=3D0x1477e20, event=3D0x31a0e80) at=20 /home/milian/projects/kde4/kdevelop/app/main.cpp:90 #18 0x00007fdb4509bebc in QCoreApplication::notifyInternal(QObject*, QEvent= *)=20 () from /usr/lib/libQtCore.so.4 #19 0x00007fdb4509f6e5 in QCoreApplicationPrivate::sendPostedEvents(QObject= *,=20 int, QThreadData*) () from /usr/lib/libQtCore.so.4 #20 0x00007fdb450c6db3 in ?? () from /usr/lib/libQtCore.so.4 #21 0x00007fdb3e0a3bf3 in g_main_context_dispatch () from=20 /usr/lib/libglib-2.0.so.0 #22 0x00007fdb3e0a43d0 in ?? () from /usr/lib/libglib-2.0.so.0 #23 0x00007fdb3e0a466d in g_main_context_iteration () from=20 /usr/lib/libglib-2.0.so.0 #24 0x00007fdb450c6f4f in=20 QEventDispatcherGlib::processEvents(QFlags) = ()=20 from /usr/lib/libQtCore.so.4 #25 0x00007fdb442ed23e in ?? () from /usr/lib/libQtGui.so.4 #26 0x00007fdb4509b252 in=20 QEventLoop::processEvents(QFlags) () from=20 /usr/lib/libQtCore.so.4 #27 0x00007fdb4509b49c in=20 QEventLoop::exec(QFlags) () from=20 /usr/lib/libQtCore.so.4 #28 0x00007fdb4509f99b in QCoreApplication::exec() () from=20 /usr/lib/libQtCore.so.4 #29 0x000000000040b774 in main (argc=3D3, argv=3D0x7fff7abbb218) at=20 /home/milian/projects/kde4/kdevelop/app/main.cpp:468 (gdb) I could add e.g. ICore::shuttingDown() calls just before all invokeMethod=20 calls, but that might still deadlock sometimes (rarely) and it's imo just n= ot=20 nice. So - has anyone an idea how to solve this properly? Bye =2D-=20 Milian Wolff mail@milianw.de http://milianw.de --nextPart1987287.AsAyogGfl0 Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iEYEABECAAYFAkzn/FcACgkQDA6yEs0dE5NDlQCfVl/3n74yqMff4fmzqFpoPEJu aPYAn16kcM9vJrxKcGAGEPQkF4SBfF/P =qlyu -----END PGP SIGNATURE----- --nextPart1987287.AsAyogGfl0-- --===============0228272421== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline -- KDevelop-devel mailing list KDevelop-devel@kdevelop.org https://barney.cs.uni-potsdam.de/mailman/listinfo/kdevelop-devel --===============0228272421==--