Bug 191890

Summary: stack overflow crash when importing a specific header file
Product: [Applications] umbrello Reporter: Ralf Habacker <ralf.habacker>
Component: generalAssignee: Umbrello Development Group <umbrello-devel>
Status: RESOLVED FIXED    
Severity: crash CC: ernst.blaauw
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Ralf Habacker 2009-05-07 11:19:06 UTC
Version:           2.2.71 (using KDE 4.2.2)
Compiler:          msvc 2005 
OS:                MS Windows
Installed from:    MS Windows

when importing the file located at http://websvn.kde.org/*checkout*/trunk/kdesupport/kdewin32/tools/mt/xml.h?revision=964607

umbrello recurses into UMLObject::getFullyQualifiedName() until a stack overflow occurs. 

The related code snippet is listed below see !!!!

QString UMLObject::getFullyQualifiedName(const QString& separator,
        bool includeRoot /* = false */) const
{
    QString fqn;
    if (m_pUMLPackage) {
        bool skipPackage = false;
        if (!includeRoot) {
            UMLDoc *umldoc = UMLApp::app()->getDocument();
            if (umldoc->rootFolderType(m_pUMLPackage) != Uml::N_MODELTYPES ||
                    m_pUMLPackage == umldoc->getDatatypeFolder())
                skipPackage = true;
        }
        if (!skipPackage) {
            QString tempSeparator = separator;
            if (tempSeparator.isEmpty())
                tempSeparator = UMLApp::app()->activeLanguageScopeSeparator();
!!!!            fqn = m_pUMLPackage->getFullyQualifiedName(tempSeparator, includeRoot);
            fqn.append(tempSeparator);
        }
    }
    fqn.append(m_Name);
    return fqn;
}


The problem is that there is no exit condition. From my point of view a propper exit conditions would be to change the line 

    if (m_pUMLPackage) {

into 

    if (m_pUMLPackage && m_pUMLPackage != this) {
Comment 1 ernst.blaauw 2009-11-21 00:12:02 UTC
I experienced the same crash. See https://bugs.launchpad.net/ubuntu/+source/kdesdk/+bug/485917 for my backtrace.
Comment 2 Ralf Habacker 2011-11-30 08:32:25 UTC
I could not reproduce this crash with recent svn build on windows using msvc.