| Summary: | memory protection fault when importing c++ headers | ||
|---|---|---|---|
| Product: | [Applications] umbrello | Reporter: | Rafal Molotkiewicz <molotster> |
| Component: | general | Assignee: | Umbrello Development Group <umbrello-devel> |
| Status: | RESOLVED FIXED | ||
| Severity: | crash | CC: | ralf.habacker |
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | Gentoo Packages | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | 4.01 | |
| Sentry Crash Report: | |||
|
Description
Rafal Molotkiewicz
2006-09-24 00:42:14 UTC
SVN commit 587943 by okellogg:
Importing POCO doesn't crash on the current wavefront but reveals a problem
with duplicated datatypes (e.g. "const std::string&" appears many times in
the Datatypes folder) which is fixed by r587941 and this here.
BUG:134566
M +11 -7 import_utils.cpp
--- branches/KDE/3.5/kdesdk/umbrello/umbrello/codeimport/import_utils.cpp #587942:587943
@@ -25,6 +25,7 @@
#include "../umlobject.h"
#include "../docwindow.h"
#include "../package.h"
+#include "../folder.h"
#include "../enum.h"
#include "../datatype.h"
#include "../classifier.h"
@@ -119,6 +120,12 @@
QString comment,
QString stereotype) {
UMLDoc *umldoc = UMLApp::app()->getDocument();
+ UMLFolder *logicalView = umldoc->getRootFolder(Uml::mt_Logical);
+ if (parentPkg == NULL) {
+ // kdDebug() << "Import_Utils::createUMLObject(" << name
+ // << "): parentPkg is NULL, assuming Logical View" << endl;
+ parentPkg = logicalView;
+ }
UMLObject * o = umldoc->findUMLObject(name, type, parentPkg);
bNewUMLObjectWasCreated = false;
if (o == NULL) {
@@ -135,7 +142,7 @@
if (origType == NULL) {
// Still not found. Create the stripped down type.
if (bPutAtGlobalScope)
- parentPkg = NULL;
+ parentPkg = logicalView;
// Find, or create, the scopes.
QStringList components;
if (typeName.contains("::")) {
@@ -182,11 +189,8 @@
// Create the full given type (including adornments.)
if (isConst)
name.prepend("const ");
- if (bPutAtGlobalScope) {
- parentPkg = NULL;
- bPutAtGlobalScope = false;
- }
- o = Object_Factory::createUMLObject(Uml::ot_Datatype, name, parentPkg,
+ o = Object_Factory::createUMLObject(Uml::ot_Datatype, name,
+ umldoc->getDatatypeFolder(),
false); //solicitNewName
UMLDatatype *dt = static_cast<UMLDatatype*>(o);
UMLClassifier *c = dynamic_cast<UMLClassifier*>(origType);
@@ -236,7 +240,7 @@
bool isStatic /* =false */) {
Uml::Object_Type ot = owner->getBaseType();
Uml::Programming_Language pl = UMLApp::app()->getActiveLanguage();
- if (ot != Uml::ot_Class && pl != Uml::pl_Java) {
+ if (! (ot == Uml::ot_Class || ot == Uml::ot_Interface && pl == Uml::pl_Java)) {
kdDebug() << "insertAttribute: Don't know what to do with "
<< owner->getName() << " (object type " << ot << ")" << endl;
return NULL;
In umbrello 1.5.4 there is no folder.h file at all. Should this patch be applied on cvs/svn version? This info would be helpful... Now the solution just can't work on the program version the bug was submited for, so I'm thinking about re-opening bugreport. Turns out I was a little quick closing this bug. On importing poco-1.2.3/Foundation/include/Poco, there is a segfault even with the wavefront. Reason: Mutual #include between Types.h and Foundation.h. (Workaround is simple: Just remove the #include "Foundation.h" in Types.h.) To solve this bug, Umbrello's C++ import would have to respect #ifdef and implement #define. preprocessor macros has been added to umbrello at Fri Apr 4 00:03:21 2008 +0000 by Jean Vittor https://projects.kde.org/projects/kde/kdesdk/umbrello/repository/revisions/2265c6cb6c8c5ce77c5dbf0489dd130c4831f43e |