[PATCH] Prevent crash in Mac OS X when opening project

Andreas Pakulat apaku at gmx.de
Mon Feb 6 22:10:22 UTC 2012


On 05.02.12 22:05:41, Jens Bäckman wrote:
> 
> 5 feb 2012 19:13, Milian Wolff wrote:
> 
> > On Monday 30 January 2012 11:54:33 Jens Bäckman wrote:
> >> ---
> >> projectmanagers/cmake/cmakemanager.cpp |    3 ++-
> >> 1 files changed, 2 insertions(+), 1 deletions(-)
> >> 
> >> diff --git a/projectmanagers/cmake/cmakemanager.cpp
> >> b/projectmanagers/cmake/cmakemanager.cpp index 2b38fac..5ed7875 100644
> >> --- a/projectmanagers/cmake/cmakemanager.cpp
> >> +++ b/projectmanagers/cmake/cmakemanager.cpp
> >> @@ -859,7 +859,8 @@ QList<KDevelop::ProjectFolderItem*> CMakeManager::parse(
> >> KDevelop::ProjectFolder
> >> a->defineVariables(targetProps["COMPILE_DEFINITIONS"]);
> >> 
> >>             DescriptorAttatched*
> >> datt=dynamic_cast<DescriptorAttatched*>(targetItem); -           
> >> datt->setDescriptor(t.desc);
> >> +            if(datt)
> >> +                datt->setDescriptor(t.desc);
> >> 
> >>             KUrl::List tfiles;
> >>             foreach( const QString & sFile, t.files)
> > 
> > Hey, could you explain why this is required? I guess the dynamic cast fails 
> > and hence could lead to this... But any idea why?
> 
> The dynamic cast fails, yes. I didn't do any deeper investigation of why this happens. With the patch in place, everything works.

While I agree that the patch makes sense as a way to avoid crashing
kdevelop due to bugs elsewhere it also does hide such a bug. So we
should first find out why the dynamic-cast fails in your case before
applying such a 'workaround'.

> > Aleix, any input? Jens, any way to reproduce this?
> 
> This is 100% reproducible. I just imported a CMake project, and got a crash here every time. The same bug is present in KDevelop 4.2.3 and appears when running in OS X, while everything works just fine in Linux.

Can you share that project or do you even get this with the ones
generated by KDevelop? Since this does not happen on Linux, maybe
there's some additional CMake code that gets our parser confused or so.

And as Aleix said, getting some more information about the target item
for which it crashes would be nice, like the name, the url and maybe the
class-name.

Andreas





More information about the KDevelop-devel mailing list