[Uml-devel] [Bug 62201] New: crash while loading Brian's XMI files
Sebastian Stein
seb_stein at gmx.de
Tue Aug 5 10:29:17 UTC 2003
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
http://bugs.kde.org/show_bug.cgi?id=62201
Summary: crash while loading Brian's XMI files
Product: umbrello
Version: unspecified
Platform: Compiled Sources
OS/Version: Linux
Status: NEW
Severity: crash
Priority: NOR
Component: general
AssignedTo: umbrello-devel at kde.org
ReportedBy: seb_stein at gmx.de
Version: (using KDE Devel)
Installed from: Compiled sources
Compiler: gcc
OS: Linux
Try loading the following xmi files provided under:
http://nvo.gsfc.nasa.gov/Umbrello/
http://uml.sourceforge.net/developers/brian-thomas-code-generation-model.xmi
http://muse.19inch.net/~jr/tmp/umbrello/
With all files Umbrello (latest CVS) crashes while loading the file.
The backtrace looks like this:
#4 0x080d06cc in UMLObject::getBaseType() const (this=0x8331ab8)
at umlobject.h:69
#5 0x080d241d in UMLListView::connectNewObjectsSlots(UMLObject*) (
this=0x8331ab8, object=0x0) at umllistview.cpp:464
#6 0x080d7d85 in UMLListView::loadChildrenFromXMI(UMLListViewItem*,
QDomElement&) (this=0x8331ab8, parent=0x85b86e8, element=@0xbfffe3f0)
at umllistview.cpp:1901
UMLListView::connectNewObjectsSlots() is entered with a value of 0x0 for
object. That's why the object->getBaseType() call must fail. The question is,
why this pointer is null?
Well, looking at the backtrace I first found out that crash happens while
loading the listview structure from the xmi file. The crash happens while
reading the information for:
case Uml::lvt_Attribute:
case Uml::lvt_Template:
case Uml::lvt_Operation:
The values 814, 815 and 816 belong to it.
Before calling the crashing function, the pointer should be found by the object
id with the call in umllistview.cpp:1900:
umlObject = static_cast<UMLClass *>(umlObject)->findChildObject(nID);
Now I took a look in findChildObject() and I was able to find out the wrong
id's. If a id doesn't exist, findChildObject returns a NULL pointer and so the
app crashes.
If we look in the above files, we will find the lines, where Umbrello crashes.
CodeGenModel.xmi:
<listitem open="0" type="815" id="-1" label="load" />
<listitem open="0" type="815" id="-1" label="save" />
brian-thomas-code-generation-model.xmi:
<listitem open="0" type="815" id="-1" label="load" />
<listitem open="0" type="815" id="-1" label="save" />
Modelo.xmi:
<listitem open="0" type="815" id="-1" label="vincula" />
<listitem open="0" type="815" id="-1" label="vincula" />
<listitem open="0" type="815" id="-1" label="novo" />
<listitem open="0" type="815" id="-1" label="novo" />
Does anybody know why those lines are in the xmi file? I know of a dirty fix,
just checking umlObject before calling UMLListView::connectNewObjectsSlots():
if (umlObject == NULL)
return false;
Now it is your turn to find out more, all this needed some hours to figure out
;-)
Steinchen
More information about the umbrello-devel
mailing list