Bug 373780

Summary: Application crashes when opening an UML/XMI class diagram
Product: [Applications] umbrello Reporter: daniel.mensinger
Component: generalAssignee: Umbrello Development Group <umbrello-devel>
Status: RESOLVED FIXED    
Severity: crash CC: daniel.mensinger, penc, ralf.habacker
Priority: NOR    
Version: 2.20.80 (KDE Applications 16.11.80)   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In: 2.21.1 (KDE Applications 16.12.1)
Attachments: The UML file causing the crash
Crash backtrace

Description daniel.mensinger 2016-12-17 18:18:23 UTC
Created attachment 102841 [details]
The UML file causing the crash

The application crashes with a segmentation fault when opening the attached file.
The last working umbrello version is 2.20.3. All following versions (tested up to 2.21.0 (16.12.0)) crash when opening this file.

System: Arch Linux
  KDE Frameworks 5.29.0
  Qt 5.7.1 (built against 5.7.1)
Comment 1 Ralf Habacker 2016-12-18 09:28:59 UTC
(In reply to daniel.mensinger from comment #0)
> Created attachment 102841 [details]
> The UML file causing the crash
> 
> The application crashes with a segmentation fault when opening the attached
> file.
> The last working umbrello version is 2.20.3. All following versions (tested
> up to 2.21.0 (16.12.0)) crash when opening this file.
> 
> System: Arch Linux
>   KDE Frameworks 5.29.0
>   Qt 5.7.1 (built against 5.7.1)

I just created an KF5 5.29.0 and Qt 5.7.1 based umbrello build from Applications/16.12 branch and loaded the appended file, but unfortunally I could not reproduce this crash.

It would be nice to get a stack trace to be able to get an idea where the crash happens for example by running umbrello with gdb.
Comment 2 daniel.mensinger 2016-12-18 11:38:02 UTC
Created attachment 102852 [details]
Crash backtrace
Comment 3 Ralf Habacker 2016-12-19 07:43:10 UTC
Comment on attachment 102852 [details]
Crash backtrace

>/usr/lib/libQtGui.so.4
This is a Qt4 build which differs from the initial description

#0 .. __cxxabiv1::__dynamic_cast(void const*,...) (src_ptr=0x0,...) 
#1 .. in UMLObject::asUMLClassifier() (this=<optimized out>) at /home/daniel/builds/CUSTOM/umbrello/umbrello/umlmodel/umlobject.cpp:1236
#2 .. in UMLClassifierListItem::getType() const (this=this@entry=0x15baab0) at /home/daniel/builds/CUSTOM/umbrello/umbrello/umlmodel/classifierlistitem.cpp:103

This indicates that UMLObject::asUMLClassifier() got a zero pointer at 

UMLClassifier * UMLClassifierListItem::getType() const
{
    return m_pSecondary->asUMLClassifier();
}
Comment 4 Ralf Habacker 2016-12-19 07:55:17 UTC
Git commit ee3d370f5818c70a69525bb1232ae71b0921a75a by Ralf Habacker.
Committed on 19/12/2016 at 07:55.
Pushed by habacker into branch 'Applications/16.12'.

Fix 'Application crashes when opening an UML/XMI class diagram'.

Add check to avoid accessing zero m_pSecondary.
FIXED-IN:2.21.1 (KDE Applications 16.12.1)

M  +1    -1    umbrello/umlmodel/classifierlistitem.cpp

https://commits.kde.org/umbrello/ee3d370f5818c70a69525bb1232ae71b0921a75a
Comment 5 Ralf Habacker 2016-12-19 18:54:25 UTC
*** Bug 373900 has been marked as a duplicate of this bug. ***