Bug 130471

Summary: Crash while loading XMI with collaboration diagram
Product: [Applications] umbrello Reporter: Krzysztof Nowicki <krissn>
Component: generalAssignee: Umbrello Development Group <umbrello-devel>
Status: RESOLVED DUPLICATE    
Severity: crash    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: XMI file exploiting the bug

Description Krzysztof Nowicki 2006-07-08 17:32:14 UTC
Version:           3.5.3 (using KDE KDE 3.5.3)
Installed from:    Compiled From Sources
Compiler:          gcc 4.0 
OS:                Linux

I have an XMI file with some classes, of which one contains an operation with parameters. There is one class diagram and one collaboration diagram. The class diagram contains two classes: Class 1 and Class 2, of which Class 1 contains a method MethodWithParams with 2 parameters.
On the collaboration diagram I dragged out both of the classes from the tree and created a new message from Class 2 to Class 1. In the properties of the message I selected Class operation and choosed MethodWithParam.
After saving this file (attached to the bugreport), Umbrello is not able to load it again and crashes with SIGSEGV.

I've tracked down the bug to the moment, where an association in the collaboration diagram is loaded (AssociationWidget::loadFromXMI). If the association references an existing method of the class, the xmi.id attribute is set to the id found in UML:Operation entry for this method. The findObjectById call (associationwidget.cpp:3464) returns a pointer to the UMLOperation object, but it is later casted to UMLAssociation and passed to setUMLAssociation. This causes an incrementation of the V-Table pointer in the m_List member of UMLAssociation and in turn a crash later at cppheadercodeoperation.cpp:148.
Comment 1 Krzysztof Nowicki 2006-07-08 17:33:29 UTC
Created attachment 16924 [details]
XMI file exploiting the bug
Comment 2 Oliver Kellogg 2006-07-08 20:34:11 UTC
Workaround: Deactivate the advanced code generators (i.e. go to
Configure -> General Settings and switch off "use new C++/Java/Ruby code
generators".)
Comment 3 Oliver Kellogg 2006-07-14 08:14:38 UTC
see also #125331, #126262

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