Crash after requesting context menu (after reopening the project)

Andreas Pakulat apaku at gmx.de
Tue Jul 29 22:43:17 UTC 2008


On 29.07.08 23:39:16, Evgeniy Ivanov wrote:
> Andreas Pakulat wrote:
> > On 28.07.08 21:05:42, Evgeniy Ivanov wrote:
> >> After I reopen the project and request context menu in the projects view
> >> I get crash. Everything is ok, only context menu crashes KDevelop.
> >> It's a new behavior, so it isn't look affected by my changes (I do
> >> everything in a safe place).
> >> So I do:
> >> void DistributedVersionControlPlugin::checkoutFinished(KJob* _checkoutJob)
> >> {
> >>     DVCSjob* checkoutJob = dynamic_cast<DVCSjob*>(_checkoutJob);
> >>     KDevelop::IProject* curProject =
> >> core()->projectController()->findProjectForUrl(KUrl(checkoutJob->getDirectory()
> >> ));
> >>     KUrl projectFile = curProject->projectFileUrl();
> >>     qDebug() << "projectFile is " << projectFile << " JobDir is "
> >> <<checkoutJob->getDirectory();
> >>     qDebug() << "Project will be closed and open";
> >>     core()->projectController()->closeProject(curProject);
> >>     core()->projectController()->openProject(projectFile);
> >>
> >> I get new project opened, but context menus...
> >> Here bt:
> >>
> >>
> >> #0  0xb5d649d9 in KDevelop::IPlugin::core (this=0x852e0a8) at
> >> /workspace/gsoc/kdevplatform/interfaces/iplugin.cpp:181
> >> 181         return d->core;
> >> (gdb) bt
> >> #0  0xb5d649d9 in KDevelop::IPlugin::core (this=0x852e0a8) at
> >> /workspace/gsoc/kdevplatform/interfaces/iplugin.cpp:181
> >> #1  0xb5d649fb in KDevelop::IPlugin::extensionManager (this=0x852e0a8)
> >> at /workspace/gsoc/kdevplatform/interfaces/iplugin.cpp:186
> > 
> > This backtrace suggests that you have BiC problems with your plugins. I
> > suggest to remove anything starting with libkdev and kdev from your
> > kde4/lib dir and then remove your builddirs and rebuild+reinstall both
> > kdevplatform and kdevelop. 
> > 
> > That line simply can't crash.
> > 
> > Andreas
> > 
> 
> Unfortunately it can.
> Backtrace by Alexandr Dymo: http://rafb.net/p/SE7DM933.html
> As I understood he has a crash without checking out.
> Part of my bt: http://rafb.net/p/O5ydrE71.html
> 
> The code (with veritas/coverage/coverageplugin.cpp:97):
> http://rafb.net/p/dhaFxK51.html
> If I comment lines 15-16 everything is ok. Also if I use
> IProject::reloadModel() instead of opening/closing the project
> everything is ok too.
> Do you think
> core()->projectController()->closeProject(curProject);
> core()->projectController()->openProject(projectFile);
> May break in any way:
> IBuildSystemManager* bm = proj->buildSystemManager();
> 
> I committed the code with reloadModel(), so everything is ok now (but
> close/open feats my needs better).

Hmmm... I can't see how this could happen. Granted the project pointer
itself isn't deleted until the event loop runs again after closing it,
but the project items are being deleted properly. So the project tree
has to have the new items and their project() pointer needs to be
"proper". 

You should be able to debug this by simply printing out the pointer of
the project in projectcontroller::closeProject() before its deleted and
then also in veritas coverageplugin before the crash line. Those two
pointers should be different. If they are, there must be a problem
elsehwere.

Andreas

-- 
You'll wish that you had done some of the hard things when they were easier
to do.




More information about the KDevelop-devel mailing list