Bug 275915

Summary: Crash using the scroll wheel on the Style Select widget
Product: [Applications] calligrawords Reporter: Marcus Harrison <marcus>
Component: generalAssignee: Sebastian Sauer <sebsauer>
Status: RESOLVED FIXED    
Severity: crash CC: mail, pstirnweiss
Priority: NOR Keywords: release_blocker
Version: unspecified   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Marcus Harrison 2011-06-17 17:03:01 UTC
Application: words (2.4 Alpha 2)
KDE Platform Version: 4.6.2 (4.6.2)
Qt Version: 4.7.2
Operating System: Linux 2.6.38-9-generic i686
Distribution: Ubuntu 11.04

-- Information about the crash:
- What I was doing when the application crashed:

I clicked the Style Selection widget to bring up the list of styles. Using my scroll-wheel to try and scroll down resulted in an immediate crash.

Calligra was compiled from sources but built against KDE 4.6.2 from the Kubuntu repositories.

-- Backtrace:
Application: Words (words), signal: Segmentation fault
[Current thread is 1 (Thread 0xb7868720 (LWP 5093))]

Thread 3 (Thread 0xb3dd9b70 (LWP 5095)):
#0  0x00e9dd41 in clock_gettime (clock_id=1, tp=0xb3dd8ff0) at ../sysdeps/unix/clock_gettime.c:116
#1  0x05b79dd8 in do_gettime () at tools/qelapsedtimer_unix.cpp:123
#2  qt_gettime () at tools/qelapsedtimer_unix.cpp:140
#3  0x05c464f2 in updateCurrentTime (this=0x86b7f9c, tm=...) at kernel/qeventdispatcher_unix.cpp:339
#4  QTimerInfoList::timerWait (this=0x86b7f9c, tm=...) at kernel/qeventdispatcher_unix.cpp:442
#5  0x05c44d32 in timerSourcePrepareHelper (src=<value optimized out>, timeout=0xb3dd90cc) at kernel/qeventdispatcher_glib.cpp:136
#6  0x05c44dcd in timerSourcePrepare (source=0x86b7f68, timeout=<value optimized out>) at kernel/qeventdispatcher_glib.cpp:169
#7  0x02392fd4 in g_main_context_prepare () from /lib/i386-linux-gnu/libglib-2.0.so.0
#8  0x02393e63 in ?? () from /lib/i386-linux-gnu/libglib-2.0.so.0
#9  0x02394524 in g_main_context_iteration () from /lib/i386-linux-gnu/libglib-2.0.so.0
#10 0x05c45577 in QEventDispatcherGlib::processEvents (this=0x86be698, flags=...) at kernel/qeventdispatcher_glib.cpp:424
#11 0x05c17289 in QEventLoop::processEvents (this=0xb3dd9280, flags=...) at kernel/qeventloop.cpp:149
#12 0x05c17522 in QEventLoop::exec (this=0xb3dd9280, flags=...) at kernel/qeventloop.cpp:201
#13 0x05b212a0 in QThread::exec (this=0x86979d0) at thread/qthread.cpp:492
#14 0x05bf8fdb in QInotifyFileSystemWatcherEngine::run (this=0x86979d0) at io/qfilesystemwatcher_inotify.cpp:248
#15 0x05b23da2 in QThreadPrivate::start (arg=0x86979d0) at thread/qthread_unix.cpp:320
#16 0x00d5fe99 in start_thread (arg=0xb3dd9b70) at pthread_create.c:304
#17 0x0793a73e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130

Thread 2 (Thread 0xb2678b70 (LWP 5102)):
#0  __pthread_mutex_unlock (mutex=0xb1d004dc) at pthread_mutex_unlock.c:289
#1  0x07948656 in pthread_mutex_unlock (mutex=0xb1d004dc) at forward.c:184
#2  0x023933d4 in g_main_context_query () from /lib/i386-linux-gnu/libglib-2.0.so.0
#3  0x02393e8c in ?? () from /lib/i386-linux-gnu/libglib-2.0.so.0
#4  0x02394524 in g_main_context_iteration () from /lib/i386-linux-gnu/libglib-2.0.so.0
#5  0x05c45577 in QEventDispatcherGlib::processEvents (this=0x86e2660, flags=...) at kernel/qeventdispatcher_glib.cpp:424
#6  0x05c17289 in QEventLoop::processEvents (this=0xb2678280, flags=...) at kernel/qeventloop.cpp:149
#7  0x05c17522 in QEventLoop::exec (this=0xb2678280, flags=...) at kernel/qeventloop.cpp:201
#8  0x05b212a0 in QThread::exec (this=0x872cd50) at thread/qthread.cpp:492
#9  0x05bf8fdb in QInotifyFileSystemWatcherEngine::run (this=0x872cd50) at io/qfilesystemwatcher_inotify.cpp:248
#10 0x05b23da2 in QThreadPrivate::start (arg=0x872cd50) at thread/qthread_unix.cpp:320
#11 0x00d5fe99 in start_thread (arg=0xb2678b70) at pthread_create.c:304
#12 0x0793a73e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130

Thread 1 (Thread 0xb7868720 (LWP 5093)):
[KCrash Handler]
#7  0x0039287f in KoList::add (this=0x98d4a60, block=..., level=0) at /home/marcus/Documents/kde-dev/calligra/calligra/libs/kotext/KoList.cpp:111
#8  0x003d3b38 in KoParagraphStyle::applyStyle (this=0x83f3d78, block=..., applyListStyle=true) at /home/marcus/Documents/kde-dev/calligra/calligra/libs/kotext/styles/KoParagraphStyle.cpp:245
#9  0x00bfcab1 in KoStyleThumbnailer::thumbnail (this=0x91e79f0, style=0x83f3d78) at /home/marcus/Documents/kde-dev/calligra/calligra/libs/textlayout/KoStyleThumbnailer.cpp:102
#10 0x0311b202 in StylesModel::data (this=0x9039538, index=..., role=1) at /home/marcus/Documents/kde-dev/calligra/calligra/plugins/textshape/dialogs/StylesModel.cpp:111
#11 0x01a7a4a5 in data (this=0x91855b0, option=0xbfdb6c80, index=...) at ../../include/QtCore/../../src/corelib/kernel/qabstractitemmodel.h:398
#12 QStyledItemDelegate::initStyleOption (this=0x91855b0, option=0xbfdb6c80, index=...) at itemviews/qstyleditemdelegate.cpp:340
#13 0x01a7b0ce in QStyledItemDelegate::paint (this=0x91855b0, painter=0xbfdb6f7c, option=..., index=...) at itemviews/qstyleditemdelegate.cpp:420
#14 0x0311bf20 in StylesDelegate::paint (this=0x91855b0, painter=0xbfdb6f7c, option=..., index=...) at /home/marcus/Documents/kde-dev/calligra/calligra/plugins/textshape/dialogs/StylesDelegate.cpp:36
#15 0x019f0177 in QListView::paintEvent (this=0x9099cb0, e=0xbfdb77a4) at itemviews/qlistview.cpp:1044
#16 0x014ae18e in QWidget::event (this=0x9099cb0, event=0xbfdb77a4) at kernel/qwidget.cpp:8405
#17 0x0189ff63 in QFrame::event (this=0x9099cb0, e=0xbfdb77a4) at widgets/qframe.cpp:557
#18 0x0192e5d2 in QAbstractScrollArea::viewportEvent (this=0x9099cb0, e=0xbfdb77a4) at widgets/qabstractscrollarea.cpp:1043
#19 0x019cd797 in QAbstractItemView::viewportEvent (this=0x9099cb0, event=0xbfdb77a4) at itemviews/qabstractitemview.cpp:1628
#20 0x01930ed5 in viewportEvent (this=0x9085ed8, o=0x913fd60, e=0xbfdb77a4) at widgets/qabstractscrollarea_p.h:100
#21 QAbstractScrollAreaFilter::eventFilter (this=0x9085ed8, o=0x913fd60, e=0xbfdb77a4) at widgets/qabstractscrollarea_p.h:116
#22 0x05c1825a in QCoreApplicationPrivate::sendThroughObjectEventFilters (this=0x81e8240, receiver=0x913fd60, event=0xbfdb77a4) at kernel/qcoreapplication.cpp:846
#23 0x01455d00 in QApplicationPrivate::notify_helper (this=0x81e8240, receiver=0x913fd60, e=0xbfdb77a4) at kernel/qapplication.cpp:4458
#24 0x0145a97b in QApplication::notify (this=0xbfdb8f9c, receiver=0x913fd60, e=0xbfdb77a4) at kernel/qapplication.cpp:4427
#25 0x0115f3ca in KApplication::notify (this=0xbfdb8f9c, receiver=0x913fd60, event=0xbfdb77a4) at ../../kdeui/kernel/kapplication.cpp:311
#26 0x05c180bb in QCoreApplication::notifyInternal (this=0xbfdb8f9c, receiver=0x913fd60, event=0xbfdb77a4) at kernel/qcoreapplication.cpp:731
#27 0x014aaf0c in sendSpontaneousEvent (this=0x8ef2478, pdev=0x8ed7280, rgn=..., offset=..., flags=4, sharedPainter=0x0, backingStore=0x8467b98) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:218
#28 QWidgetPrivate::drawWidget (this=0x8ef2478, pdev=0x8ed7280, rgn=..., offset=..., flags=4, sharedPainter=0x0, backingStore=0x8467b98) at kernel/qwidget.cpp:5492
#29 0x014abb7c in QWidgetPrivate::paintSiblingsRecursive (this=0x94d5580, pdev=0x8ed7280, siblings=..., index=<value optimized out>, rgn=..., offset=..., flags=4, sharedPainter=0x0, backingStore=0x8467b98) at kernel/qwidget.cpp:5699
#30 0x014aba42 in QWidgetPrivate::paintSiblingsRecursive (this=0x94d5580, pdev=0x8ed7280, siblings=..., index=3, rgn=..., offset=..., flags=4, sharedPainter=0x0, backingStore=0x8467b98) at kernel/qwidget.cpp:5686
#31 0x014aba42 in QWidgetPrivate::paintSiblingsRecursive (this=0x94d5580, pdev=0x8ed7280, siblings=..., index=4, rgn=..., offset=..., flags=4, sharedPainter=0x0, backingStore=0x8467b98) at kernel/qwidget.cpp:5686
#32 0x014aba42 in QWidgetPrivate::paintSiblingsRecursive (this=0x94d5580, pdev=0x8ed7280, siblings=..., index=5, rgn=..., offset=..., flags=4, sharedPainter=0x0, backingStore=0x8467b98) at kernel/qwidget.cpp:5686
#33 0x014aba42 in QWidgetPrivate::paintSiblingsRecursive (this=0x94d5580, pdev=0x8ed7280, siblings=..., index=6, rgn=..., offset=..., flags=4, sharedPainter=0x0, backingStore=0x8467b98) at kernel/qwidget.cpp:5686
#34 0x014aba42 in QWidgetPrivate::paintSiblingsRecursive (this=0x94d5580, pdev=0x8ed7280, siblings=..., index=7, rgn=..., offset=..., flags=4, sharedPainter=0x0, backingStore=0x8467b98) at kernel/qwidget.cpp:5686
#35 0x014aac80 in QWidgetPrivate::drawWidget (this=0x94d5580, pdev=0x8ed7280, rgn=..., offset=..., flags=4, sharedPainter=0x0, backingStore=0x8467b98) at kernel/qwidget.cpp:5545
#36 0x014abb7c in QWidgetPrivate::paintSiblingsRecursive (this=0x909ef20, pdev=0x8ed7280, siblings=..., index=<value optimized out>, rgn=..., offset=..., flags=4, sharedPainter=0x0, backingStore=0x8467b98) at kernel/qwidget.cpp:5699
#37 0x014aac80 in QWidgetPrivate::drawWidget (this=0x909ef20, pdev=0x8ed7280, rgn=..., offset=..., flags=5, sharedPainter=0x0, backingStore=0x8467b98) at kernel/qwidget.cpp:5545
#38 0x01686908 in QWidgetBackingStore::sync (this=0x8467b98) at painting/qbackingstore.cpp:1333
#39 0x014a0843 in QWidgetPrivate::syncBackingStore (this=0x909ef20) at kernel/qwidget.cpp:1842
#40 0x014ae7e5 in QWidget::event (this=0x8f5ca48, event=0x98d28d8) at kernel/qwidget.cpp:8552
#41 0x0189ff63 in QFrame::event (this=0x8f5ca48, e=0x98d28d8) at widgets/qframe.cpp:557
#42 0x01455d24 in QApplicationPrivate::notify_helper (this=0x81e8240, receiver=0x8f5ca48, e=0x98d28d8) at kernel/qapplication.cpp:4462
#43 0x0145a97b in QApplication::notify (this=0xbfdb8f9c, receiver=0x8f5ca48, e=0x98d28d8) at kernel/qapplication.cpp:4427
#44 0x0115f3ca in KApplication::notify (this=0xbfdb8f9c, receiver=0x8f5ca48, event=0x98d28d8) at ../../kdeui/kernel/kapplication.cpp:311
#45 0x05c180bb in QCoreApplication::notifyInternal (this=0xbfdb8f9c, receiver=0x8f5ca48, event=0x98d28d8) at kernel/qcoreapplication.cpp:731
#46 0x05c1bc79 in sendEvent (receiver=0x0, event_type=0, data=0x817ef20) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:215
#47 QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x817ef20) at kernel/qcoreapplication.cpp:1372
#48 0x05c1be0d in QCoreApplication::sendPostedEvents (receiver=0x0, event_type=0) at kernel/qcoreapplication.cpp:1265
#49 0x05c453c4 in sendPostedEvents (s=0x81ea6d0) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:220
#50 postEventSourceDispatch (s=0x81ea6d0) at kernel/qeventdispatcher_glib.cpp:277
#51 0x02393aa8 in g_main_context_dispatch () from /lib/i386-linux-gnu/libglib-2.0.so.0
#52 0x02394270 in ?? () from /lib/i386-linux-gnu/libglib-2.0.so.0
#53 0x02394524 in g_main_context_iteration () from /lib/i386-linux-gnu/libglib-2.0.so.0
#54 0x05c4553c in QEventDispatcherGlib::processEvents (this=0x817ea78, flags=...) at kernel/qeventdispatcher_glib.cpp:422
#55 0x01509775 in QGuiEventDispatcherGlib::processEvents (this=0x817ea78, flags=...) at kernel/qguieventdispatcher_glib.cpp:204
#56 0x05c17289 in QEventLoop::processEvents (this=0xbfdb8f24, flags=...) at kernel/qeventloop.cpp:149
#57 0x05c17522 in QEventLoop::exec (this=0xbfdb8f24, flags=...) at kernel/qeventloop.cpp:201
#58 0x05c1becc in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1008
#59 0x014538e7 in QApplication::exec () at kernel/qapplication.cpp:3736
#60 0x005dca75 in kdemain (argc=1, argv=0xbfdb90b4) at /home/marcus/Documents/kde-dev/calligra/calligra/words/part/main.cpp:43
#61 0x0804875b in main (argc=1, argv=0xbfdb90b4) at /home/marcus/Documents/kde-dev/calligra/build/words/part/words_dummy.cpp:3

Reported using DrKonqi
Comment 1 Sebastian Sauer 2011-06-17 20:29:14 UTC
A fix for that is in the calligra/words-emptyRootAreas-sebsauer branch and will be merged tomorrow to master if testing wents well.
Comment 2 Sebastian Sauer 2011-06-20 15:02:36 UTC
Actually the patch was unrelated. The problem here seems to be that somehow the listStyle the KoList has was either deleted so the KoList deals with a dangling pointer or the KoList itself was deleted meanwhile.

First I was thinking of a patch like;

diff --git a/libs/kotext/styles/KoParagraphStyle.cpp b/libs/kotext/styles/KoParagraphStyle.cpp
index 4dee03b..c9f7ed9 100644
--- a/libs/kotext/styles/KoParagraphStyle.cpp
+++ b/libs/kotext/styles/KoParagraphStyle.cpp
@@ -998,6 +998,8 @@ void KoParagraphStyle::setListStyle(KoListStyle *style)
 {
     if (d->listStyle == style)
         return;
+    if (d->list)
+        d->list->setStyle(style);
     if (d->listStyle && d->listStyle->parent() == this)
         delete d->listStyle;
     d->listStyle = style;

but since a d->list->setStyle(style) does actually style=style->clone(); that shouldn't be the problem but we probably do delete something somewhere else where we don't proper cleanup.
Comment 3 Pierre Stirnweiss 2012-01-21 16:24:40 UTC
Sebastian, you can now close this one. The style selection widget has been completely re-written to use a QComboBox derived class. Using the wheel now works.
Comment 4 Sebastian Sauer 2012-01-23 02:59:05 UTC
Great. Lot of thanks Pierre for the fix and Marcus for the feedback! Closing the bug-report.