[Uml-devel] [Bug 230350] Umbrello segfaults on opening xmi file

Ralf Habacker ralf.habacker at gmail.com
Tue Jan 17 20:06:18 UTC 2012


https://bugs.kde.org/show_bug.cgi?id=230350





--- Comment #4 from Ralf Habacker <ralf habacker gmail com>  2012-01-17 20:06:18 ---
The file shows an internal design issue, which may be triggered also by other
conditions. 

UMLObject * UMLPackage::findObjectById(Uml::IDType id)

calls 

    return Model_Utils::findObjectInList(id, m_objects);

which is implemented as 

UMLObject* findObjectInList(Uml::IDType id, const UMLObjectList& inList)
{
    for (UMLObjectListIt oit(inList); oit.hasNext(); ) {
        UMLObject *obj = oit.next();
        if (obj->id() == id)
            return obj;
        UMLObject *o;
        UMLObject::ObjectType t = obj->baseType();
        switch (t) {
        case UMLObject::ot_Folder:
        case UMLObject::ot_Package:
        case UMLObject::ot_Component:

here it calls the above mentioned UMLPackage::findObjectById 

           o = static_cast<UMLPackage*>(obj)->findObjectById(id);

Which means if the related id is not in the list for whatever reasons, there is
an endless recursive loop. 

The question is, how to detect this condition ?

-- 
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.




More information about the umbrello-devel mailing list