Bug 358286

Summary: Crash on removing diagram
Product: [Applications] umbrello Reporter: Ralf Habacker <ralf.habacker>
Component: generalAssignee: Umbrello Development Group <umbrello-devel>
Status: RESOLVED FIXED    
Severity: crash CC: artem.goncharov
Priority: NOR    
Version: 2.18.0 (KDE Applications 15.12.0)   
Target Milestone: ---   
Platform: Other   
OS: Other   
Latest Commit: Version Fixed In: 2.18.2 (KDE Applications 15.12.2)
Sentry Crash Report:
Attachments: testcase

Description Ralf Habacker 2016-01-20 22:54:38 UTC
On removing the diagram "Communication diagram" from the appended xmi file crashes.


Reproducible: Always

Steps to Reproduce:
1. start umbrello
2. open the appended xmi file
3. right on the diagram "communication diagram" and select "delete"

Actual Results:  
umbrello crashes

Expected Results:  
umbrello should not crash
Comment 1 Ralf Habacker 2016-01-20 22:55:29 UTC
Created attachment 96760 [details]
testcase
Comment 2 Ralf Habacker 2016-01-20 22:56:47 UTC
Stacktrace:
Application: Umbrello UML-Modeller (umbrello), signal: Aborted
Using host libthread_db library "/lib64/libthread_db.so.1".
[KCrash Handler]
#6  0x00007f95a3e7d187 in raise () at /lib64/libc.so.6
#7  0x00007f95a3e7e538 in abort () at /lib64/libc.so.6
#8  0x00007f95a4b006d4 in qt_message_output(QtMsgType, char const*) () at /usr/lib64/libQtCore.so.4
#9  0x00007f95a4b00859 in  () at /usr/lib64/libQtCore.so.4
#10 0x00007f95a4b01064 in qFatal(char const*, ...) () at /usr/lib64/libQtCore.so.4
#11 0x00007f95a4b010aa in  () at /usr/lib64/libQtCore.so.4
#12 0x000000000067d05d in Uml::CmdBaseWidgetCommand::scene() (this=this@entry=0x3329430) at /home/ralf/src/umbrello-15.12/umbrello/cmds/widget/cmd_baseWidgetCommand.cpp:47
#13 0x000000000059c63e in Uml::CmdRemoveWidget::redo() (this=0x3329430) at /home/ralf/src/umbrello-15.12/umbrello/cmds/widget/cmd_removeWidget.cpp:48
#14 0x00007f95a59c8013 in QUndoStack::push(QUndoCommand*) () at /usr/lib64/libQtGui.so.4
#15 0x000000000044fe63 in UMLApp::executeCommand(QUndoCommand*) (this=0x19b18d0, cmd=0x3329430) at /home/ralf/src/umbrello-15.12/umbrello/uml.cpp:3547
#16 0x0000000000474b07 in UMLScene::removeWidget(UMLWidget*) (this=<optimized out>, o=<optimized out>) at /home/ralf/src/umbrello-15.12/umbrello/umlscene.cpp:1164
#17 0x00000000005cefae in AssociationWidget::cleanup() (this=0x3330c90) at /home/ralf/src/umbrello-15.12/umbrello/umlwidgets/associationwidget.cpp:1327
#18 0x0000000000477f31 in UMLScene::removeAssoc(AssociationWidget*) (this=this@entry=0x332e0d0, pAssoc=pAssoc@entry=0x3330c90) at /home/ralf/src/umbrello-15.12/umbrello/umlscene.cpp:2003
#19 0x0000000000477fc4 in UMLScene::removeAssociations(UMLWidget*) (this=this@entry=0x332e0d0, widget=0x332f390) at /home/ralf/src/umbrello-15.12/umbrello/umlscene.cpp:2051
#20 0x000000000047a1cd in UMLScene::removeWidgetCmd(UMLWidget*) (this=this@entry=0x332e0d0, o=o@entry=0x332f390) at /home/ralf/src/umbrello-15.12/umbrello/umlscene.cpp:1179
#21 0x000000000047a46b in UMLScene::removeAllWidgets() (this=this@entry=0x332e0d0) at /home/ralf/src/umbrello-15.12/umbrello/umlscene.cpp:2117
#22 0x000000000047a529 in UMLScene::~UMLScene() (this=0x332e0d0, __in_chrg=<optimized out>) at /home/ralf/src/umbrello-15.12/umbrello/umlscene.cpp:185
#23 0x000000000047a5d9 in UMLScene::~UMLScene() (this=0x332e0d0, __in_chrg=<optimized out>) at /home/ralf/src/umbrello-15.12/umbrello/umlscene.cpp:191
#24 0x0000000000484096 in UMLView::~UMLView() (this=0x32d9060, __in_chrg=<optimized out>) at /home/ralf/src/umbrello-15.12/umbrello/umlview.cpp:48
#25 0x00000000004840b9 in UMLView::~UMLView() (this=0x32d9060, __in_chrg=<optimized out>) at /home/ralf/src/umbrello-15.12/umbrello/umlview.cpp:49
#26 0x00000000005acffa in UMLFolder::removeView(UMLView*) (this=<optimized out>, view=view@entry=0x32d9060) at /home/ralf/src/umbrello-15.12/umbrello/umlmodel/folder.cpp:97
#27 0x000000000045ddbb in UMLDoc::removeView(UMLView*, bool) (this=this@entry=0x1bbefd0, view=view@entry=0x32d9060, enforceCurrentView=enforceCurrentView@entry=true) at /home/ralf/src/umbrello-15.12/umbrello/umldoc.cpp:259
#28 0x000000000045e2b0 in UMLDoc::removeDiagramCmd(std::string) (this=0x1bbefd0, id=...) at /home/ralf/src/umbrello-15.12/umbrello/umldoc.cpp:1782
#29 0x000000000059bd88 in Uml::CmdRemoveDiagram::redo() (this=<optimized out>) at /home/ralf/src/umbrello-15.12/umbrello/cmds/cmd_removeDiagram.cpp:54
#30 0x00007f95a59c8013 in QUndoStack::push(QUndoCommand*) () at /usr/lib64/libQtGui.so.4
#31 0x000000000044fe63 in UMLApp::executeCommand(QUndoCommand*) (this=0x19b18d0, cmd=cmd@entry=0x22bc970) at /home/ralf/src/umbrello-15.12/umbrello/uml.cpp:3547
#32 0x000000000045e1b9 in UMLDoc::removeDiagram(std::string) (this=<optimized out>, id=...) at /home/ralf/src/umbrello-15.12/umbrello/umldoc.cpp:1764
#33 0x000000000047d974 in UMLScene::slotMenuSelection(QAction*) (this=0x332e0d0, action=action@entry=0x32b43a0) at /home/ralf/src/umbrello-15.12/umbrello/umlscene.cpp:3082
#34 0x0000000000465e54 in UMLDoc::slotDiagramPopupMenu(QWidget*, QPoint const&) (this=this@entry=0x1bbefd0, umlview=0x32d9060, point=...) at /home/ralf/src/umbrello-15.12/umbrello/umldoc.cpp:3357
#35 0x000000000049804d in UMLDoc::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (_o=0x1bbefd0, _c=<optimized out>, _id=13, _a=0x7ffe33d15ec0) at /home/ralf/src/umbrello-15.12-build/umbrello/moc_umldoc.cpp:89
#36 0x00007f95a4c200fa in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () at /usr/lib64/libQtCore.so.4
#37 0x00007f95a6d3b907 in KTabWidget::contextMenu(QWidget*, QPoint const&) () at /usr/lib64/libkdeui.so.5
#38 0x00007f95a4c200fa in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () at /usr/lib64/libQtCore.so.4
#39 0x00007f95a6d3a4f3 in KTabBar::contextMenu(int, QPoint const&) () at /usr/lib64/libkdeui.so.5
#40 0x00007f95a6d3aa34 in KTabBar::mousePressEvent(QMouseEvent*) () at /usr/lib64/libkdeui.so.5
#41 0x00007f95a53e6acb in QWidget::event(QEvent*) () at /usr/lib64/libQtGui.so.4
#42 0x00007f95a57e4292 in QTabBar::event(QEvent*) () at /usr/lib64/libQtGui.so.4
#43 0x00007f95a539779c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib64/libQtGui.so.4
#44 0x00007f95a539de1a in QApplication::notify(QObject*, QEvent*) () at /usr/lib64/libQtGui.so.4
#45 0x00007f95a6c69e1a in KApplication::notify(QObject*, QEvent*) () at /usr/lib64/libkdeui.so.5
#46 0x00007f95a4c0c18d in QCoreApplication::notifyInternal(QObject*, QEvent*) () at /usr/lib64/libQtCore.so.4
#47 0x00007f95a539d613 in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) () at /usr/lib64/libQtGui.so.4
#48 0x00007f95a540eceb in  () at /usr/lib64/libQtGui.so.4
#49 0x00007f95a540d75c in QApplication::x11ProcessEvent(_XEvent*) () at /usr/lib64/libQtGui.so.4
#50 0x00007f95a54345f2 in  () at /usr/lib64/libQtGui.so.4
#51 0x00007f95a053ac84 in g_main_context_dispatch () at /usr/lib64/libglib-2.0.so.0
#52 0x00007f95a053aed8 in  () at /usr/lib64/libglib-2.0.so.0
#53 0x00007f95a053af7c in g_main_context_iteration () at /usr/lib64/libglib-2.0.so.0
#54 0x00007f95a4c38fbe in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib64/libQtCore.so.4
#55 0x00007f95a54346a6 in  () at /usr/lib64/libQtGui.so.4
#56 0x00007f95a4c0ad4f in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib64/libQtCore.so.4
#57 0x00007f95a4c0b045 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib64/libQtCore.so.4
#58 0x00007f95a4c10499 in QCoreApplication::exec() () at /usr/lib64/libQtCore.so.4
#59 0x000000000043e275 in main(int, char**) (argc=<optimized out>, argv=<optimized out>) at /home/ralf/src/umbrello-15.12/umbrello/main.cpp:246
Comment 3 Ralf Habacker 2016-01-20 23:02:55 UTC
Git commit 972f7145563d1e89754b612bcc03d3f754e952ca by Ralf Habacker.
Committed on 20/01/2016 at 23:02.
Pushed by habacker into branch 'Applications/15.12'.

Fix 'Crash on removing diagram'.

Using pointer to widget when it is not found within the document.
Related: bug 352633
FIXED-IN:2.18.2 (KDE Applications 15.12.2)

M  +10   -4    umbrello/cmds/widget/cmd_baseWidgetCommand.cpp
M  +3    -0    umbrello/cmds/widget/cmd_baseWidgetCommand.h

http://commits.kde.org/umbrello/972f7145563d1e89754b612bcc03d3f754e952ca
Comment 4 Ralf Habacker 2016-05-12 20:55:34 UTC
*** Bug 362783 has been marked as a duplicate of this bug. ***