Bug 186059 - Segmentation Fault - Loop in inheritance graph
Summary: Segmentation Fault - Loop in inheritance graph
Status: RESOLVED DUPLICATE of bug 148938
Alias: None
Product: umbrello
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: NOR crash
Target Milestone: ---
Assignee: Umbrello Development Group
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-03-03 19:17 UTC by Laurent David
Modified: 2009-09-28 02:31 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Inheritance "loop" umbrello (11.82 KB, application/xml)
2009-03-04 08:09 UTC, Laurent David
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Laurent David 2009-03-03 19:17:46 UTC
Version:           1.5.8 (using KDE 3.5.10)
OS:                Linux
Installed from:    Ubuntu Packages

Hi,

I found a bug while drawing some sequence diagrams resulting in a segmentation fault.
I originally found a bug with a more complex case with no visible evidence (at least not on the class diagram, but only if you clicked on properties of the superclass) of the recursive inheritance. I had to remove the dependency manually in the xmi file.

I have been able to isolate the bug using the following type of diagram (I have the file available if you need it).
SubClass1 inherits from SuperClass. SubClass2 inherits from SubClass1 and SuperClass inherits from SubClass2.
Whenever you draw a sequence diagram using those 3 classes, you will get a segmentation fault.

This is an extract of gdb that shows that the UMLClassifier::getOpList() method is called recursively and results in a stack overflow.
 
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fd0a5d2e6f0 (LWP 19819)]
0x00007fd0a03bc5e8 in operator new () from /usr/lib/libstdc++.so.6
(gdb) info stack
#0  0x00007fd0a03bc5e8 in operator new () from /usr/lib/libstdc++.so.6
#1  0x00007fd0a48b3528 in QGList::append () from /usr/lib/libqt-mt.so.3
#2  0x0000000000589745 in UMLCanvasObject::getAssociations (
    this=<value optimized out>) at /usr/share/qt3/include/qptrlist.h:85
#3  0x000000000058abba in UMLCanvasObject::getSuperClasses (this=0xdb8eb0)
    at umlcanvasobject.cpp:256
#4  0x0000000000508f14 in UMLClassifier::findSuperClassConcepts (
    this=0xdcd3e0, type=2908135520) at classifier.cpp:392
#5  0x000000000050b40e in UMLClassifier::getOpList (this=0xdb8eb0, 
    includeInherited=true) at classifier.cpp:634
#6  0x000000000050b46a in UMLClassifier::getOpList (this=0xdcd140, 
    includeInherited=<value optimized out>) at classifier.cpp:643
#7  0x000000000050b46a in UMLClassifier::getOpList (this=0xdcd270, 
    includeInherited=<value optimized out>) at classifier.cpp:643
#8  0x000000000050b46a in UMLClassifier::getOpList (this=0xdb8eb0, 
    includeInherited=<value optimized out>) at classifier.cpp:643
#9  0x000000000050b46a in UMLClassifier::getOpList (this=0xdcd140, 
    includeInherited=<value optimized out>) at classifier.cpp:643
#10 0x000000000050b46a in UMLClassifier::getOpList (this=0xdcd270, 
    includeInherited=<value optimized out>) at classifier.cpp:643
#11 0x000000000050b46a in UMLClassifier::getOpList (this=0xdb8eb0, 
    includeInherited=<value optimized out>) at classifier.cpp:643
#12 0x000000000050b46a in UMLClassifier::getOpList (this=0xdcd140, 

I investigated a little bit more and the loop is located in the file classifier.cpp. In the recursive call to getOpList, the UMLClassifier::findSuperClassConcepts method will get parents without really checking if it they have been examined.
As a suggestion, it may be worth it to remove the recursive call so we can keep a list of nodes that have already been seen.
Comment 1 Laurent David 2009-03-04 08:09:38 UTC
Created attachment 31763 [details]
Inheritance "loop" umbrello

Open this file with Umbrello and switch to Sequence Diagram. Try to add an event from one object to another to have the segmentation fault.
Comment 2 Dario Andres 2009-09-28 02:31:38 UTC
Same backtrace as bug 148938. Merging. Thanks

*** This bug has been marked as a duplicate of bug 148938 ***