Summary: | KDevelop crashed when initiating build | ||
---|---|---|---|
Product: | [Applications] kdevelop | Reporter: | Alex Richardson <arichardson.kde> |
Component: | Build tools: CMake | Assignee: | kdevelop-bugs-null |
Status: | RESOLVED FIXED | ||
Severity: | crash | CC: | aleixpol |
Priority: | NOR | ||
Version: | 4.1.60 | ||
Target Milestone: | 4.2.0 | ||
Platform: | openSUSE | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Alex Richardson
2010-11-29 15:57:40 UTC
if you ever find a way to reproduce, please run kdevelop through valgrind: valgrind --track-origins=yes --num-callers=25 kdevelop To me it looks as if the item was invalid... Aleix, do you have any other idea? More information would be nice indeed, I'm not sure what can have happened but I'll be attentive. I found that this was reproducible, I also tried debugging it, but somehow GDB didn't play nicely. It always happens when I have kdevplatform/plugins/classbrowser/classmodel.cpp selected and then press the build button. It seems the dynamic_cast before call fi->buildDir() fails and therefore a null pointer is being dereferenced. I don't know enough about the code to fix this, but I hope the given information should suffice to fix the issue. For now I'll just make sure I don't have a file selected when I build. Strangely enough it doesn't happen with all files but I don't want to risk it. commit 4d05d482ccb38029b1e5604e2b1b3594c39b492c branch master Author: Aleix Pol <aleixpol@kde.org> Date: Mon Nov 29 19:45:34 2010 +0100 Always check if the current item to retrieve the builddir from is a folder. BUG: 258285 diff --git a/projectmanagers/cmake/cmakemanager.cpp b/projectmanagers/cmake/cmakemanager.cpp index 5e8ac7d..b8c9b2a 100644 --- a/projectmanagers/cmake/cmakemanager.cpp +++ b/projectmanagers/cmake/cmakemanager.cpp @@ -165,17 +165,14 @@ KUrl CMakeManager::buildDirectory(KDevelop::ProjectBaseItem *item) const { KUrl ret; ProjectBaseItem* parent = item->parent(); - if (!parent) { + if (parent) + ret=buildDirectory(parent); + else ret=CMake::currentBuildDir(item->project()); - - CMakeFolderItem *fi=dynamic_cast<CMakeFolderItem*>(item); + + CMakeFolderItem *fi=dynamic_cast<CMakeFolderItem*>(item); + if(fi) ret.addPath(fi->buildDir()); - } else { - ret=buildDirectory(parent); - CMakeFolderItem *fi=dynamic_cast<CMakeFolderItem*>(item); - if(fi) - ret.addPath(fi->buildDir()); - } return ret; } |