Bug 319048 - crash on loading odt
Summary: crash on loading odt
Status: RESOLVED FIXED
Alias: None
Product: calligrawords
Classification: Applications
Component: general (show other bugs)
Version: 2.7 Pre-Alpha
Platform: Compiled Sources Linux
: NOR crash
Target Milestone: ---
Assignee: Calligra Words Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-29 07:50 UTC by Jos van den Oever
Modified: 2013-05-27 14:15 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
Simple text file with coloured text. (3.34 KB, application/vnd.oasis.opendocument.text)
2013-04-29 07:51 UTC, Jos van den Oever
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jos van den Oever 2013-04-29 07:50:27 UTC
Application: calligrawords (2.7 Pre-Alpha)
KDE Platform Version: 4.10.2 (Compiled from sources)
Qt Version: 4.8.4
Operating System: Linux 3.8.4-102.fc17.x86_64 x86_64
Distribution: "Fedora release 17 (Beefy Miracle)"

-- Information about the crash:
- What I was doing when the application crashed:
Loaded a hand-crafted valid odf 1.2 file. The ODT is not very special: it has some colored text.

- Unusual behavior I noticed:
None.

- Custom settings of the application:
Built from source.

The crash can be reproduced every time.

-- Backtrace:
Application: Calligra Words (calligrawords), signal: Segmentation fault
Using host libthread_db library "/lib64/libthread_db.so.1".
82	T_PSEUDO (SYSCALL_SYMBOL, SYSCALL_NAME, SYSCALL_NARGS)
[KCrash Handler]
#6  QString (other=<error reading variable: Cannot access memory at address 0x18>, this=0x7fff0a556830) at /usr/include/QtCore/qstring.h:725
#7  KoParagraphStyle::name (this=0x0) at /home/oever/work/nokia/src/calligra/libs/kotext/styles/KoParagraphStyle.cpp:944
#8  0x00007fca5f17adae in DockerStylesComboModel::styleApplied (this=0x4554790, style=0x2415d30) at /home/oever/work/nokia/src/calligra/plugins/textshape/dialogs/DockerStylesComboModel.cpp:174
#9  0x00007fca5f17f1cc in qt_static_metacall (_a=<optimized out>, _id=<optimized out>, _o=<optimized out>, _c=<optimized out>) at plugins/textshape/SimpleParagraphWidget.moc:81
#10 SimpleParagraphWidget::qt_static_metacall (_o=<optimized out>, _c=<optimized out>, _id=<optimized out>, _a=<optimized out>) at plugins/textshape/SimpleParagraphWidget.moc:67
#11 0x00000030d3f8cdef in QMetaObject::activate (sender=0x21e51c0, m=<optimized out>, local_signal_index=<optimized out>, argv=0x7fff0a556a10) at kernel/qobject.cpp:3539
#12 0x00007fca6c3170f2 in KoStyleManager::styleApplied (this=this@entry=0x21e51c0, _t1=_t1@entry=0x2415d30) at libs/kotext/KoStyleManager.moc:319
#13 0x00007fca6c317500 in KoStyleManager::slotAppliedStyle (this=0x21e51c0, style=0x2415d30) at /home/oever/work/nokia/src/calligra/libs/kotext/styles/KoStyleManager.cpp:539
#14 0x00000030d3f8cdef in QMetaObject::activate (sender=0x2415d30, m=<optimized out>, local_signal_index=<optimized out>, argv=0x7fff0a556b90) at kernel/qobject.cpp:3539
#15 0x00007fca6c307eb2 in KoParagraphStyle::styleApplied (this=this@entry=0x2415d30, _t1=_t1@entry=0x2415d30) at libs/kotext/KoParagraphStyle.moc:108
#16 0x00007fca6c308aa8 in KoParagraphStyle::applyStyle (this=0x2415d30, format=...) at /home/oever/work/nokia/src/calligra/libs/kotext/styles/KoParagraphStyle.cpp:259
#17 0x00007fca6c3089e0 in KoParagraphStyle::applyStyle (this=this@entry=0x49bd2a0, format=...) at /home/oever/work/nokia/src/calligra/libs/kotext/styles/KoParagraphStyle.cpp:239
#18 0x00007fca6c30925e in KoParagraphStyle::applyStyle (this=0x49bd2a0, block=..., applyListStyle=true) at /home/oever/work/nokia/src/calligra/libs/kotext/styles/KoParagraphStyle.cpp:267
#19 0x00007fca6b08ead0 in KoStyleThumbnailer::thumbnail (this=0x45521f0, style=<optimized out>, size=..., recreateThumbnail=<optimized out>, flags=...) at /home/oever/work/nokia/src/calligra/libs/textlayout/KoStyleThumbnailer.cpp:126
#20 0x00007fca5f1a1b49 in StylesModel::data (this=0x4554530, index=..., role=role@entry=1) at /home/oever/work/nokia/src/calligra/plugins/textshape/dialogs/StylesModel.cpp:115
#21 0x00007fca5f17aa0b in DockerStylesComboModel::data (this=0x4554790, index=..., role=<optimized out>) at /home/oever/work/nokia/src/calligra/plugins/textshape/dialogs/DockerStylesComboModel.cpp:80
#22 0x00000030d5b990d3 in QComboBoxPrivate::itemIcon (this=this@entry=0x4555860, index=...) at widgets/qcombobox.cpp:1677
#23 0x00000030d5b99da3 in QComboBox::itemIcon (this=this@entry=0x45557f0, index=index@entry=35) at widgets/qcombobox.cpp:2091
#24 0x00000030d5b9a56f in QComboBoxPrivate::recomputeSizeHint (this=0x4555860, sh=...) at widgets/qcombobox.cpp:314
#25 0x00000030d5b9a794 in QComboBox::sizeHint (this=<optimized out>) at widgets/qcombobox.cpp:2342
#26 0x00000030d57f6f8a in updateCacheIfNecessary (this=0x448f5a0) at kernel/qlayoutitem.cpp:700
#27 QWidgetItemV2::updateCacheIfNecessary (this=0x448f5a0) at kernel/qlayoutitem.cpp:695
#28 0x00000030d57f72dd in minimumSize (this=0x448f5a0) at kernel/qlayoutitem.cpp:775
#29 QWidgetItemV2::minimumSize (this=0x448f5a0) at kernel/qlayoutitem.cpp:769
#30 0x00000030d57ed0fe in minimumSize (this=<optimized out>) at kernel/qgridlayout.cpp:76
#31 QGridLayoutPrivate::setupLayoutData (this=this@entry=0x4555260, hSpacing=2, vSpacing=vSpacing@entry=2) at kernel/qgridlayout.cpp:790
#32 0x00000030d57edbf5 in QGridLayoutPrivate::findSize (this=this@entry=0x4555260, size=size@entry=&QLayoutStruct::maximumSize, hSpacing=<optimized out>, vSpacing=vSpacing@entry=2) at kernel/qgridlayout.cpp:423
#33 0x00000030d57edd52 in QGridLayoutPrivate::maximumSize (this=this@entry=0x4555260, hSpacing=<optimized out>, vSpacing=vSpacing@entry=2) at kernel/qgridlayout.cpp:467
#34 0x00000030d57edd97 in QGridLayout::maximumSize (this=0x4555230) at kernel/qgridlayout.cpp:1316
#35 0x00000030d57d7bdc in QBoxLayoutPrivate::setupGeom (this=this@entry=0x4555050) at kernel/qboxlayout.cpp:304
#36 0x00000030d57d83e6 in QBoxLayout::sizeHint (this=<optimized out>) at kernel/qboxlayout.cpp:675
#37 0x00000030d57f318a in QLayout::totalSizeHint (this=0x4555020) at kernel/qlayout.cpp:846
#38 0x00000030d5807800 in QWidget::sizeHint (this=<optimized out>) at kernel/qwidget.cpp:8222
#39 0x00000030d57f6f8a in updateCacheIfNecessary (this=0x44941f0) at kernel/qlayoutitem.cpp:700
#40 QWidgetItemV2::updateCacheIfNecessary (this=0x44941f0) at kernel/qlayoutitem.cpp:695
#41 0x00000030d57f72dd in minimumSize (this=0x44941f0) at kernel/qlayoutitem.cpp:775
#42 QWidgetItemV2::minimumSize (this=0x44941f0) at kernel/qlayoutitem.cpp:769
#43 0x00000030d57ed0fe in minimumSize (this=<optimized out>) at kernel/qgridlayout.cpp:76
#44 QGridLayoutPrivate::setupLayoutData (this=this@entry=0x4554940, hSpacing=0, vSpacing=vSpacing@entry=0) at kernel/qgridlayout.cpp:790
#45 0x00000030d57edbf5 in QGridLayoutPrivate::findSize (this=this@entry=0x4554940, size=size@entry=&QLayoutStruct::minimumSize, hSpacing=<optimized out>, vSpacing=vSpacing@entry=0) at kernel/qgridlayout.cpp:423
#46 0x00000030d57edca2 in QGridLayoutPrivate::minimumSize (this=this@entry=0x4554940, hSpacing=<optimized out>, vSpacing=vSpacing@entry=0) at kernel/qgridlayout.cpp:472
#47 0x00000030d57edce7 in QGridLayout::minimumSize (this=0x4554910) at kernel/qgridlayout.cpp:1302
#48 0x00000030d57f30f9 in QLayout::totalMinimumSize (this=this@entry=0x4554910) at kernel/qlayout.cpp:823
#49 0x00000030d57f4488 in QLayout::activate (this=0x4554910) at kernel/qlayout.cpp:1223
#50 0x00000030d581c3e4 in QWidget::setVisible (this=0x4551ec0, visible=<optimized out>) at kernel/qwidget.cpp:7744
#51 0x00007fca6c946fae in show (this=0x4551ec0) at /usr/include/QtGui/qwidget.h:494
#52 KoModeBox::setOptionWidgets (this=0x4334c00, optionWidgetList=...) at /home/oever/work/nokia/src/calligra/libs/main/KoModeBox.cpp:402
#53 0x00000030d3f8cdef in QMetaObject::activate (sender=0x27cbdd0, m=<optimized out>, local_signal_index=<optimized out>, argv=0x7fff0a55bae0) at kernel/qobject.cpp:3539
#54 0x00007fca6bf801c2 in KoCanvasControllerWidget::toolOptionWidgetsChanged (this=<optimized out>, _t1=...) at libs/flake/KoCanvasControllerWidget.moc:110
#55 0x00007fca6bf900b7 in KoToolManager::Private::postSwitchTool (this=this@entry=0x27cb950, temporary=temporary@entry=false) at /home/oever/work/nokia/src/calligra/libs/flake/KoToolManager.cpp:372
#56 0x00007fca6bf916d2 in switchTool (temporary=false, tool=0x300d080, this=0x27cb950) at /home/oever/work/nokia/src/calligra/libs/flake/KoToolManager.cpp:262
#57 KoToolManager::Private::switchTool (this=0x27cb950, tool=0x300d080, temporary=false) at /home/oever/work/nokia/src/calligra/libs/flake/KoToolManager.cpp:249
#58 0x00007fca6bf9240f in KoToolManager::Private::switchTool (this=0x27cb950, id=..., temporary=false) at /home/oever/work/nokia/src/calligra/libs/flake/KoToolManager.cpp:286
#59 0x00007fca6067f0ea in KWPart::setupViewInstance (this=<optimized out>, view=0x242f8e0) at /home/oever/work/nokia/src/calligra/words/part/KWPart.cpp:97
#60 0x00007fca6067e937 in KWPart::createViewInstance (this=0x21d87e0, parent=0x20d3c40) at /home/oever/work/nokia/src/calligra/words/part/KWPart.cpp:73
#61 0x00007fca6c9943aa in KoPart::createView (this=0x21d87e0, parent=<optimized out>) at /home/oever/work/nokia/src/calligra/libs/main/KoPart.cpp:234
#62 0x00007fca6c9310a1 in KoMainWindow::setRootDocument (this=this@entry=0x20d3c40, doc=doc@entry=0x21e3740, rootPart=rootPart@entry=0x0) at /home/oever/work/nokia/src/calligra/libs/main/KoMainWindow.cpp:502
#63 0x00007fca6c931b25 in KoMainWindow::slotLoadCompleted (this=0x20d3c40) at /home/oever/work/nokia/src/calligra/libs/main/KoMainWindow.cpp:770
#64 0x00007fca6c93388a in KoMainWindow::qt_static_metacall (_o=0x20d3c40, _c=<optimized out>, _id=<optimized out>, _a=0x7fff0a55c130) at libs/main/KoMainWindow.moc:142
#65 0x00000030d3f8cdef in QMetaObject::activate (sender=0x21d87e0, m=<optimized out>, local_signal_index=<optimized out>, argv=0x0) at kernel/qobject.cpp:3539
#66 0x0000003e41228949 in KParts::ReadOnlyPartPrivate::openLocalFile (this=this@entry=0x21e0e70) at /usr/src/debug/kdelibs-4.10.2/kparts/part.cpp:594
#67 0x0000003e41228e44 in KParts::ReadOnlyPart::openUrl (this=0x21d87e0, url=...) at /usr/src/debug/kdelibs-4.10.2/kparts/part.cpp:555
#68 0x00007fca6c8fd936 in KoDocument::openUrl (this=0x21e3740, _url=...) at /home/oever/work/nokia/src/calligra/libs/main/KoDocument.cpp:983
#69 0x00007fca6c922d85 in KoMainWindow::openDocumentInternal (this=this@entry=0x20d3c40, url=..., newpart=newpart@entry=0x21d87e0, newdoc=newdoc@entry=0x21e3740) at /home/oever/work/nokia/src/calligra/libs/main/KoMainWindow.cpp:734
#70 0x00007fca6c931769 in KoMainWindow::openDocument (this=0x20d3c40, newPart=0x21d87e0, url=...) at /home/oever/work/nokia/src/calligra/libs/main/KoMainWindow.cpp:713
#71 0x00007fca6c8f1e41 in KoApplication::start (this=0x7fff0a55cfc0) at /home/oever/work/nokia/src/calligra/libs/main/KoApplication.cpp:460
#72 0x00007fca6cbe8d76 in kdemain (argc=<optimized out>, argv=0x7fff0a55d0d8) at /home/oever/work/nokia/src/calligra/words/app/main.cpp:41
#73 0x000000396d621735 in __libc_start_main (main=0x400810 <main(int, char**)>, argc=2, ubp_av=0x7fff0a55d0d8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fff0a55d0c8) at libc-start.c:226
#74 0x0000000000400841 in _start ()

Reported using DrKonqi
Comment 1 Jos van den Oever 2013-04-29 07:51:26 UTC
Created attachment 79534 [details]
Simple text file with coloured text.
Comment 2 Elvis Stansvik 2013-05-27 14:15:48 UTC
Git commit 21d4b1f97167e4974c46bd90aeaf8cda3268d97c by Elvis Stansvik.
Committed on 27/05/2013 at 16:11.
Pushed by astan into branch 'master'.

Ignore default styles in styleApplied.

DockerStylesComboModel::styleApplied may be called with the default
paragraph style as argument.

The function assumes that the source model can provide an index for the
supplied style (see the calls to indexForCharacterStyle). But the source
model explicitly avoids adding items for the default styles, so these
calls will return an invalid index, which results in a -1 being added as
a row to m_usedStyles. In the next call to styleApplied, this will
result in an invalid internalId being used to try to get the
corresponding style from the style manager. The invalid style pointer is
then used, resulting in the crash described in the bug.

This fix turns DockerStylesComboModel::styleApplied into a no-op if the
supplied style is either the default character style or the default
paragraph styles, since there will never be any items for these in the
source model.
REVIEW: 110506

M  +6    -0    plugins/textshape/dialogs/DockerStylesComboModel.cpp

http://commits.kde.org/calligra/21d4b1f97167e4974c46bd90aeaf8cda3268d97c