Bug 255511 - Assert in KoPathShape on loading attached ODS
Summary: Assert in KoPathShape on loading attached ODS
Status: RESOLVED FIXED
Alias: None
Product: calligrasheets
Classification: Applications
Component: general (show other bugs)
Version: Git
Platform: Unlisted Binaries Linux
: NOR crash
Target Milestone: ---
Assignee: Calligra Sheets (KSpread) Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-28 16:47 UTC by Sebastian Sauer
Modified: 2010-10-28 20:19 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
The ODS document that produces the assert. (4.90 KB, application/x-zip-compressed)
2010-10-28 16:48 UTC, Sebastian Sauer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sebastian Sauer 2010-10-28 16:47:19 UTC
Version:           svn
OS:                Linux

The attached document contains in content.xml the lines;

<draw:custom-shape draw:name="diamond" svg:x="46px" svg:y="6px" svg:width="177px" svg:height="177px" draw:style-name="A1">
       <draw:enhanced-geometry draw:enhanced-path="M ?f0 ?f7 L ?f11 ?f2 ?f1 ?f7 ?f11 ?f3 Z N" draw:path-stretchpoint-x="21600" draw:path-stretchpoint-y="21600" draw:type="non-primitive"/>
</draw:custom-shape>

they are used to produce a diamond shape. If you change the xml above to following it doesn't assert any longer;

<draw:custom-shape draw:name="diamond" svg:x="46px" svg:y="6px" svg:width="177px" svg:height="177px" draw:style-name="A1">
       <draw:enhanced-geometry draw:enhanced-path="M ?f0 ?f7 L ?f11 ?f2 ?f1 ?f7 ?f11 ?f3 Z N" draw:path-stretchpoint-x="21600" draw:path-stretchpoint-y="21600" draw:type="non-primitive"/>
       <draw:equation draw:formula="left" draw:name="f0"/>
       <draw:equation draw:formula="right" draw:name="f1"/>
       <draw:equation draw:formula="top" draw:name="f2"/>
       <draw:equation draw:formula="bottom" draw:name="f3"/>
</draw:custom-shape>

So, the reason for the crash are the missing equation's.


Reproducible: Always

Steps to Reproduce:
1. Load attached OpenDocument Spreadsheet file
2. See that it asserts


Actual Results:  
It asserts.

Expected Results:  
Be more robust and don't assert.

backtrace;

Application: KSpread (kspread), signal: Aborted
[KCrash Handler]
#6  0x00007f11b41c29e5 in raise () from /lib64/libc.so.6
#7  0x00007f11b41c3ee6 in abort () from /lib64/libc.so.6
#8  0x00007f11b516d6f4 in qt_message_output (msgType=<value optimized out>, buf=<value optimized out>) at global/qglobal.cpp:2259
#9  0x00007f11b516d8bd in qt_message(QtMsgType, const char *, typedef __va_list_tag __va_list_tag *) (msgType=QtFatalMsg, msg=0x7f11b52c0808 "ASSERT: \"%s\" in file %s, line %d", ap=0x7fff766c20d0)
    at global/qglobal.cpp:2305
#10 0x00007f11b516da55 in qFatal (msg=<value optimized out>) at global/qglobal.cpp:2488
#11 0x00007f11b516da9a in qt_assert (assertion=0x5246 <Address 0x5246 out of bounds>, file=0x6 <Address 0x6 out of bounds>, line=-1) at global/qglobal.cpp:2004
#12 0x00007f11b9444bde in KoPathShape::outline (this=0x9c62b0) at /home/kdab/src/kde/koffice-essen/libs/flake/KoPathShape.cpp:324
#13 0x00007f11b9446a48 in KoPathShape::normalize (this=0x9c62b0) at /home/kdab/src/kde/koffice-essen/libs/flake/KoPathShape.cpp:599
#14 0x00007f11b94943b7 in KoParameterShape::normalize (this=0x9c62b0) at /home/kdab/src/kde/koffice-essen/libs/flake/KoParameterShape.cpp:132
#15 0x00007f11974c67ca in EnhancedPathShape::normalize (this=0x9c62b0) at /home/kdab/src/kde/koffice-essen/plugins/pathshapes/enhancedpath/EnhancedPathShape.cpp:124
#16 0x00007f11974c6522 in EnhancedPathShape::updatePath (this=0x9c62b0) at /home/kdab/src/kde/koffice-essen/plugins/pathshapes/enhancedpath/EnhancedPathShape.cpp:102
#17 0x00007f11974c67b0 in EnhancedPathShape::setSize (this=0x9c62b0, newSize=...) at /home/kdab/src/kde/koffice-essen/plugins/pathshapes/enhancedpath/EnhancedPathShape.cpp:119
#18 0x00007f11974c921f in EnhancedPathShape::loadOdf (this=0x9c62b0, element=..., context=...) at /home/kdab/src/kde/koffice-essen/plugins/pathshapes/enhancedpath/EnhancedPathShape.cpp:456
#19 0x00007f11b948e532 in KoShapeRegistry::Private::createShapeInternal (this=0x8b42a0, fullElement=..., context=..., element=...)
    at /home/kdab/src/kde/koffice-essen/libs/flake/KoShapeRegistry.cpp:271
#20 0x00007f11b948dff8 in KoShapeRegistry::createShapeFromOdf (this=0x8b8a40, e=..., context=...) at /home/kdab/src/kde/koffice-essen/libs/flake/KoShapeRegistry.cpp:220
#21 0x00007f11b946f210 in KoShapeGroup::loadOdf (this=0x9ec1f0, element=..., context=...) at /home/kdab/src/kde/koffice-essen/libs/flake/KoShapeGroup.cpp:94
#22 0x00007f11b948df7b in KoShapeRegistry::createShapeFromOdf (this=0x8b8a40, e=..., context=...) at /home/kdab/src/kde/koffice-essen/libs/flake/KoShapeRegistry.cpp:210
#23 0x00007f11a4a35e7f in KSpread::Cell::loadOdfObject (this=0x7fff766c4230, element=..., shapeContext=...) at /home/kdab/src/kde/koffice-essen/kspread/Cell.cpp:1747
#24 0x00007f11a4a35dbd in KSpread::Cell::loadOdfObjects (this=0x7fff766c4230, parent=..., tableContext=...) at /home/kdab/src/kde/koffice-essen/kspread/Cell.cpp:1741
#25 0x00007f11a4a34dd8 in KSpread::Cell::loadOdf (this=0x7fff766c4230, element=..., tableContext=..., autoStyles=..., cellStyleName=...) at /home/kdab/src/kde/koffice-essen/kspread/Cell.cpp:1601
#26 0x00007f11a4b2b3ba in KSpread::Sheet::loadRowFormat (this=0xa40730, row=..., rowIndex=@0x7fff766c47dc, tableContext=..., rowStyleRegions=..., cellStyleRegions=..., columnStyles=..., autoStyles=
    ...) at /home/kdab/src/kde/koffice-essen/kspread/Sheet.cpp:2045
#27 0x00007f11a4b27c9c in KSpread::Sheet::loadOdf (this=0xa40730, sheetElement=..., tableContext=..., autoStyles=..., conditionalStyles=...) at /home/kdab/src/kde/koffice-essen/kspread/Sheet.cpp:1600
#28 0x00007f11a4afed43 in KSpread::Map::loadOdf (this=0x8a93f0, body=..., odfContext=...) at /home/kdab/src/kde/koffice-essen/kspread/Map.cpp:630
#29 0x00007f11a4ae596f in KSpread::DocBase::loadOdf (this=0x7b2a70, odfStore=...) at /home/kdab/src/kde/koffice-essen/kspread/DocBase.cpp:246
#30 0x00007f11b9dc08c3 in KoDocument::loadOasisFromStore (this=0x7b2a70, store=0xa186f0) at /home/kdab/src/kde/koffice-essen/libs/main/KoDocument.cpp:1793
#31 0x00007f11b9dbf934 in KoDocument::loadNativeFormatFromStoreInternal (this=0x7b2a70, store=0xa186f0) at /home/kdab/src/kde/koffice-essen/libs/main/KoDocument.cpp:1683
#32 0x00007f11b9dbf53d in KoDocument::loadNativeFormatFromStore (this=0x7b2a70, file=...) at /home/kdab/src/kde/koffice-essen/libs/main/KoDocument.cpp:1631
#33 0x00007f11b9dbf3a8 in KoDocument::loadNativeFormat (this=0x7b2a70, file_=...) at /home/kdab/src/kde/koffice-essen/libs/main/KoDocument.cpp:1611
#34 0x00007f11b9dbe189 in KoDocument::openFile (this=0x7b2a70) at /home/kdab/src/kde/koffice-essen/libs/main/KoDocument.cpp:1403
#35 0x00007f11b7f3bc16 in KParts::ReadOnlyPart::openUrl(KUrl const&) () from /usr/lib64/libkparts.so.4
#36 0x00007f11b9dbcf40 in KoDocument::openUrl (this=0x7b2a70, _url=...) at /home/kdab/src/kde/koffice-essen/libs/main/KoDocument.cpp:1250
#37 0x00007f11b9de5154 in KoMainWindow::openDocumentInternal (this=0x9572a0, url=..., newdoc=0x7b2a70) at /home/kdab/src/kde/koffice-essen/libs/main/KoMainWindow.cpp:678
#38 0x00007f11b9de4fe2 in KoMainWindow::openDocument (this=0x9572a0, newdoc=0x7b2a70, url=...) at /home/kdab/src/kde/koffice-essen/libs/main/KoMainWindow.cpp:661
#39 0x00007f11b9db030c in KoApplication::start (this=0x7fff766c6850) at /home/kdab/src/kde/koffice-essen/libs/main/KoApplication.cpp:252
#40 0x00007f11ba0e06de in kdemain (argc=2, argv=0x7fff766c6a48) at /home/kdab/src/kde/koffice-essen/kspread/part/Main.cpp:41
#41 0x0000000000400946 in main (argc=2, argv=0x7fff766c6a48) at /home/kdab/src/build/koffice-essen/kspread/kspread_dummy.cpp:3
Comment 1 Sebastian Sauer 2010-10-28 16:48:36 UTC
Created attachment 52945 [details]
The ODS document that produces the assert.
Comment 2 Marijn Kruisselbrink 2010-10-28 20:19:09 UTC
SVN commit 1190726 by mkruisselbrink:

don't crash when loading completely invalid and/or broken enhanced pathshapes (or just in general 0-width or 0-height shapes)
BUG: 255511

 M  +2 -2      EnhancedPathShape.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1190726