Summary: | generic project manager crash: reloading a folder while a parent folder reloads | ||
---|---|---|---|
Product: | [Applications] kdevelop | Reporter: | Markus <markus.hauser> |
Component: | general | Assignee: | 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
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? 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 ;-) 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 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 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. 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". 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 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
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; }; fixed this recently oh wait, I fixed nikos test, but not the "reload child of reloading folder" thingy I fear *** Bug 254697 has been marked as a duplicate of this bug. *** 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
Is it still happening? 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! 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! |