Bug 337630

Summary: Removing a combined fragment with a dashed line and selecting another widget causes a crash.
Product: [Applications] umbrello Reporter: Philipp Harms <philipp.harms>
Component: generalAssignee: Umbrello Development Group <umbrello-devel>
Status: RESOLVED FIXED    
Severity: crash    
Priority: NOR    
Version: Git   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In: 2.15.0 (KDE 14.12.0)
Sentry Crash Report:
Bug Depends on:    
Bug Blocks: 337627    
Attachments: proposed patch

Description Philipp Harms 2014-07-20 12:56:03 UTC
Created attachment 87828 [details]
proposed patch

Operating System: Linux 3.13.0-32-generic x86_64
Distribution: Ubuntu 14.04 LTS

Hi,

This is somewhat related to https://bugs.kde.org/show_bug.cgi?id=337627, but the problem occurs on deletion of the fragment.

Deleting a combined fragment with a dashed line and then selecting another widget causes a crash (see backtrace). The actual problem is that removing the combined fragment eventually calls deleteLater() on it, which deletes the dashed line, as well. In contrast, an (invalid) pointer to the dashed line is still in the UMLScene's m_WidgetList causing the trouble.

I attached a patch that adds an overload UMLWidget's cleanup method to CombinedFragmentWidget to remove the dashed lines from the scene.

best,
Philipp Harms

Backtrace:
#0  0x00000000017770f0 in ?? ()
#1  0x00007ffff4abc975 in __dynamic_cast ()
   from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#2  0x00000000007181d5 in UMLScene::onWidgetDestructionBox (this=0x1463360, 
    point=...) at /home/pharms/src/umbrello/umbrello/umlscene.cpp:974
#3  0x00000000006d0c06 in ToolBarState::setCurrentElement (this=0x153e870)
    at /home/pharms/src/umbrello/umbrello/toolbarstate.cpp:296
#4  0x00000000006d0526 in ToolBarState::mousePress (this=0x153e870, ome=
    0x7fffffffcd20) at /home/pharms/src/umbrello/umbrello/toolbarstate.cpp:90
#5  0x0000000000717adc in UMLScene::mousePressEvent (this=0x1463360, 
    event=0x7fffffffcd20)
    at /home/pharms/src/umbrello/umbrello/umlscene.cpp:883
#6  0x00007ffff6116100 in QGraphicsScene::event (this=0x1463360, event=
    0x7fffffffcd20) at graphicsview/qgraphicsscene.cpp:3455
#7  0x00007ffff5b30e2c in QApplicationPrivate::notify_helper (
    this=this@entry=0xaae010, receiver=receiver@entry=0x1463360, 
    e=e@entry=0x7fffffffcd20) at kernel/qapplication.cpp:4567
#8  0x00007ffff5b374a0 in QApplication::notify (
    this=this@entry=0x7fffffffdb50, receiver=receiver@entry=0x1463360, 
    e=e@entry=0x7fffffffcd20) at kernel/qapplication.cpp:4353
#9  0x00007ffff683bd1a in KApplication::notify (this=0x7fffffffdb50, 
    receiver=0x1463360, event=0x7fffffffcd20)
    at ../../kdeui/kernel/kapplication.cpp:311
#10 0x00007ffff4ee74dd in QCoreApplication::notifyInternal (this=
    0x7fffffffdb50, receiver=0x1463360, event=event@entry=0x7fffffffcd20)
    at kernel/qcoreapplication.cpp:953
#11 0x00007ffff5b2f556 in sendSpontaneousEvent (
    event=event@entry=0x7fffffffcd20, receiver=<optimized out>)
    at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:234
#12 qt_sendSpontaneousEvent (receiver=<optimized out>, 
    event=event@entry=0x7fffffffcd20) at kernel/qapplication.cpp:5565
#13 0x00007ffff612ca5f in QGraphicsView::mousePressEvent (this=0x13cacc0, 
    event=0x7fffffffd310) at graphicsview/qgraphicsview.cpp:3164
#14 0x00000000007296ec in UMLView::mousePressEvent (this=0x13cacc0, 
    event=0x7fffffffd310) at /home/pharms/src/umbrello/umbrello/umlview.cpp:237
#15 0x00007ffff5b8037b in QWidget::event (this=this@entry=0x13cacc0, 
    event=event@entry=0x7fffffffd310) at kernel/qwidget.cpp:8372
#16 0x00007ffff5f21fce in QFrame::event (this=0x13cacc0, e=0x7fffffffd310)
    at widgets/qframe.cpp:557
#17 0x00007ffff612d7b9 in QGraphicsView::viewportEvent (this=0x13cacc0, 
    event=0x7fffffffd310) at graphicsview/qgraphicsview.cpp:2866
#18 0x00007ffff4ee7646 in QCoreApplicationPrivate::sendThroughObjectEventFilters (this=this@entry=0xaae010, receiver=receiver@entry=0x1523dd0, 
    event=event@entry=0x7fffffffd310) at kernel/qcoreapplication.cpp:1063
#19 0x00007ffff5b30e0c in QApplicationPrivate::notify_helper (
    this=this@entry=0xaae010, receiver=receiver@entry=0x1523dd0, 
    e=e@entry=0x7fffffffd310) at kernel/qapplication.cpp:4563
#20 0x00007ffff5b375dd in QApplication::notify (
    this=this@entry=0x7fffffffdb50, receiver=receiver@entry=0x1523dd0, 
    e=e@entry=0x7fffffffd310) at kernel/qapplication.cpp:4110
#21 0x00007ffff683bd1a in KApplication::notify (this=0x7fffffffdb50, 
    receiver=0x1523dd0, event=0x7fffffffd310)
    at ../../kdeui/kernel/kapplication.cpp:311
#22 0x00007ffff4ee74dd in QCoreApplication::notifyInternal (
    this=0x7fffffffdb50, receiver=receiver@entry=0x1523dd0, 
    event=event@entry=0x7fffffffd310) at kernel/qcoreapplication.cpp:953
#23 0x00007ffff5b36d93 in sendEvent (event=<optimized out>, 
    receiver=<optimized out>)
    at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:231
#24 QApplicationPrivate::sendMouseEvent (receiver=receiver@entry=0x1523dd0, 
    event=event@entry=0x7fffffffd310, alienWidget=alienWidget@entry=0x1523dd0, 
    nativeWidget=nativeWidget@entry=0x11f4a10, 
    buttonDown=buttonDown@entry=0x7ffff6616318 <qt_button_down>, 
    lastMouseReceiver=..., spontaneous=spontaneous@entry=true)
    at kernel/qapplication.cpp:3178
#25 0x00007ffff5bab9cb in QETWidget::translateMouseEvent (
    this=this@entry=0x11f4a10, event=event@entry=0x7fffffffd690)
    at kernel/qapplication_x11.cpp:4634
#26 0x00007ffff5bab269 in QApplication::x11ProcessEvent (this=0x7fffffffdb50, 
    event=event@entry=0x7fffffffd690) at kernel/qapplication_x11.cpp:3627
#27 0x00007ffff5bd2b02 in x11EventSourceDispatch (s=0xaaec80, callback=0x0, 
    user_data=0x0) at kernel/qguieventdispatcher_glib.cpp:146
#28 0x00007ffff0d21e04 in g_main_context_dispatch ()
   from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#29 0x00007ffff0d22048 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#30 0x00007ffff0d220ec in g_main_context_iteration ()
   from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#31 0x00007ffff4f147a1 in QEventDispatcherGlib::processEvents (this=0xaad6e0, 
    flags=...) at kernel/qeventdispatcher_glib.cpp:434
#32 0x00007ffff5bd2bb6 in QGuiEventDispatcherGlib::processEvents (
    this=<optimized out>, flags=...) at kernel/qguieventdispatcher_glib.cpp:204
#33 0x00007ffff4ee60af in QEventLoop::processEvents (this=this@entry=
    0x7fffffffda60, flags=...) at kernel/qeventloop.cpp:149
#34 0x00007ffff4ee63a5 in QEventLoop::exec (this=this@entry=0x7fffffffda60, 
    flags=...) at kernel/qeventloop.cpp:204
#35 0x00007ffff4eebb79 in QCoreApplication::exec ()
    at kernel/qcoreapplication.cpp:1225
#36 0x00000000006b9529 in main (argc=1, argv=0x7fffffffdc88)
    at /home/pharms/src/umbrello/umbrello/main.cpp:123
Comment 1 Ralf Habacker 2014-12-02 01:24:55 UTC
Git commit 3b565d64199ca9c96eeb8b61dfa03996f0b9afb1 by Ralf Habacker, on behalf of Philipp Harms.
Committed on 20/07/2014 at 11:03.
Pushed by habacker into branch 'Applications/14.12'.

Fix in combined fragment widget. On removal of a combined fragment, remove all its dashed lines, as well.
FIXED-IN:2.15.0 (KDE 14.12.0)

M  +16   -0    umbrello/widgets/combinedfragmentwidget.cpp
M  +2    -0    umbrello/widgets/combinedfragmentwidget.h

http://commits.kde.org/umbrello/3b565d64199ca9c96eeb8b61dfa03996f0b9afb1
Comment 2 Ralf Habacker 2014-12-09 06:00:16 UTC
Git commit a07a9023061aab5147b326ec0b8dc9e52972b6c9 by Ralf Habacker, on behalf of Philipp Harms.
Committed on 20/07/2014 at 11:03.
Pushed by habacker into branch 'work/73847'.

Fix in combined fragment widget. On removal of a combined fragment, remove all its dashed lines, as well.
FIXED-IN:2.15.0 (KDE 14.12.0)

M  +16   -0    umbrello/widgets/combinedfragmentwidget.cpp
M  +2    -0    umbrello/widgets/combinedfragmentwidget.h

http://commits.kde.org/umbrello/a07a9023061aab5147b326ec0b8dc9e52972b6c9