Bug 296501

Summary: calligrawords crash when change spellchecker from english to french
Product: [Applications] calligrawords Reporter: desaparecido <luis.davila.pc>
Component: generalAssignee: Calligra Words Bugs <calligra-words-bugs-null>
Status: RESOLVED FIXED    
Severity: crash CC: cbo, franz.trischberger, i.anastasini
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: initialize m_document with 0 and check for m_document in setDefaultLanguage()

Description desaparecido 2012-03-21 15:09:00 UTC
Application: calligrawords (2.5 Alpha 1)
KDE Platform Version: 4.8.1 (4.8.1)
Qt Version: 4.8.0
Operating System: Linux 3.3.0-1-ARCH x86_64
Distribution: "Arch Linux"

-- Information about the crash:
- What I was doing when the application crashed:
changing the language in spellchecker configuration from english to french

- Custom settings of the application:
kde locale settings settings for spellcheck is already in french but calligra didn't recognized.  The language interface is english.

The crash can be reproduced every time.

-- Backtrace:
Application: Calligra Words (calligrawords), signal: Segmentation fault
Using host libthread_db library "/lib/libthread_db.so.1".
[KCrash Handler]
#6  0x00007f4085414230 in QTextDocument::characterCount() const () from /usr/lib/libQtGui.so.4
#7  0x00007f40647c2fb0 in ?? () from /usr/lib/kde4/spellcheck.so
#8  0x00007f40847acf11 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/libQtCore.so.4
#9  0x00007f408178cc72 in Sonnet::ConfigDialog::languageChanged(QString const&) () from /usr/lib/libkdeui.so.5
#10 0x00007f408178cc9f in Sonnet::ConfigDialog::Private::slotConfigChanged() () from /usr/lib/libkdeui.so.5
#11 0x00007f40847acf11 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/libQtCore.so.4
#12 0x00007f40847acf11 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/libQtCore.so.4
#13 0x00007f408178cfd2 in Sonnet::DictionaryComboBox::dictionaryChanged(QString const&) () from /usr/lib/libkdeui.so.5
#14 0x00007f408178d063 in Sonnet::DictionaryComboBox::Private::slotDictionaryChanged(int) () from /usr/lib/libkdeui.so.5
#15 0x00007f40847acf11 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/libQtCore.so.4
#16 0x00007f4085580271 in QComboBox::activated(int) () from /usr/lib/libQtGui.so.4
#17 0x00007f40855802f2 in ?? () from /usr/lib/libQtGui.so.4
#18 0x00007f40855813b7 in ?? () from /usr/lib/libQtGui.so.4
#19 0x00007f40847acf11 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/libQtCore.so.4
#20 0x00007f4085828802 in ?? () from /usr/lib/libQtGui.so.4
#21 0x00007f408557b86a in ?? () from /usr/lib/libQtGui.so.4
#22 0x00007f40847991f8 in QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject*, QEvent*) () from /usr/lib/libQtCore.so.4
#23 0x00007f408519c88f in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#24 0x00007f40851a2013 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#25 0x00007f4081731556 in KApplication::notify(QObject*, QEvent*) () from /usr/lib/libkdeui.so.5
#26 0x00007f408479906c in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/libQtCore.so.4
#27 0x00007f408519d892 in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) () from /usr/lib/libQtGui.so.4
#28 0x00007f408521a251 in ?? () from /usr/lib/libQtGui.so.4
#29 0x00007f4085218a4a in QApplication::x11ProcessEvent(_XEvent*) () from /usr/lib/libQtGui.so.4
#30 0x00007f4085240302 in ?? () from /usr/lib/libQtGui.so.4
#31 0x00007f4080aa08bd in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#32 0x00007f4080aa10b8 in ?? () from /usr/lib/libglib-2.0.so.0
#33 0x00007f4080aa1289 in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#34 0x00007f40847c80bf in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#35 0x00007f408523ff8e in ?? () from /usr/lib/libQtGui.so.4
#36 0x00007f4084797e52 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#37 0x00007f40847980a7 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#38 0x00007f4085668b26 in QDialog::exec() () from /usr/lib/libQtGui.so.4
#39 0x00007f40647c30d4 in ?? () from /usr/lib/kde4/spellcheck.so
#40 0x00007f40847acf11 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/libQtCore.so.4
#41 0x00007f4085196412 in QAction::triggered(bool) () from /usr/lib/libQtGui.so.4
#42 0x00007f40851965ff in QAction::activate(QAction::ActionEvent) () from /usr/lib/libQtGui.so.4
#43 0x00007f40855e4219 in ?? () from /usr/lib/libQtGui.so.4
#44 0x00007f40855ea322 in ?? () from /usr/lib/libQtGui.so.4
#45 0x00007f40817f21f0 in KMenu::mouseReleaseEvent(QMouseEvent*) () from /usr/lib/libkdeui.so.5
#46 0x00007f40851ecf64 in QWidget::event(QEvent*) () from /usr/lib/libQtGui.so.4
#47 0x00007f40855eb8bb in QMenu::event(QEvent*) () from /usr/lib/libQtGui.so.4
#48 0x00007f408519c8c4 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#49 0x00007f40851a2013 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#50 0x00007f4081731556 in KApplication::notify(QObject*, QEvent*) () from /usr/lib/libkdeui.so.5
#51 0x00007f408479906c in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/libQtCore.so.4
#52 0x00007f408519d892 in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) () from /usr/lib/libQtGui.so.4
#53 0x00007f408521a251 in ?? () from /usr/lib/libQtGui.so.4
#54 0x00007f4085218a4a in QApplication::x11ProcessEvent(_XEvent*) () from /usr/lib/libQtGui.so.4
#55 0x00007f4085240302 in ?? () from /usr/lib/libQtGui.so.4
#56 0x00007f4080aa08bd in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#57 0x00007f4080aa10b8 in ?? () from /usr/lib/libglib-2.0.so.0
#58 0x00007f4080aa1289 in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#59 0x00007f40847c80bf in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#60 0x00007f408523ff8e in ?? () from /usr/lib/libQtGui.so.4
#61 0x00007f4084797e52 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#62 0x00007f40847980a7 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#63 0x00007f408479cc05 in QCoreApplication::exec() () from /usr/lib/libQtCore.so.4
#64 0x00007f40863b201d in kdemain () from /usr/lib/libkdeinit4_calligrawords.so
#65 0x00007f408602f38d in __libc_start_main () from /lib/libc.so.6
#66 0x0000000000400671 in _start ()

Reported using DrKonqi
Comment 1 Franz Trischberger 2012-03-29 05:54:02 UTC
Created attachment 69982 [details]
initialize m_document with 0 and check for m_document in setDefaultLanguage()

Attached patch fixes the crash.
To reproduce the crash, you have to change the language of the spell checker immediately after opening a new empty document.
Comment 2 Camilla Boemann 2012-03-29 05:57:09 UTC
Ah thanks, yes can confirm now, will test and commit your patch right away
Comment 3 Camilla Boemann 2012-03-29 06:03:31 UTC
Git commit 1a347ab311eeb4d7db00c2bedede3921d5fe2ce9 by C. Boemann.
Committed on 29/03/2012 at 08:01.
Pushed by boemann into branch 'calligra/2.4'.

initialize value so we don't crash when changing language before typing

Thanks goes to: Franz Fellner

M  +2    -1    plugins/textediting/spellcheck/SpellCheck.cpp

http://commits.kde.org/calligra/1a347ab311eeb4d7db00c2bedede3921d5fe2ce9
Comment 4 Camilla Boemann 2012-03-29 06:03:31 UTC
Git commit 67992d6f1df9236530385bde08035da6fe1e8659 by C. Boemann.
Committed on 29/03/2012 at 08:01.
Pushed by boemann into branch 'master'.

initialize value so we don't crash when changing language before typing

Thanks goes to: Franz Fellner

M  +2    -1    plugins/textediting/spellcheck/SpellCheck.cpp

http://commits.kde.org/calligra/67992d6f1df9236530385bde08035da6fe1e8659
Comment 5 Franz Trischberger 2012-04-12 10:09:38 UTC
Only part of the fix landed in the 2.4-branch, making current stable release crash again.
Only trunk got the check for m_document in SpellCheck.cpp:146, 2.4-branch did not.
Comment 6 Camilla Boemann 2012-04-12 19:12:03 UTC
*** Bug 297962 has been marked as a duplicate of this bug. ***
Comment 7 Camilla Boemann 2012-04-12 19:13:35 UTC
I've just backported that bit too. sorry for that.
Fix should be available with 2.4.1