Bug 329648 - Crash on undo after source code import
Summary: Crash on undo after source code import
Status: RESOLVED FIXED
Alias: None
Product: umbrello
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR crash
Target Milestone: ---
Assignee: Umbrello Development Group
URL:
Keywords: drkonqi
Depends on:
Blocks:
 
Reported: 2014-01-06 11:44 UTC by Ralf Habacker
Modified: 2014-02-01 14:32 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ralf Habacker 2014-01-06 11:44:30 UTC
Application: umbrello (2.12.99-e34eb23)
KDE Platform Version: 4.11.3 (Compiled from sources)
Qt Version: 4.8.5
Operating System: Linux 3.4.47-2.38-desktop x86_64
Distribution: "openSUSE 12.2 (x86_64)"

-- Information about the crash:
- What I was doing when the application crashed:
I imported umbrello/widgets/artifactwidget.h and umbrello/widgets/actorwidget.h from the umbrello source code. 
The import creates many undo entries and I jumped to the first entry of the undo list.

The crash can be reproduced every time.

-- Backtrace:
Application: Umbrello UML Modeller (umbrello), signal: Segmentation fault
Using host libthread_db library "/lib64/libthread_db.so.1".
[Current thread is 1 (Thread 0x7f4e734e3780 (LWP 8207))]

Thread 3 (Thread 0x7f4e60ea0700 (LWP 8208)):
#0  0x00007f4e709c18f4 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007f4e70c5463b in wait (time=18446744073709551615, this=0x3067680) at thread/qwaitcondition_unix.cpp:86
#2  QWaitCondition::wait (this=<optimized out>, mutex=0x3067200, time=18446744073709551615) at thread/qwaitcondition_unix.cpp:158
#3  0x00007f4e703c9466 in QFileInfoGatherer::run (this=0x30671f0) at dialogs/qfileinfogatherer.cpp:214
#4  0x00007f4e70c540dc in QThreadPrivate::start (arg=0x30671f0) at thread/qthread_unix.cpp:338
#5  0x00007f4e709bde0e in start_thread () from /lib64/libpthread.so.0
#6  0x00007f4e6f2282cd in clone () from /lib64/libc.so.6

Thread 2 (Thread 0x7f4e5bfff700 (LWP 8209)):
#0  0x00007f4e709bfdc5 in pthread_mutex_lock () from /lib64/libpthread.so.0
#1  0x00007f4e6b712471 in g_mutex_lock () from /usr/lib64/libglib-2.0.so.0
#2  0x00007f4e6b6d5ec9 in g_main_context_prepare () from /usr/lib64/libglib-2.0.so.0
#3  0x00007f4e6b6d65ab in ?? () from /usr/lib64/libglib-2.0.so.0
#4  0x00007f4e6b6d67a4 in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#5  0x00007f4e70d7e4f6 in QEventDispatcherGlib::processEvents (this=0x7f4e540008c0, flags=...) at kernel/qeventdispatcher_glib.cpp:427
#6  0x00007f4e70d4eb2f in QEventLoop::processEvents (this=this@entry=0x7f4e5bffedd0, flags=...) at kernel/qeventloop.cpp:149
#7  0x00007f4e70d4edb8 in QEventLoop::exec (this=0x7f4e5bffedd0, flags=...) at kernel/qeventloop.cpp:204
#8  0x00007f4e70c51100 in QThread::exec (this=<optimized out>) at thread/qthread.cpp:536
#9  0x00007f4e70d2f29f in QInotifyFileSystemWatcherEngine::run (this=0x3067920) at io/qfilesystemwatcher_inotify.cpp:256
#10 0x00007f4e70c540dc in QThreadPrivate::start (arg=0x3067920) at thread/qthread_unix.cpp:338
#11 0x00007f4e709bde0e in start_thread () from /lib64/libpthread.so.0
#12 0x00007f4e6f2282cd in clone () from /lib64/libc.so.6

Thread 1 (Thread 0x7f4e734e3780 (LWP 8207)):
[KCrash Handler]
#5  isSignalConnected (signal_index=2, this=0x7f4e00000018) at kernel/qobject_p.h:242
#6  QMetaObject::activate (sender=0x354c5a0, m=<optimized out>, local_signal_index=0, argv=0x0) at kernel/qobject.cpp:3461
#7  0x00007f4e7052961f in QUndoStack::setIndex (this=<optimized out>, idx=321) at util/qundostack.cpp:782
#8  0x00007f4e7052b129 in QUndoModel::setStackCurrentIndex (this=0x2e644b0, index=...) at util/qundoview.cpp:160
#9  0x00007f4e70d6537f in QMetaObject::activate (sender=0x2e950f0, m=<optimized out>, local_signal_index=<optimized out>, argv=0x7fff2939bd40) at kernel/qobject.cpp:3556
#10 0x00007f4e7043742a in QItemSelectionModel::currentChanged (this=this@entry=0x2e950f0, _t1=..., _t2=...) at .moc/release-shared/moc_qitemselectionmodel.cpp:172
#11 0x00007f4e70437519 in QItemSelectionModel::setCurrentIndex (this=0x2e950f0, index=..., command=...) at itemviews/qitemselectionmodel.cpp:1175
#12 0x00007f4e703e8eba in QAbstractItemView::mousePressEvent (this=0x2e91710, event=<optimized out>) at itemviews/qabstractitemview.cpp:1682
#13 0x00007f4e6ff2c3c0 in QWidget::event (this=0x2e91710, event=0x7fff2939ca80) at kernel/qwidget.cpp:8372
#14 0x00007f4e702d7a86 in QFrame::event (this=0x2e91710, e=0x7fff2939ca80) at widgets/qframe.cpp:557
#15 0x00007f4e703e379b in QAbstractItemView::viewportEvent (this=0x2e91710, event=0x7fff2939ca80) at itemviews/qabstractitemview.cpp:1644
#16 0x00007f4e70d4ffe6 in QCoreApplicationPrivate::sendThroughObjectEventFilters (this=<optimized out>, receiver=0x2e914a0, event=0x7fff2939ca80) at kernel/qcoreapplication.cpp:1059
#17 0x00007f4e6fedc8ec in QApplicationPrivate::notify_helper (this=this@entry=0x29a9f10, receiver=receiver@entry=0x2e914a0, e=e@entry=0x7fff2939ca80) at kernel/qapplication.cpp:4558
#18 0x00007f4e6fee15fb in QApplication::notify (this=<optimized out>, receiver=0x2e914a0, e=0x7fff2939ca80) at kernel/qapplication.cpp:4105
#19 0x00007f4e71c88e16 in KApplication::notify(QObject*, QEvent*) () from /usr/lib64/libkdeui.so.5
#20 0x00007f4e70d4fe7e in QCoreApplication::notifyInternal (this=0x7fff2939d890, receiver=0x2e914a0, event=0x7fff2939ca80) at kernel/qcoreapplication.cpp:949
#21 0x00007f4e6fedd75b in sendEvent (event=<optimized out>, receiver=<optimized out>) at ../../src/corelib/kernel/qcoreapplication.h:231
#22 QApplicationPrivate::sendMouseEvent (receiver=0x2e914a0, event=0x7fff2939ca80, alienWidget=0x2e914a0, nativeWidget=0x2e8cdf0, buttonDown=0x7f4e709b2268 <qt_button_down>, lastMouseReceiver=..., spontaneous=true) at kernel/qapplication.cpp:3173
#23 0x00007f4e6ff58034 in QETWidget::translateMouseEvent (this=this@entry=0x2e8cdf0, event=event@entry=0x7fff2939d1f0) at kernel/qapplication_x11.cpp:4528
#24 0x00007f4e6ff56dc1 in QApplication::x11ProcessEvent (this=0x7fff2939d890, event=0x7fff2939d1f0) at kernel/qapplication_x11.cpp:3651
#25 0x00007f4e6ff7d162 in x11EventSourceDispatch (s=0x299fc90, callback=0x0, user_data=0x0) at kernel/qguieventdispatcher_glib.cpp:146
#26 0x00007f4e6b6d63b5 in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0
#27 0x00007f4e6b6d66e8 in ?? () from /usr/lib64/libglib-2.0.so.0
#28 0x00007f4e6b6d67a4 in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#29 0x00007f4e70d7e4d6 in QEventDispatcherGlib::processEvents (this=0x296ec60, flags=...) at kernel/qeventdispatcher_glib.cpp:425
#30 0x00007f4e6ff7cdde in QGuiEventDispatcherGlib::processEvents (this=<optimized out>, flags=...) at kernel/qguieventdispatcher_glib.cpp:204
#31 0x00007f4e70d4eb2f in QEventLoop::processEvents (this=this@entry=0x7fff2939d5c0, flags=...) at kernel/qeventloop.cpp:149
#32 0x00007f4e70d4edb8 in QEventLoop::exec (this=0x7fff2939d5c0, flags=...) at kernel/qeventloop.cpp:204
#33 0x00007f4e70d53af8 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1221
#34 0x00000000004392c2 in main (argc=<optimized out>, argv=0x7fff2939d9e8) at /home/ralf.habacker/src/umbrello/umbrello/main.cpp:113

Reported using DrKonqi
Comment 1 Ralf Habacker 2014-01-06 13:34:27 UTC
Further digging into this problem shows, that at least in CmdSetStereotype and CmdSetVisible the stored uml object pointer isn't valid, which results into the crash.
Comment 2 Oliver Kellogg 2014-01-11 18:17:28 UTC
(In reply to comment #0)
> [...] 
> -- Information about the crash:
> - What I was doing when the application crashed:
> I imported [...] source code. 
> The import creates many undo entries [...]

Good point. IMHO undo/redo should be globally disabled during an import.
Comment 3 Ralf Habacker 2014-01-12 17:47:20 UTC
Git commit 1281519196b65fd226b8812972cf6df8e9acd4be by Ralf Habacker.
Committed on 12/01/2014 at 14:03.
Pushed by habacker into branch 'master'.

Made 'Enable/Disable Undo' setting real working.

M  +2    -2    umbrello/listpopupmenu.cpp
M  +87   -44   umbrello/uml.cpp
M  +10   -4    umbrello/uml.h
M  +2    -2    umbrello/umldoc.cpp

http://commits.kde.org/umbrello/1281519196b65fd226b8812972cf6df8e9acd4be
Comment 4 Ralf Habacker 2014-01-12 18:11:04 UTC
Git commit e575ade17fe5e3dd10f964b86bf9f9a2266224c5 by Ralf Habacker.
Committed on 12/01/2014 at 14:03.
Pushed by habacker into branch 'KDE/4.12'.

Made 'Enable/Disable Undo' setting real working.
(cherry picked from commit 1281519196b65fd226b8812972cf6df8e9acd4be)

M  +2    -2    umbrello/listpopupmenu.cpp
M  +87   -44   umbrello/uml.cpp
M  +10   -4    umbrello/uml.h
M  +2    -2    umbrello/umldoc.cpp

http://commits.kde.org/umbrello/e575ade17fe5e3dd10f964b86bf9f9a2266224c5
Comment 5 Ralf Habacker 2014-01-12 18:13:27 UTC
Git commit 1714e06ff951c301fbc8e1eecf8b63c167836e8b by Ralf Habacker.
Committed on 12/01/2014 at 14:47.
Pushed by habacker into branch 'KDE/4.12'.

Disable undo while code importing to not pollute the undo stack.
(cherry picked from commit fd26bdd22cff46d765300f6e5dec005a240e5405)

M  +9    -0    umbrello/codeimpwizard/codeimpstatuspage.cpp
M  +1    -0    umbrello/codeimpwizard/codeimpstatuspage.h

http://commits.kde.org/umbrello/1714e06ff951c301fbc8e1eecf8b63c167836e8b
Comment 6 Ralf Habacker 2014-01-12 19:39:51 UTC
Git commit 732d15083de5a2d92e18e5c234efc706dab7d8a9 by Ralf Habacker.
Committed on 12/01/2014 at 14:03.
Pushed by habacker into branch 'KDE/4.11'.

Made 'Enable/Disable Undo' setting real working.
(cherry picked from commit 1281519196b65fd226b8812972cf6df8e9acd4be)

Conflicts:
	umbrello/listpopupmenu.cpp
	umbrello/uml.cpp

M  +2    -2    umbrello/listpopupmenu.cpp
M  +87   -44   umbrello/uml.cpp
M  +10   -4    umbrello/uml.h
M  +2    -2    umbrello/umldoc.cpp

http://commits.kde.org/umbrello/732d15083de5a2d92e18e5c234efc706dab7d8a9
Comment 7 Ralf Habacker 2014-01-12 19:39:52 UTC
Git commit 4df83c1bd7ce868e0d3f76aed793b8c1851f696e by Ralf Habacker.
Committed on 12/01/2014 at 14:47.
Pushed by habacker into branch 'KDE/4.11'.

Disable undo while code importing to not pollute the undo stack.
(cherry picked from commit fd26bdd22cff46d765300f6e5dec005a240e5405)

M  +9    -0    umbrello/codeimpwizard/codeimpstatuspage.cpp
M  +1    -0    umbrello/codeimpwizard/codeimpstatuspage.h

http://commits.kde.org/umbrello/4df83c1bd7ce868e0d3f76aed793b8c1851f696e
Comment 8 Ralf Habacker 2014-01-27 09:30:46 UTC
Git commit fd26bdd22cff46d765300f6e5dec005a240e5405 by Ralf Habacker.
Committed on 12/01/2014 at 14:47.
Pushed by habacker into branch 'master'.

Disable undo while code importing to not pollute the undo stack.

The drawback is, that not all widgets could be undo'ed and may confuse
users. May be better to merge one import into one undo entry.

M  +9    -0    umbrello/codeimpwizard/codeimpstatuspage.cpp
M  +1    -0    umbrello/codeimpwizard/codeimpstatuspage.h

http://commits.kde.org/umbrello/fd26bdd22cff46d765300f6e5dec005a240e5405
Comment 9 Ralf Habacker 2014-02-01 14:32:16 UTC
Crash will not occur by design