Bug 416013 - Umbrello Crash On Moving the Seconds element in the Class Diagram
Summary: Umbrello Crash On Moving the Seconds element in the Class Diagram
Status: RESOLVED FIXED
Alias: None
Product: umbrello
Classification: Applications
Component: general (show other bugs)
Version: 2.30.0 (KDE Applications 19.12.0)
Platform: Microsoft Windows Microsoft Windows
: NOR crash
Target Milestone: ---
Assignee: Umbrello Development Group
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-01-08 18:22 UTC by Hamid Sahraiee
Modified: 2020-12-20 15:37 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 2.30.2 (KDE Applications 19.12.2)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hamid Sahraiee 2020-01-08 18:22:36 UTC
SUMMARY
 when adding the second class into the class diagram and move it, so that the mouse cursor exit from class diagram view and enter the Toolbar region, then the app will crash.

[Don't press the Fit button beside of the Zoom bar  ]
1. create a new class diagram
2. create a new class and drag it to the Class Diagram [it position is fixed]
3. create the second class and drag it to the class diagram [Now Class diagram view focus on the second class]
4. click and drag the second class to the outside of the class diagram view [Cursor must move into the toolbar during the drag time ]
Some time need to move it in crazy mode ;)
4. Crash !

OBSERVED RESULT
app will be crashed.

EXPECTED RESULT


SOFTWARE/OS VERSIONS
Windows: Win 10 64bt / 1903
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
If I press the Fit button beside the zoom bar, it will not be crashed and all things will be fine.
Comment 1 Ralf Habacker 2020-01-09 10:44:37 UTC
This crash is caused by a recursive event loop that leads to a stack overflow and also occurs under Linux
...
#902 0x00007ffff2ea6a9e in QAbstractSlider::valueChanged(int) ()
#903 0x00007ffff2e46fab in QGraphicsViewPrivate::recalculateContentSize() ()
#904 0x00007ffff2e4cb89 in  ()
#905 0x00007ffff1f9ef8d in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) ()
#906 0x00007ffff2e1c4d5 in QGraphicsScene::sceneRectChanged(QRectF const&) ()
#907 0x00000000006a79e9 in UMLScene::resizeSceneToItems() ()
#908 0x0000000000624ab4 in UMLWidget::mouseMoveEvent(QGraphicsSceneMouseEvent*) ()
#909 0x000000000065e17a in ToolBarStateArrow::mouseMoveWidget() ()
#910 0x000000000066052c in ToolBarState::mouseMove(QGraphicsSceneMouseEvent*) ()
#911 0x000000000069b040 in UMLScene::mouseMoveEvent(QGraphicsSceneMouseEvent*) ()
#912 0x00007ffff2e36f1b in QGraphicsScene::event(QEvent*) ()
#913 0x00007ffff2814ebc in QApplicationPrivate::notify_helper(QObject*, QEvent*) ()
#914 0x00007ffff281c017 in QApplication::notify(QObject*, QEvent*) ()
#915 0x00007ffff67fc65a in KApplication::notify(QObject*, QEvent*) ()
#916 0x00007ffff1f8acce in QCoreApplication::notifyInternal(QObject*, QEvent*) ()
#917 0x00007ffff2e4d6e8 in QGraphicsViewPrivate::mouseMoveEventHandler(QMouseEvent*) ()
#918 0x00007ffff2e4d965 in QGraphicsView::scrollContentsBy(int, int) ()
#919 0x00007ffff1f9ef8d in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) ()
#920 0x00007ffff2ea6a9e in QAbstractSlider::valueChanged(int) ()
#921 0x00007ffff2e470c3 in QGraphicsViewPrivate::recalculateContentSize() ()
#922 0x00007ffff2e4cb89 in  ()
#923 0x00007ffff1f9ef8d in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) ()
#924 0x00007ffff2e1c4d5 in QGraphicsScene::sceneRectChanged(QRectF const&) ()
#925 0x00000000006a79e9 in UMLScene::resizeSceneToItems() ()
#926 0x0000000000624ab4 in UMLWidget::mouseMoveEvent(QGraphicsSceneMouseEvent*) ()
#927 0x000000000065e17a in ToolBarStateArrow::mouseMoveWidget() ()
#928 0x000000000066052c in ToolBarState::mouseMove(QGraphicsSceneMouseEvent*) ()
#929 0x000000000069b040 in UMLScene::mouseMoveEvent(QGraphicsSceneMouseEvent*) ()
#930 0x00007ffff2e36f1b in QGraphicsScene::event(QEvent*) ()
#931 0x00007ffff2814ebc in QApplicationPrivate::notify_helper(QObject*, QEvent*) ()
#932 0x00007ffff281c017 in QApplication::notify(QObject*, QEvent*) ()
#933 0x00007ffff67fc65a in KApplication::notify(QObject*, QEvent*) ()
#934 0x00007ffff1f8acce in QCoreApplication::notifyInternal(QObject*, QEvent*) ()
#935 0x00007ffff2e4d6e8 in QGraphicsViewPrivate::mouseMoveEventHandler(QMouseEvent*) ()
#936 0x00007ffff2e4d965 in QGraphicsView::scrollContentsBy(int, int) ()
#937 0x00007ffff1f9ef8d in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) ()
#938 0x00007ffff2ea6a9e in QAbstractSlider::valueChanged(int) ()
...
Comment 2 Ralf Habacker 2020-01-09 10:46:58 UTC
Git commit 21c34d60617211a5131ba8713af83fb9d8fbd8ce by Ralf Habacker.
Committed on 09/01/2020 at 10:46.
Pushed by habacker into branch 'release/19.12'.

Fix 'Umbrello Crash On Moving the Seconds element in the Class Diagram'

Break the recursive event loop in UMLScene::mouseMoveEvent().
FIXED-IN: 2.30.2 (KDE Applications 19.12.2)

M  +12   -2    umbrello/umlscene.cpp

https://invent.kde.org/kde/umbrello/commit/21c34d60617211a5131ba8713af83fb9d8fbd8ce
Comment 3 Ralf Habacker 2020-01-09 16:02:04 UTC
You may download an umbrello snapshot for Windows with this patch applied from https://umbrello.kde.org/snapshots.php
Comment 4 Hamid Sahraiee 2020-01-10 19:13:31 UTC
thank you.
Comment 5 Oliver Kellogg 2020-12-20 15:15:43 UTC
I observed a variation of this crash:
On a component diagram with a component and a port, I deselected the "Name as tooltip" property on the port and then dragged the port's name floatingtext toward the bottom edge of the diagram and beyond.

Here is the end of the backtrace on the basis of git master@afe5419.
The repeating cycle consists of the steps from #40 (QGraphicsViewPrivate::mouseMoveEventHandler) down to #23 (QAbstractScrollAreaPrivate::_q_vslide).
The immediate iteration on crash is the same, only that after QAbstractScrollAreaPrivate::_q_vslide (#5) is goes to QGraphicsView::scrollContentsBy (#4).
Fix is forthcoming.

(gdb) bt
#0  QWidgetPrivate::clipRect() const (this=this@entry=0x159a5c0)
    at ../../include/QtWidgets/5.15.2/QtWidgets/private/../../../../../src/widgets/kernel/qwidget_p.h:553
#1  QWidgetPrivate::scrollRect(QRect const&, int, int)
    (this=this@entry=0x159a5c0, rect=..., dx=dx@entry=0, dy=dy@entry=365) at kernel/qwidgetrepaintmanager.cpp:550
#2  QWidgetPrivate::scroll_sys(int, int) (this=0x159a5c0, dx=dx@entry=0, dy=dy@entry=365)
    at ../../include/QtCore/../../src/corelib/tools/qrect.h:184
#3  QWidget::scroll(int, int) (this=<optimized out>, dx=dx@entry=0, dy=dy@entry=365) at kernel/qwidget.cpp:10663
#4  QGraphicsView::scrollContentsBy(int, int) (this=0x1595800, dx=0, dy=365) at graphicsview/qgraphicsview.cpp:3697
#5  QAbstractScrollAreaPrivate::_q_vslide(int) (this=0x1598080, y=<optimized out>)
    at widgets/qabstractscrollarea.cpp:1420
#6  doActivate<false>(QObject*, int, void**) (sender=0x1597440, signal_index=7, argv=argv@entry=0x7fffff7ff370)
    at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:395
#7  QMetaObject::activate(QObject*, QMetaObject const*, int, void**)
    (sender=sender@entry=0x1597440, m=m@entry=0x7ffff38247e0 <QAbstractSlider::staticMetaObject>, local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x7fffff7ff370) at kernel/qobject.cpp:3946
#8  QAbstractSlider::valueChanged(int) (this=this@entry=0x1597440, _t1=<optimized out>, _t1@entry=-365)
    at .moc/moc_qabstractslider.cpp:309
#9  QAbstractSlider::setValue(int) (this=0x1597440, value=-365) at widgets/qabstractslider.cpp:548
#10 QGraphicsViewPrivate::recalculateContentSize() (this=0x1598080) at graphicsview/qgraphicsview.cpp:478
#11 doActivate<false>(QObject*, int, void**) (sender=0xf86230, signal_index=4, argv=argv@entry=0x7fffff7ff5e0)
    at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:395
#12 QMetaObject::activate(QObject*, QMetaObject const*, int, void**)
    (sender=<optimized out>, m=m@entry=0x7ffff38445c0 <QGraphicsScene::staticMetaObject>, local_signal_index=local_signal_index@entry=1, argv=argv@entry=0x7fffff7ff5e0) at kernel/qobject.cpp:3946
#13 QGraphicsScene::sceneRectChanged(QRectF const&) (this=<optimized out>, _t1=...) at .moc/moc_qgraphicsscene.cpp:353
#14 UMLScene::resizeSceneToItems() (this=0xf86230) at /b/home/umbrello-master/umbrello/umlscene.cpp:3693
#15 UMLWidget::mouseMoveEvent(QGraphicsSceneMouseEvent*) (this=0x151c080, event=0x1626970)
    at /b/home/umbrello-master/umbrello/umlwidgets/umlwidget.cpp:518
#16 ToolBarStateArrow::mouseMoveWidget() (this=0x1457110) at /b/home/umbrello-master/umbrello/toolbarstatearrow.cpp:174
#17 ToolBarState::mouseMove(QGraphicsSceneMouseEvent*) (this=0x1457110, ome=0x7fffff7ff970)
    at /b/home/umbrello-master/umbrello/toolbarstate.cpp:186
#18 UMLScene::mouseMoveEvent(QGraphicsSceneMouseEvent*) (this=0xf86230, ome=0x7fffff7ff970)
    at /b/home/umbrello-master/umbrello/umlscene.cpp:959
#19 QGraphicsScene::event(QEvent*) (this=0xf86230, event=0x7fffff7ff970) at graphicsview/qgraphicsscene.cpp:3429
#20 QApplicationPrivate::notify_helper(QObject*, QEvent*) (this=<optimized out>, receiver=0xf86230, e=0x7fffff7ff970)
    at kernel/qapplication.cpp:3632
#21 QCoreApplication::notifyInternal2(QObject*, QEvent*) (receiver=0xf86230, event=0x7fffff7ff970)
    at ../../include/QtCore/5.15.2/QtCore/private/../../../../../src/corelib/thread/qthread_p.h:325
#22 QGraphicsViewPrivate::mouseMoveEventHandler(QMouseEvent*) (this=0x1598080, event=0x1598400)
    at /usr/include/c++/10/bits/atomic_base.h:420
#23 QAbstractScrollAreaPrivate::_q_vslide(int) (this=0x1598080, y=<optimized out>)
    at widgets/qabstractscrollarea.cpp:1420
#24 doActivate<false>(QObject*, int, void**) (sender=0x1597440, signal_index=7, argv=argv@entry=0x7fffff7ffb00)
    at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:395
#25 QMetaObject::activate(QObject*, QMetaObject const*, int, void**)
    (sender=sender@entry=0x1597440, m=m@entry=0x7ffff38247e0 <QAbstractSlider::staticMetaObject>, local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x7fffff7ffb00) at kernel/qobject.cpp:3946
#26 QAbstractSlider::valueChanged(int) (this=this@entry=0x1597440, _t1=<optimized out>, _t1@entry=0)
    at .moc/moc_qabstractslider.cpp:309
#27 QAbstractSlider::setValue(int) (this=0x1597440, value=0) at widgets/qabstractslider.cpp:548
#28 QGraphicsViewPrivate::recalculateContentSize() (this=0x1598080) at graphicsview/qgraphicsview.cpp:463
#29 doActivate<false>(QObject*, int, void**) (sender=0xf86230, signal_index=4, argv=argv@entry=0x7fffff7ffd70)
    at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:395
#30 QMetaObject::activate(QObject*, QMetaObject const*, int, void**)
    (sender=<optimized out>, m=m@entry=0x7ffff38445c0 <QGraphicsScene::staticMetaObject>, local_signal_index=local_signal_index@entry=1, argv=argv@entry=0x7fffff7ffd70) at kernel/qobject.cpp:3946
#31 QGraphicsScene::sceneRectChanged(QRectF const&) (this=<optimized out>, _t1=...) at .moc/moc_qgraphicsscene.cpp:353
#32 UMLScene::resizeSceneToItems() (this=0xf86230) at /b/home/umbrello-master/umbrello/umlscene.cpp:3693
#33 UMLWidget::mouseMoveEvent(QGraphicsSceneMouseEvent*) (this=0x151c080, event=0x1626970)
    at /b/home/umbrello-master/umbrello/umlwidgets/umlwidget.cpp:518
#34 ToolBarStateArrow::mouseMoveWidget() (this=0x1457110) at /b/home/umbrello-master/umbrello/toolbarstatearrow.cpp:174
#35 ToolBarState::mouseMove(QGraphicsSceneMouseEvent*) (this=0x1457110, ome=0x7fffff800100)
    at /b/home/umbrello-master/umbrello/toolbarstate.cpp:186
#36 UMLScene::mouseMoveEvent(QGraphicsSceneMouseEvent*) (this=0xf86230, ome=0x7fffff800100)
    at /b/home/umbrello-master/umbrello/umlscene.cpp:959
#37 QGraphicsScene::event(QEvent*) (this=0xf86230, event=0x7fffff800100) at graphicsview/qgraphicsscene.cpp:3429
#38 QApplicationPrivate::notify_helper(QObject*, QEvent*) (this=<optimized out>, receiver=0xf86230, e=0x7fffff800100)
    at kernel/qapplication.cpp:3632
#39 QCoreApplication::notifyInternal2(QObject*, QEvent*) (receiver=0xf86230, event=0x7fffff800100)
    at ../../include/QtCore/5.15.2/QtCore/private/../../../../../src/corelib/thread/qthread_p.h:325
#40 QGraphicsViewPrivate::mouseMoveEventHandler(QMouseEvent*) (this=0x1598080, event=0x1598400)
    at /usr/include/c++/10/bits/atomic_base.h:420
#41 QAbstractScrollAreaPrivate::_q_vslide(int) (this=0x1598080, y=<optimized out>)
    at widgets/qabstractscrollarea.cpp:1420
Comment 6 Oliver Kellogg 2020-12-20 15:37:37 UTC
Git commit 364451b11146b5348736d11773deee42dd1a0957 by Oliver Kellogg.
Committed on 20/12/2020 at 15:34.
Pushed by okellogg into branch 'master'.

https://bugs.kde.org/show_bug.cgi?id=416013#c5
Followup to commit 21c34d6 fix for crash on moving element in diagram,
> Break the recursive event loop in UMLScene::mouseMoveEvent().

umbrello/umlscene.cpp function mouseMoveEvent
- Apparently the recursive loop is not limited to pre Qt5 versions.
  Remove #if QT_VERSION < 0x050000 preprocessor guard, i.e  make the
  previously #if dependent code unconditional. Remove #else part.

M  +0    -4    umbrello/umlscene.cpp

https://invent.kde.org/sdk/umbrello/commit/364451b11146b5348736d11773deee42dd1a0957