Bug 337627 - Creating a new combined fragment with a dashed line and pressing undo twice causes a crash.
Summary: Creating a new combined fragment with a dashed line and pressing undo twice c...
Status: RESOLVED FIXED
Alias: None
Product: umbrello
Classification: Applications
Component: general (show other bugs)
Version: Git
Platform: Ubuntu Linux
: NOR crash
Target Milestone: ---
Assignee: Umbrello Development Group
URL:
Keywords:
: 340151 (view as bug list)
Depends on: 337630
Blocks:
  Show dependency treegraph
 
Reported: 2014-07-20 12:33 UTC by Philipp Harms
Modified: 2014-12-09 06:00 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 2.15.0 (KDE 14.12.0)


Attachments
proposed patch (1.03 KB, patch)
2014-07-20 12:33 UTC, Philipp Harms
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Philipp Harms 2014-07-20 12:33:51 UTC
Created attachment 87827 [details]
proposed patch

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

Hi,

Creating a combined fragment with a dashed line, e.g. a alternative fragment, creates two undoable commands. Undoing the latter hides the dashed line and the fragment; pressing undo a second time causes a crash (see backtrace).

The problem is that the first undo eventually calls deleteLater() on the fragment (in umlscene.cpp line 1240). Since the dashed line is a child of it,
Qt's object system deletes it as well and the other undo has nothing but an invalid pointer as its widget().

I attached a patch that simply avoids creating the undo action for the dashed line. 

Cheers,
Philipp Harms

Backtrace:
#0  0x00007ffff43c9f79 in __GI_raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x00007ffff43cd388 in __GI_abort () at abort.c:89
#2  0x00007ffff4ddac92 in qt_message_output (msgType=msgType@entry=QtFatalMsg, 
    buf=0x155ae18 "ASSERT: \"umlWidget\" in file /home/pharms/src/umbrello/umbrello/cmds/widget/cmd_baseWidgetCommand.cpp, line 56") at global/qglobal.cpp:2383
#3  0x00007ffff4ddaff9 in qt_message(QtMsgType, const char *, typedef __va_list_tag __va_list_tag *) (msgType=msgType@entry=QtFatalMsg, 
    msg=0x7ffff4f48a20 "ASSERT: \"%s\" in file %s, line %d", 
    ap=ap@entry=0x7fffffffc878) at global/qglobal.cpp:2429
#4  0x00007ffff4ddb804 in qFatal (msg=<optimized out>)
    at global/qglobal.cpp:2612
#5  0x000000000061762a in Uml::CmdBaseWidgetCommand::widget (this=0x16ba8b0)
    at /home/pharms/src/umbrello/umbrello/cmds/widget/cmd_baseWidgetCommand.cpp:56
#6  0x0000000000619bde in Uml::CmdCreateWidget::undo (this=0x16ba8b0)
    at /home/pharms/src/umbrello/umbrello/cmds/widget/cmd_createWidget.cpp:66
#7  0x00007ffff6165d01 in QUndoStack::undo (this=<optimized out>)
    at util/qundostack.cpp:701
#8  0x00007ffff4efb87a in QMetaObject::activate (
    sender=sender@entry=0x10d8ef0, 
    m=m@entry=0x7ffff65dade0 <QAction::staticMetaObject>, 
    local_signal_index=local_signal_index@entry=1, 
    argv=argv@entry=0x7fffffffcae0) at kernel/qobject.cpp:3539
#9  0x00007ffff5b2aa62 in QAction::triggered (this=this@entry=0x10d8ef0, 
    _t1=false) at .moc/release-shared/moc_qaction.cpp:276
#10 0x00007ffff5b2c433 in QAction::activate (this=0x10d8ef0, 
    event=event@entry=QAction::Trigger) at kernel/qaction.cpp:1257
#11 0x00007ffff5b2c58c in QAction::event (this=<optimized out>, 
    e=<optimized out>) at kernel/qaction.cpp:1183
#12 0x00007ffff5b30e2c in QApplicationPrivate::notify_helper (
    this=this@entry=0xaaf010, receiver=receiver@entry=0x10d8ef0, e=e@entry=
    0x7fffffffcdc0) at kernel/qapplication.cpp:4567
#13 0x00007ffff5b374a0 in QApplication::notify (
    this=this@entry=0x7fffffffdb50, receiver=receiver@entry=0x10d8ef0, 
    e=e@entry=0x7fffffffcdc0) at kernel/qapplication.cpp:4353
#14 0x00007ffff683bd1a in KApplication::notify (this=0x7fffffffdb50, 
    receiver=0x10d8ef0, event=0x7fffffffcdc0)
    at ../../kdeui/kernel/kapplication.cpp:311
#15 0x00007ffff4ee74dd in QCoreApplication::notifyInternal (this=
    0x7fffffffdb50, receiver=0x10d8ef0, event=event@entry=0x7fffffffcdc0)
    at kernel/qcoreapplication.cpp:953
#16 0x00007ffff5b622a6 in sendEvent (event=0x7fffffffcdc0, 
    receiver=<optimized out>)
    at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:231
#17 QShortcutMap::dispatchEvent (this=this@entry=0xaaf138, e=e@entry=
    0x7fffffffd100) at kernel/qshortcutmap.cpp:887
#18 0x00007ffff5b623dc in QShortcutMap::tryShortcutEvent (this=0xaaf138, 
    o=o@entry=0x156b710, e=e@entry=0x7fffffffd100)
    at kernel/qshortcutmap.cpp:367
#19 0x00007ffff5b38773 in QApplication::notify (
    this=this@entry=0x7fffffffdb50, receiver=receiver@entry=0x156b710, 
    e=e@entry=0x7fffffffd100) at kernel/qapplication.cpp:3991
#20 0x00007ffff683bd1a in KApplication::notify (this=0x7fffffffdb50, 
    receiver=0x156b710, event=0x7fffffffd100)
    at ../../kdeui/kernel/kapplication.cpp:311
#21 0x00007ffff4ee74dd in QCoreApplication::notifyInternal (
    this=0x7fffffffdb50, receiver=receiver@entry=0x156b710, 
    event=event@entry=0x7fffffffd100) at kernel/qcoreapplication.cpp:953
#22 0x00007ffff5b2f556 in sendSpontaneousEvent (
    event=event@entry=0x7fffffffd100, receiver=receiver@entry=0x156b710)
    at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:234
#23 qt_sendSpontaneousEvent (receiver=receiver@entry=0x156b710, 
    event=event@entry=0x7fffffffd100) at kernel/qapplication.cpp:5565
#24 0x00007ffff5bcfff7 in QKeyMapper::sendKeyEvent (keyWidget=keyWidget@entry=
    0x156b710, grab=grab@entry=false, type=QEvent::KeyPress, code=90, 
    modifiers=..., text=..., autorepeat=autorepeat@entry=false, count=1, 
    nativeScanCode=29, nativeVirtualKey=122, nativeModifiers=20)
    at kernel/qkeymapper_x11.cpp:1866
#25 0x00007ffff5bd0399 in QKeyMapperPrivate::translateKeyEvent (this=0xb0ef40, 
    keyWidget=keyWidget@entry=0x156b710, event=event@entry=0x7fffffffd690, 
    grab=grab@entry=false) at kernel/qkeymapper_x11.cpp:1836
#26 0x00007ffff5baa3f7 in QApplication::x11ProcessEvent (this=0x7fffffffdb50, 
    event=event@entry=0x7fffffffd690) at kernel/qapplication_x11.cpp:3642
#27 0x00007ffff5bd2b02 in x11EventSourceDispatch (s=0xaafc80, 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=0xaae6e0, 
    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 0x00000000006b97e1 in main (argc=1, argv=0x7fffffffdc88)
    at /home/pharms/src/umbrello/umbrello/main.cpp:123
Comment 1 Ralf Habacker 2014-11-26 23:33:55 UTC
(In reply to Philipp Harms from comment #0)
> Created attachment 87827 [details]
> proposed patch
> 
patch works basically, unfortunally redo of the combined fragment crashes too.
Comment 2 Ralf Habacker 2014-12-02 01:19:43 UTC
(In reply to Ralf Habacker from comment #1)
> (In reply to Philipp Harms from comment #0)
> > Created attachment 87827 [details]
> > proposed patch
> > 
> patch works basically, unfortunally redo of the combined fragment crashes too.
undo fix is provided with bug 337630
Comment 3 Ralf Habacker 2014-12-02 01:24:57 UTC
Git commit 2c0f240a215fdea81f504338a604c276d192727f by Ralf Habacker, on behalf of Philipp Harms.
Committed on 20/07/2014 at 11:24.
Pushed by habacker into branch 'Applications/14.12'.

Fix in combined fragment widget: Avoid the creation of an undo action for the dashed line of a combined fragment.
FIXED-IN:2.15.0 (KDE 14.12.0)

M  +1    -1    umbrello/widgets/combinedfragmentwidget.cpp

http://commits.kde.org/umbrello/2c0f240a215fdea81f504338a604c276d192727f
Comment 4 Ralf Habacker 2014-12-02 01:45:41 UTC
*** Bug 340151 has been marked as a duplicate of this bug. ***
Comment 5 Ralf Habacker 2014-12-09 06:00:16 UTC
Git commit ae07425681b6989ca347ccf70689befa7823d419 by Ralf Habacker, on behalf of Philipp Harms.
Committed on 20/07/2014 at 11:24.
Pushed by habacker into branch 'work/73847'.

Fix in combined fragment widget: Avoid the creation of an undo action for the dashed line of a combined fragment.
FIXED-IN:2.15.0 (KDE 14.12.0)

M  +1    -1    umbrello/widgets/combinedfragmentwidget.cpp

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