Killability of ImportProjectJob
Milian Wolff
mail at milianw.de
Wed Dec 22 23:08:02 UTC 2010
On Saturday 20 November 2010 18:00:04 Milian Wolff wrote:
> On Saturday 20 November 2010 17:50:31 Milian Wolff wrote:
> > Hey all,
> >
> > currently the ImportProjectJob is not really interruptable. It has doKill
> > that just waitForFinished which can easily lead to deadlocks nowadays,
> > since we can import stuff from the background bug QMetaType::invokeMethod
>
> > in the projectmodel then. E.g.:
> btw, I just notice that this is probably only hit when I try this patch:
<snip>
> Which would be an (imo) awesome addition to KDevelop. It didn't used to
> work as items where added from random threads but now that they are always
> added from the UI it just works™.
Attached you find my second attempt, this time with a nested event loop (and
some other cleanup). The deadlock doesn't occur anymore (of course), but
instead i get nasty crashes, e.g. in the project model, as if the
index.internalPointer static cast returned an invalid item
(ProjectModel::parent()). Or something like this:
Thread 5 (Thread 0x7f9ea2094700 (LWP 26811)):
[KCrash Handler]
#6 0x00007f9ebee84bb1 in KDevelop::ProjectFileItem::setUrl
(this=0x7f9ea841c110, url=...) at
/home/milian/projects/kde4/kdevplatform/project/projectmodel.cpp:681
#7 0x00007f9ebee84759 in KDevelop::ProjectFileItem::ProjectFileItem
(this=0x7f9ea841c110, project=0x3098c20, file=..., parent=0x3009be0) at
/home/milian/projects/kde4/kdevplatform/project/projectmodel.cpp:623
#8 0x00007f9eac139da0 in CMakeManager::reloadFiles (this=0x27c7130,
item=0x3009be0) at
/home/milian/projects/kde4/kdevelop/projectmanagers/cmake/cmakemanager.cpp:889
#9 0x00007f9eac137b99 in CMakeManager::parse (this=0x27c7130, item=0x3009be0)
at
/home/milian/projects/kde4/kdevelop/projectmanagers/cmake/cmakemanager.cpp:556
#10 0x00007f9ebee8ca4f in KDevelop::ImportProjectJobPrivate::import
(this=0x306c580, folder=0x3009be0) at
/home/milian/projects/kde4/kdevplatform/project/importprojectjob.cpp:62
#11 0x00007f9ebee8d026 in
QtConcurrent::VoidStoredMemberFunctionPointerCall1<void,
KDevelop::ImportProjectJobPrivate, KDevelop::ProjectFolderItem*,
KDevelop::ProjectFolderItem*>::runFunctor (this=0x3088320) at
/usr/include/QtCore/qtconcurrentstoredfunctioncall.h:426
#12 0x00007f9ebee8c75c in QtConcurrent::RunFunctionTask<void>::run
(this=0x3088320) at /usr/include/QtCore/qtconcurrentrunbase.h:120
#13 0x00007f9ec1eeeb88 in ?? () from /usr/lib/libQtCore.so.4
#14 0x00007f9ec1ef852e in ?? () from /usr/lib/libQtCore.so.4
#15 0x00007f9ec1c6fc60 in start_thread () from /lib/libpthread.so.0
#16 0x00007f9ec034f7ed in clone () from /lib/libc.so.6
#17 0x0000000000000000 in ?? ()
I'll try to run it through valgrind tomorrow, but maybe you got an idea? Or is
this a bad idea?
Bye
--
Milian Wolff
mail at milianw.de
http://milianw.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: better_import.t1.patch
Type: text/x-patch
Size: 3892 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20101223/44a638b5/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20101223/44a638b5/attachment.sig>
More information about the KDevelop-devel
mailing list