Bug 224337

Summary: generic project manager crash: reloading a folder while a parent folder reloads
Product: [Applications] kdevelop Reporter: Markus <markus.hauser>
Component: generalAssignee: kdevelop-bugs-null
Status: RESOLVED WORKSFORME    
Severity: crash CC: aleixpol, aspotashev, markus.hauser, sailorweb2, xcojack
Priority: NOR Keywords: investigated, triaged
Version: unspecified   
Target Milestone: ---   
Platform: Unlisted Binaries   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: New crash information added by DrKonqi
New crash information added by DrKonqi

Description Markus 2010-01-26 16:20:20 UTC
Application that crashed: kdevelop
Version of the application: 3.9.97 (using KDevPlatform 0.9.97)
KDE Version: 4.3.2 (KDE 4.3.2)
Qt Version: 4.5.2
Operating System: Linux 2.6.31-14-generic x86_64
Distribution: Ubuntu 9.10

What I was doing when the application crashed:
To reproduce the crash you need some bigger project (i'm using php):

- Right click on the main folder of an open project an click refresh.
- While it refreshes, click into some sub-folders, until there a no more + beside the folders (but there are more sub levels available, they just weren't yet refreshed)
- Right click on such a folder and click refresh, while the parent refresh process still runs
- Crash - kdevelop aint on the screen anymore.

 -- Backtrace:
Application: KDevelop (kdevelop), signal: Segmentation fault
The current source language is "auto; currently c".
[Current thread is 1 (Thread 0x7f5d56833750 (LWP 2658))]

Thread 9 (Thread 0x7f5d434c4910 (LWP 2659)):
#0  pthread_cond_timedwait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:220
#1  0x00007f5d5344f462 in QWaitConditionPrivate::wait (this=<value optimized out>, mutex=0x294d6b0, time=200000) at thread/qwaitcondition_unix.cpp:85
#2  QWaitCondition::wait (this=<value optimized out>, mutex=0x294d6b0, time=200000) at thread/qwaitcondition_unix.cpp:159
#3  0x00007f5d4fec2b79 in KDevelop::DUChainPrivate::CleanupThread::run (this=0x294d690) at /home/markus/kdesource/kdevplatform/language/duchain/duchain.cpp:286
#4  0x00007f5d5344e445 in QThreadPrivate::start (arg=0x294d690) at thread/qthread_unix.cpp:188
#5  0x00007f5d4dd4ba04 in start_thread (arg=<value optimized out>) at pthread_create.c:300
#6  0x00007f5d51ba980d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#7  0x0000000000000000 in ?? ()

Thread 8 (Thread 0x7f5d35843910 (LWP 2665)):
#0  0x00007f5d51b9d3c3 in *__GI___poll (fds=<value optimized out>, nfds=<value optimized out>, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:87
#1  0x00007f5d4cc7537c in ?? () from /lib/libglib-2.0.so.0
#2  0x00007f5d4cc756c0 in g_main_context_iteration () from /lib/libglib-2.0.so.0
#3  0x00007f5d5355d1fe in QEventDispatcherGlib::processEvents (this=0x326bff0, flags=<value optimized out>) at kernel/qeventdispatcher_glib.cpp:329
#4  0x00007f5d53533532 in QEventLoop::processEvents (this=<value optimized out>, flags=) at kernel/qeventloop.cpp:149
#5  0x00007f5d53533904 in QEventLoop::exec (this=0x7f5d35843010, flags=) at kernel/qeventloop.cpp:201
#6  0x00007f5d5344b6cb in QThread::exec (this=<value optimized out>) at thread/qthread.cpp:487
#7  0x00007f5d4fff675f in KDevelop::CompletionWorkerThread::run (this=0x3263b40) at /home/markus/kdesource/kdevplatform/language/codecompletion/codecompletionmodel.cpp:82
#8  0x00007f5d5344e445 in QThreadPrivate::start (arg=0x3263b40) at thread/qthread_unix.cpp:188
#9  0x00007f5d4dd4ba04 in start_thread (arg=<value optimized out>) at pthread_create.c:300
#10 0x00007f5d51ba980d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#11 0x0000000000000000 in ?? ()
The current source language is "auto; currently asm".

Thread 7 (Thread 0x7f5d35042910 (LWP 2690)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:261
#1  0x00007f5d5344f4fb in QWaitConditionPrivate::wait (this=<value optimized out>, mutex=0x2888870, time=18446744073709551615) at thread/qwaitcondition_unix.cpp:87
#2  QWaitCondition::wait (this=<value optimized out>, mutex=0x2888870, time=18446744073709551615) at thread/qwaitcondition_unix.cpp:159
#3  0x00007f5d54c5a326 in ThreadWeaver::WeaverImpl::blockThreadUntilJobsAreBeingAssigned (this=0x288edb0, th=0x3280d30) at ../../../threadweaver/Weaver/WeaverImpl.cpp:365
#4  0x00007f5d54c5c45b in ThreadWeaver::WorkingHardState::applyForWork (this=0x288e1f0, th=0x3280d30) at ../../../threadweaver/Weaver/WorkingHardState.cpp:71
#5  0x00007f5d54c5c474 in ThreadWeaver::WorkingHardState::applyForWork (this=0x288e1f0, th=0x3280d30) at ../../../threadweaver/Weaver/WorkingHardState.cpp:74
#6  0x00007f5d54c5aa5f in ThreadWeaver::ThreadRunHelper::run (this=0x7f5d35042050, parent=0x288edb0, th=0x3280d30) at ../../../threadweaver/Weaver/Thread.cpp:87
#7  0x00007f5d54c5aeb8 in ThreadWeaver::Thread::run (this=0x3280d30) at ../../../threadweaver/Weaver/Thread.cpp:142
#8  0x00007f5d5344e445 in QThreadPrivate::start (arg=0x3280d30) at thread/qthread_unix.cpp:188
#9  0x00007f5d4dd4ba04 in start_thread (arg=<value optimized out>) at pthread_create.c:300
#10 0x00007f5d51ba980d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#11 0x0000000000000000 in ?? ()
The current source language is "auto; currently c".

Thread 6 (Thread 0x7f5d30894910 (LWP 2691)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:261
#1  0x00007f5d5344f4fb in QWaitConditionPrivate::wait (this=<value optimized out>, mutex=0x3e81090, time=18446744073709551615) at thread/qwaitcondition_unix.cpp:87
#2  QWaitCondition::wait (this=<value optimized out>, mutex=0x3e81090, time=18446744073709551615) at thread/qwaitcondition_unix.cpp:159
#3  0x00007f5d54c5a326 in ThreadWeaver::WeaverImpl::blockThreadUntilJobsAreBeingAssigned (this=0x3e94a50, th=0x3e79780) at ../../../threadweaver/Weaver/WeaverImpl.cpp:365
#4  0x00007f5d54c5c45b in ThreadWeaver::WorkingHardState::applyForWork (this=0x3e81170, th=0x3e79780) at ../../../threadweaver/Weaver/WorkingHardState.cpp:71
#5  0x00007f5d54c5aa5f in ThreadWeaver::ThreadRunHelper::run (this=0x7f5d30894050, parent=0x3e94a50, th=0x3e79780) at ../../../threadweaver/Weaver/Thread.cpp:87
#6  0x00007f5d54c5aeb8 in ThreadWeaver::Thread::run (this=0x3e79780) at ../../../threadweaver/Weaver/Thread.cpp:142
#7  0x00007f5d5344e445 in QThreadPrivate::start (arg=0x3e79780) at thread/qthread_unix.cpp:188
#8  0x00007f5d4dd4ba04 in start_thread (arg=<value optimized out>) at pthread_create.c:300
#9  0x00007f5d51ba980d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#10 0x0000000000000000 in ?? ()
The current source language is "auto; currently asm".

Thread 5 (Thread 0x7f5d30093910 (LWP 2692)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:261
#1  0x00007f5d5344f4fb in QWaitConditionPrivate::wait (this=<value optimized out>, mutex=0x2888870, time=18446744073709551615) at thread/qwaitcondition_unix.cpp:87
#2  QWaitCondition::wait (this=<value optimized out>, mutex=0x2888870, time=18446744073709551615) at thread/qwaitcondition_unix.cpp:159
#3  0x00007f5d54c5a326 in ThreadWeaver::WeaverImpl::blockThreadUntilJobsAreBeingAssigned (this=0x288edb0, th=0x3d46350) at ../../../threadweaver/Weaver/WeaverImpl.cpp:365
#4  0x00007f5d54c5c45b in ThreadWeaver::WorkingHardState::applyForWork (this=0x288e1f0, th=0x3d46350) at ../../../threadweaver/Weaver/WorkingHardState.cpp:71
#5  0x00007f5d54c5aa5f in ThreadWeaver::ThreadRunHelper::run (this=0x7f5d30093050, parent=0x288edb0, th=0x3d46350) at ../../../threadweaver/Weaver/Thread.cpp:87
#6  0x00007f5d54c5aeb8 in ThreadWeaver::Thread::run (this=0x3d46350) at ../../../threadweaver/Weaver/Thread.cpp:142
#7  0x00007f5d5344e445 in QThreadPrivate::start (arg=0x3d46350) at thread/qthread_unix.cpp:188
#8  0x00007f5d4dd4ba04 in start_thread (arg=<value optimized out>) at pthread_create.c:300
#9  0x00007f5d51ba980d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#10 0x0000000000000000 in ?? ()

Thread 4 (Thread 0x7f5d2f892910 (LWP 2694)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:261
#1  0x00007f5d5344f4fb in QWaitConditionPrivate::wait (this=<value optimized out>, mutex=0x3e81090, time=18446744073709551615) at thread/qwaitcondition_unix.cpp:87
#2  QWaitCondition::wait (this=<value optimized out>, mutex=0x3e81090, time=18446744073709551615) at thread/qwaitcondition_unix.cpp:159
#3  0x00007f5d54c5a326 in ThreadWeaver::WeaverImpl::blockThreadUntilJobsAreBeingAssigned (this=0x3e94a50, th=0x3dd0d10) at ../../../threadweaver/Weaver/WeaverImpl.cpp:365
#4  0x00007f5d54c5c45b in ThreadWeaver::WorkingHardState::applyForWork (this=0x3e81170, th=0x3dd0d10) at ../../../threadweaver/Weaver/WorkingHardState.cpp:71
#5  0x00007f5d54c5c474 in ThreadWeaver::WorkingHardState::applyForWork (this=0x3e81170, th=0x3dd0d10) at ../../../threadweaver/Weaver/WorkingHardState.cpp:74
#6  0x00007f5d54c5aa5f in ThreadWeaver::ThreadRunHelper::run (this=0x7f5d2f892050, parent=0x3e94a50, th=0x3dd0d10) at ../../../threadweaver/Weaver/Thread.cpp:87
#7  0x00007f5d54c5aeb8 in ThreadWeaver::Thread::run (this=0x3dd0d10) at ../../../threadweaver/Weaver/Thread.cpp:142
#8  0x00007f5d5344e445 in QThreadPrivate::start (arg=0x3dd0d10) at thread/qthread_unix.cpp:188
#9  0x00007f5d4dd4ba04 in start_thread (arg=<value optimized out>) at pthread_create.c:300
#10 0x00007f5d51ba980d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#11 0x0000000000000000 in ?? ()

Thread 3 (Thread 0x7f5d26054910 (LWP 3362)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:261
#1  0x00007f5d5344f4fb in QWaitConditionPrivate::wait (this=<value optimized out>, mutex=0x3e81090, time=18446744073709551615) at thread/qwaitcondition_unix.cpp:87
#2  QWaitCondition::wait (this=<value optimized out>, mutex=0x3e81090, time=18446744073709551615) at thread/qwaitcondition_unix.cpp:159
#3  0x00007f5d54c5a326 in ThreadWeaver::WeaverImpl::blockThreadUntilJobsAreBeingAssigned (this=0x3e94a50, th=0x56a4760) at ../../../threadweaver/Weaver/WeaverImpl.cpp:365
#4  0x00007f5d54c5c45b in ThreadWeaver::WorkingHardState::applyForWork (this=0x3e81170, th=0x56a4760) at ../../../threadweaver/Weaver/WorkingHardState.cpp:71
#5  0x00007f5d54c5c474 in ThreadWeaver::WorkingHardState::applyForWork (this=0x3e81170, th=0x56a4760) at ../../../threadweaver/Weaver/WorkingHardState.cpp:74
#6  0x00007f5d54c5c474 in ThreadWeaver::WorkingHardState::applyForWork (this=0x3e81170, th=0x56a4760) at ../../../threadweaver/Weaver/WorkingHardState.cpp:74
#7  0x00007f5d54c5c474 in ThreadWeaver::WorkingHardState::applyForWork (this=0x3e81170, th=0x56a4760) at ../../../threadweaver/Weaver/WorkingHardState.cpp:74
#8  0x00007f5d54c5c474 in ThreadWeaver::WorkingHardState::applyForWork (this=0x3e81170, th=0x56a4760) at ../../../threadweaver/Weaver/WorkingHardState.cpp:74
#9  0x00007f5d54c5aa5f in ThreadWeaver::ThreadRunHelper::run (this=0x7f5d26054050, parent=0x3e94a50, th=0x56a4760) at ../../../threadweaver/Weaver/Thread.cpp:87
#10 0x00007f5d54c5aeb8 in ThreadWeaver::Thread::run (this=0x56a4760) at ../../../threadweaver/Weaver/Thread.cpp:142
#11 0x00007f5d5344e445 in QThreadPrivate::start (arg=0x56a4760) at thread/qthread_unix.cpp:188
#12 0x00007f5d4dd4ba04 in start_thread (arg=<value optimized out>) at pthread_create.c:300
#13 0x00007f5d51ba980d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#14 0x0000000000000000 in ?? ()

Thread 2 (Thread 0x7f5d17fff910 (LWP 4391)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:261
#1  0x00007f5d5344f4fb in QWaitConditionPrivate::wait (this=<value optimized out>, mutex=0x3e81090, time=18446744073709551615) at thread/qwaitcondition_unix.cpp:87
#2  QWaitCondition::wait (this=<value optimized out>, mutex=0x3e81090, time=18446744073709551615) at thread/qwaitcondition_unix.cpp:159
#3  0x00007f5d54c5a326 in ThreadWeaver::WeaverImpl::blockThreadUntilJobsAreBeingAssigned (this=0x3e94a50, th=0x3c979a0) at ../../../threadweaver/Weaver/WeaverImpl.cpp:365
#4  0x00007f5d54c5c45b in ThreadWeaver::WorkingHardState::applyForWork (this=0x3e81170, th=0x3c979a0) at ../../../threadweaver/Weaver/WorkingHardState.cpp:71
#5  0x00007f5d54c5c474 in ThreadWeaver::WorkingHardState::applyForWork (this=0x3e81170, th=0x3c979a0) at ../../../threadweaver/Weaver/WorkingHardState.cpp:74
#6  0x00007f5d54c5c474 in ThreadWeaver::WorkingHardState::applyForWork (this=0x3e81170, th=0x3c979a0) at ../../../threadweaver/Weaver/WorkingHardState.cpp:74
#7  0x00007f5d54c5c474 in ThreadWeaver::WorkingHardState::applyForWork (this=0x3e81170, th=0x3c979a0) at ../../../threadweaver/Weaver/WorkingHardState.cpp:74
#8  0x00007f5d54c5aa5f in ThreadWeaver::ThreadRunHelper::run (this=0x7f5d17fff050, parent=0x3e94a50, th=0x3c979a0) at ../../../threadweaver/Weaver/Thread.cpp:87
#9  0x00007f5d54c5aeb8 in ThreadWeaver::Thread::run (this=0x3c979a0) at ../../../threadweaver/Weaver/Thread.cpp:142
#10 0x00007f5d5344e445 in QThreadPrivate::start (arg=0x3c979a0) at thread/qthread_unix.cpp:188
#11 0x00007f5d4dd4ba04 in start_thread (arg=<value optimized out>) at pthread_create.c:300
#12 0x00007f5d51ba980d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#13 0x0000000000000000 in ?? ()

Thread 1 (Thread 0x7f5d56833750 (LWP 2658)):
[KCrash Handler]
#4  QUrlPrivate::parse (this=0x43e1ea0, parseOptions=QUrlPrivate::ParseAndSet) at io/qurl.cpp:3584
#5  0x00007f5d534f4784 in QUrl::scheme (this=0x5def068) at io/qurl.cpp:4182
#6  0x00007f5d562bf5c6 in hasSubUrl (this=<value optimized out>) at ../../kdecore/io/kurl.cpp:934
#7  KUrl::hasSubUrl (this=<value optimized out>) at ../../kdecore/io/kurl.cpp:978
#8  0x00007f5d558542c2 in SimpleJobPrivate (this=0x5deefd0, url=<value optimized out>, command=71, packedArgs=<value optimized out>) at ../../kio/kio/job_p.h:86
#9  0x00007f5d55847e54 in ListJobPrivate (url=..., flags=<value optimized out>, includeHidden=true) at ../../kio/kio/job.cpp:2231
#10 KIO::ListJobPrivate::newJob (url=..., flags=<value optimized out>, includeHidden=true) at ../../kio/kio/job.cpp:2256
#11 KIO::listDir (url=..., flags=<value optimized out>, includeHidden=true) at ../../kio/kio/job.cpp:2435
#12 0x00007f5d3089b4e0 in GenericManagerListJob::startNextJob (this=0x4c019d0) at /home/markus/kdesource/kdevplatform/plugins/genericprojectmanager/genericmanagerlistjob.cpp:66
#13 0x00007f5d3089b896 in GenericManagerListJob::qt_metacall (this=0x4c019d0, _c=QMetaObject::InvokeMetaMethod, _id=5, _a=0x4003d60)
    at /home/markus/kdesource/build/kdevplatform/plugins/genericprojectmanager/genericmanagerlistjob.moc:86
#14 0x00007f5d535440f9 in QObject::event (this=0x4c019d0, e=0x5d777d0) at kernel/qobject.cpp:1111
#15 0x00007f5d52784efc in QApplicationPrivate::notify_helper (this=0x2554700, receiver=0x4c019d0, e=0x5d777d0) at kernel/qapplication.cpp:4056
#16 0x00007f5d5278c1ce in QApplication::notify (this=0x7fffefa9b010, receiver=0x4c019d0, e=0x5d777d0) at kernel/qapplication.cpp:4021
#17 0x00007f5d53cbbab6 in KApplication::notify (this=0x7fffefa9b010, receiver=0x4c019d0, event=0x5d777d0) at ../../kdeui/kernel/kapplication.cpp:302
#18 0x00007f5d53534c2c in QCoreApplication::notifyInternal (this=0x7fffefa9b010, receiver=0x4c019d0, event=0x5d777d0) at kernel/qcoreapplication.cpp:610
#19 0x00007f5d5353580a in QCoreApplication::sendEvent (receiver=0x0, event_type=<value optimized out>, data=0x1cb8c40) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:213
#20 QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=<value optimized out>, data=0x1cb8c40) at kernel/qcoreapplication.cpp:1247
#21 0x00007f5d5355d533 in QCoreApplication::sendPostedEvents (s=<value optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:218
#22 postEventSourceDispatch (s=<value optimized out>) at kernel/qeventdispatcher_glib.cpp:210
#23 0x00007f5d4cc71bce in g_main_context_dispatch () from /lib/libglib-2.0.so.0
#24 0x00007f5d4cc75598 in ?? () from /lib/libglib-2.0.so.0
#25 0x00007f5d4cc756c0 in g_main_context_iteration () from /lib/libglib-2.0.so.0
#26 0x00007f5d5355d1a6 in QEventDispatcherGlib::processEvents (this=0x1cb8870, flags=<value optimized out>) at kernel/qeventdispatcher_glib.cpp:327
#27 0x00007f5d528194be in QGuiEventDispatcherGlib::processEvents (this=0x43e1ea0, flags=<value optimized out>) at kernel/qguieventdispatcher_glib.cpp:202
#28 0x00007f5d53533532 in QEventLoop::processEvents (this=<value optimized out>, flags=) at kernel/qeventloop.cpp:149
#29 0x00007f5d53533904 in QEventLoop::exec (this=0x7fffefa9aee0, flags=) at kernel/qeventloop.cpp:201
#30 0x00007f5d53535ab9 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:888
#31 0x00000000004063de in main (argc=1, argv=0x7fffefa9c228) at /home/markus/kdesource/kdevelop/app/main.cpp:209
The current source language is "auto; currently c".

Reported using DrKonqi
Comment 1 Andreas Pakulat 2010-01-26 17:45:10 UTC
I'm not sure I understand what you're describing. IIRC If you "Reload" a project item its completely removed from the tree and only re-added once the reloading is done. 

@Milian: Or does the generic manager do this differently?
Comment 2 Milian Wolff 2010-01-26 18:08:44 UTC
I can easily crash KDevelop by selecting multiple sibling folders and request a reload from the context menu...

[KCrash Handler]
#6  0xb6e35019 in QUrl (this=0xb615c88, other=...) at io/qurl.cpp:3936
#7  0xb7e47c79 in KUrl (this=0xb615c88, _u=...) at ../../kdecore/io/kurl.cpp:468
#8  0xb7a9a26e in SimpleJobPrivate (this=0xb615c38, url=..., command=71, packedArgs=...) at ../../kio/kio/job_p.h:84
#9  0xb7a8d467 in ListJobPrivate (url=..., flags=..., includeHidden=true) at ../../kio/kio/job.cpp:2231
#10 KIO::ListJobPrivate::newJob (url=..., flags=..., includeHidden=true) at ../../kio/kio/job.cpp:2256
#11 KIO::listDir (url=..., flags=..., includeHidden=true) at ../../kio/kio/job.cpp:2435
#12 0xa811ca78 in GenericManagerListJob::startNextJob (this=0xb658a48) at /home/milianw/projects/kde4/kdevplatform/plugins/genericprojectmanager/genericmanagerlistjob.cpp:66
#13 0xa811cc60 in GenericManagerListJob::qt_metacall (this=0xb658a48, _c=QMetaObject::InvokeMetaMethod, _id=5, _a=0xafd23d0)
    at /home/milianw/projects/.build/kde4/kdevplatform/plugins/genericprojectmanager/genericmanagerlistjob.moc:86

Though as you can see the locs are slightly different... Maybe due to different KDE/Qt versions (here on Debian Squeeze). And I think I just reproduced it the way the reported explained and get the same crash trace as I just pasted. I'll have to investigate this.

Regarding the difference: Yes, everything is removed first, but we add items as soon as possible to the model, which is imo far superior compared to the CMake way. Esp. since this way it doesn't look like KDevelop lags, but one can directly see that it instantly fills the project. Of course this is problematic when one requests the reload of a (only partially) reloaded sub-tree.

@Apaku: please don't add me as CC to any KDevelop/Kate bugs, I get those mails anyways. If I'm CCed as well, I get them twice ;-)
Comment 3 Milian Wolff 2010-01-26 19:06:56 UTC
SVN commit 1080684 by mwolff:

reload the selected folder, not the whole project
CCBUG: 224337

 M  +4 -3      genericmanager.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1080684
Comment 4 Milian Wolff 2010-01-28 01:56:49 UTC
SVN commit 1081253 by mwolff:

only trigger a reload for the top-most selected folders, fixes crash in generic manager when a nested directories where selected and a reload was requested
CCBUG: 224337

 M  +20 -1     projectmanagerviewplugin.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1081253
Comment 5 Markus 2010-01-28 17:08:37 UTC
Just tried the new trunk version and it doesn't crash anymore, because it only reloads the current marked folder.
Personally, I would expect that the folder is reloaded recursively, because I cant click reload on every directory. Is there still work in progress regarding this?
P.S.: My Project is mounted via NFS, so the file changes don't reload themselves.
Comment 6 Milian Wolff 2010-01-28 17:16:37 UTC
Hum? You are right, looks like I broke something... Thanks for notifying me.

And it should actually still crash under certain circumstances ;-) I'm working on it, which is why this bug is not yet marked as "resolved".
Comment 7 Milian Wolff 2010-01-28 18:07:14 UTC
SVN commit 1081536 by mwolff:

recurse into existing folders when reloading a given folder
note: reload is incremental, hence you don't see such a big difference as e.g. in the cmake manager where everything is removed and added again
CCBUG: 224337

 M  +11 -6     genericmanager.cpp  
 M  +3 -2      genericmanager.h  
 M  +3 -3      genericmanagerlistjob.cpp  
 M  +3 -2      genericmanagerlistjob.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1081536
Comment 8 Markus 2010-05-04 11:05:27 UTC
Created attachment 43218 [details]
New crash information added by DrKonqi

Version 1.0 / 4.0 (just compiled from git)

Just reproduced a similar bug of which I think is related to this one:
- Have a bigger project in generic project manager
- Right-click -> reload on an outer folder
- while it reloads, delete a folder (i deleted one that is a 3-level-subfolder of the project root folder)
- crash
Comment 9 Niko Sams 2010-05-17 20:21:46 UTC
commit e90fdf66050127b6fc7d4c520dbafac255f2aa82
Author: Niko Sams <niko.sams@gmail.com>
Date:   Mon May 17 20:12:36 2010 +0200

    Add another test that creates a lot of files
    
    The test crashes for me about 2 out of 3 runs with a backtrace similar to:
     #0  0x00007ffff1064ee3 in KDevelop::ProjectBaseItem::project (this=0x254a180)
         at /home/niko/kdesvn/kdevelop/kdevplatform/project/projectmodel.cpp:180
     #1  0x00007fffd66f2c51 in GenericProjectManager::addJobItems (this=0x1be0d70, baseItem=0x254a180, entries=QList<KIO::UDSEntry> = {...},
         forceRecursion=false) at /home/niko/kdesvn/kdevelop/kdevplatform/plugins/genericprojectmanager/genericmanager.cpp:177
     #2  0x00007fffd66f3544 in GenericProjectManager::qt_metacall (this=0x1be0d70, _c=QMetaObject::InvokeMetaMethod, _id=3, _a=0x7fffffffb410)
         at /home/niko/kdesvn/build/kdevelop/kdevplatform/plugins/genericprojectmanager/genericmanager.moc:101
     #3  0x00007ffff4bca8a7 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib64/qt4/libQtCore.so.4
     #4  0x00007fffd66eefcc in GenericManagerListJob::entries (this=0x2574fb0, _t1=0x254a180, _t2=QList<KIO::UDSEntry> = {...}, _t3=false)
         at /home/niko/kdesvn/build/kdevelop/kdevplatform/plugins/genericprojectmanager/genericmanagerlistjob.moc:105
     #5  0x00007fffd66ef0a3 in GenericManagerListJob::slotResult (this=0x2574fb0, job=0x20a07a0)
         at /home/niko/kdesvn/kdevelop/kdevplatform/plugins/genericprojectmanager/genericmanagerlistjob.cpp:64
    
    CCBUG: 224337

diff --git a/plugins/genericprojectmanager/test/reloadtest.cpp b/plugins/genericprojectmanager/test/reloadtest.cpp
index d513bf9..094db44 100644
--- a/plugins/genericprojectmanager/test/reloadtest.cpp
+++ b/plugins/genericprojectmanager/test/reloadtest.cpp
@@ -35,11 +35,29 @@
 
 QTEST_KDEMAIN(ProjectLoadTest, GUI)
 
+void exec(const QString &cmd)
+{
+    QProcess proc;
+    proc.setProcessChannelMode(QProcess::ForwardedChannels);
+    proc.start(cmd);
+    proc.waitForFinished();
+    Q_ASSERT(proc.exitStatus() == QProcess::NormalExit);
+    Q_ASSERT(proc.exitStatus() == 0);
+}
+
 void ProjectLoadTest::init()
 {
+    exec("bash -c \"rm -r testproject*\"");
+
     KDevelop::AutoTestShell::init();
     m_core = new KDevelop::TestCore();
     m_core->initialize( KDevelop::Core::Default );
+
+    QTest::qWait(500); //wait for previously loaded projects
+    foreach (KDevelop::IProject *p, KDevelop::ICore::self()->projectController()->projects()) {
+        KDevelop::ICore::self()->projectController()->closeProject(p);
+    }
+    Q_ASSERT(KDevelop::ICore::self()->projectController()->projects().isEmpty());
 }
 
 void ProjectLoadTest::cleanup()
@@ -48,14 +66,8 @@ void ProjectLoadTest::cleanup()
     delete m_core;
 }
 
-void ProjectLoadTest::loadSimpleProject()
+void ProjectLoadTest::addRemoveFiles()
 {
-    QTest::qWait(500); //wait for previously loaded projects
-    foreach (KDevelop::IProject *p, KDevelop::ICore::self()->projectController()->projects()) {
-        KDevelop::ICore::self()->projectController()->closeProject(p);
-    }
-    Q_ASSERT(KDevelop::ICore::self()->projectController()->projects().isEmpty());
-
     QString path;
     QString projectName;
     do {
@@ -97,11 +109,7 @@ void ProjectLoadTest::loadSimpleProject()
         f2.remove();
     }
     QTest::qWait(500);
-    kDebug() << "*********************";
-    kDebug() << project->fileSet().count();
-    foreach (const KDevelop::IndexedString &i, project->fileSet()) {
-        kDebug() << i.str();
-    }
+
     QCOMPARE(project->filesForUrl(path+"/blub"+QString::number(50)).count(), 1);
     KDevelop::ProjectFileItem* file = project->filesForUrl(path+"/blub"+QString::number(50)).first();
     project->projectFileManager()->removeFile(file); //message box has to be accepted manually :(
@@ -111,17 +119,81 @@ void ProjectLoadTest::loadSimpleProject()
     }
 
     QTest::qWait(2000);
+    QCOMPARE(project->fileCount(), 1);
 
-    foreach (const KDevelop::IndexedString &i, project->fileSet()) {
-        kDebug() << i.str();
+    foreach (KDevelop::IProject *p, KDevelop::ICore::self()->projectController()->projects()) {
+        KDevelop::ICore::self()->projectController()->closeProject(p);
+    }
+
+    QTest::qWait(500);
+    exec("rm -r "+path);
+}
+
+void _writeRandomStructure(QString path, int files)
+{
+    QDir p(path);
+    QString name = QString::number(qrand());
+    if (qrand() < RAND_MAX / 5) {
+        p.mkdir(name);
+        path += "/" + name;
+        kDebug() << "wrote path" << path;
+    } else {
+        QFile f(path+"/"+name);
+        f.open(QIODevice::WriteOnly);
+        f.write(QByteArray::number(qrand()));
+        f.write(QByteArray::number(qrand()));
+        f.write(QByteArray::number(qrand()));
+        f.write(QByteArray::number(qrand()));
+        f.close();
+        kDebug() << "wrote file" << path+"/"+name;
+    }
+    files--;
+    if (files > 0) {
+        _writeRandomStructure(path, files);
+    }
+}
+
+void ProjectLoadTest::addLotsOfFiles()
+{
+    QString path;
+    QString projectName;
+    do {
+        projectName = QString("testproject%1").arg(qrand());
+        path = QDir::currentPath().append("/").append(projectName);
+    } while(QFile::exists(path));
+    QDir::current().mkdir(projectName);
+
+    QDir::setCurrent(path);
+
+    QStringList projectFileContents;
+    projectFileContents
+    << "[Project]"
+    << QString("Name=") + projectName
+    << "Manager=KDevGenericManager";
+
+    KUrl projecturl( path + "/simpleproject.kdev4" );
+    QFile projectFile(projecturl.toLocalFile());
+    projectFile.open(QIODevice::WriteOnly);
+    projectFile.write(projectFileContents.join("\n").toAscii());
+    projectFile.close();
+
+    KDevelop::ICore::self()->projectController()->openProject(projecturl);
+    QTest::qWait(2000);
+
+    KDevelop::IProject* project = KDevelop::ICore::self()->projectController()->projects().first();
+    Q_ASSERT(project->projectFileUrl() == projecturl);
+
+    QDir(path).mkdir("foou");
+    _writeRandomStructure(path+"/foou", 50);
+    for(int i=0; i < 100; ++i) {
+        exec("bash -c \"cp -r foou foox"+QString::number(i)+" > /dev/null 2>&1 & \"");
+        QTest::qWait(100);
     }
-    QCOMPARE(project->fileCount(), 1);
 
     foreach (KDevelop::IProject *p, KDevelop::ICore::self()->projectController()->projects()) {
         KDevelop::ICore::self()->projectController()->closeProject(p);
     }
 
-    //TODO: more cleanup; .kdev4/
-    QFile::remove(projecturl.toLocalFile());
-    QDir(QDir::currentPath()).rmdir(projectName);
+    QTest::qWait(500);
+    exec("rm -r "+path);
 }
diff --git a/plugins/genericprojectmanager/test/reloadtest.h b/plugins/genericprojectmanager/test/reloadtest.h
index 40f33b3..317ce4c 100644
--- a/plugins/genericprojectmanager/test/reloadtest.h
+++ b/plugins/genericprojectmanager/test/reloadtest.h
@@ -34,7 +34,9 @@ Q_OBJECT
 private slots:
   void init();
   void cleanup();
-  void loadSimpleProject();
+
+  void addRemoveFiles();
+  void addLotsOfFiles();
 private:
   KDevelop::TestCore* m_core;
 };
Comment 10 Milian Wolff 2010-09-25 23:30:47 UTC
fixed this recently
Comment 11 Milian Wolff 2010-09-25 23:32:04 UTC
oh wait, I fixed nikos test, but not the "reload child of reloading folder" thingy I fear
Comment 12 Milian Wolff 2010-10-20 17:23:54 UTC
*** Bug 254697 has been marked as a duplicate of this bug. ***
Comment 13 sailorweb2 2011-01-26 11:20:34 UTC
Created attachment 56435 [details]
New crash information added by DrKonqi

kdevelop (4.1.2) on KDE Platform 4.5.1 (KDE 4.5.1) using Qt 4.7.0

- What I was doing when the application crashed:

I was recompiling the project manually from the console and Kdevelop 4.1.2 crashed at the background.

-- Backtrace (Reduced):
#6  0x00007f1df5f006f4 in KDevelop::ProjectBaseItem::project (this=0x2322ea80) at ../../project/projectmodel.cpp:321
#7  0x00007f1de1a0276e in GenericProjectManager::addJobItems (this=0x2515cc0, job=<value optimized out>, baseItem=0x2322ea80, entries=..., forceRecursion=<value optimized out>) at ../../../plugins/genericprojectmanager/genericmanager.cpp:196
#8  0x00007f1de1a05f3a in GenericProjectManager::qt_metacall (this=0x2515cc0, _c=QMetaObject::InvokeMetaMethod, _id=<value optimized out>, _a=0x7fff3815cb70) at ./genericmanager.moc:99
[...]
#10 0x00007f1de19ff522 in GenericManagerListJob::entries (this=0x2322ea80, _t1=0x21001750, _t2=0x2322ea80, _t3=<value optimized out>, _t4=false) at ./genericmanagerlistjob.moc:102
#11 0x00007f1de19ff9f3 in GenericManagerListJob::slotResult (this=0x2322ea80, job=0x69215a0) at ../../../plugins/genericprojectmanager/genericmanagerlistjob.cpp:73
Comment 14 Aleix Pol 2012-01-18 02:20:50 UTC
Is it still happening?
Comment 15 Andrew Crouthamel 2018-09-22 01:42:38 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information as soon as possible and set the bug status as REPORTED. Due to regular bug tracker maintenance, if the bug is still in NEEDSINFO status with no change in 30 days, the bug will be closed as RESOLVED > WORKSFORME due to lack of needed information.

For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please set the bug status as REPORTED so that the KDE team knows that the bug is ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 16 Andrew Crouthamel 2018-10-27 04:18:19 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least 30 days. The bug is now closed as RESOLVED > WORKSFORME due to lack of needed information.

For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!