Bug 191890 - stack overflow crash when importing a specific header file
Summary: stack overflow crash when importing a specific header file
Status: RESOLVED FIXED
Alias: None
Product: umbrello
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Microsoft Windows Microsoft Windows
: NOR crash
Target Milestone: ---
Assignee: Umbrello Development Group
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-05-07 11:19 UTC by Ralf Habacker
Modified: 2011-11-30 08:32 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.