Bug 62201 - crash while loading Brian's XMI files
Summary: crash while loading Brian's XMI files
Status: RESOLVED FIXED
Alias: None
Product: umbrello
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR crash
Target Milestone: ---
Assignee: Umbrello Development Group
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-08-05 19:27 UTC by Sebastian Stein
Modified: 2003-10-05 23:42 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sebastian Stein 2003-08-05 19:27:03 UTC
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
Comment 1 Oliver Kellogg 2003-10-05 23:42:33 UTC
*** Bug has been marked as fixed ***.