Bug 400166 - Thumbnailer crashes in KWDocument::generatePreview() while generating thumbnail for Calligra document
Summary: Thumbnailer crashes in KWDocument::generatePreview() while generating thumbna...
Status: REPORTED
Alias: None
Product: calligrawords
Classification: Applications
Component: doc (show other bugs)
Version: 3.1.0
Platform: Compiled Sources Linux
: NOR crash
Target Milestone: ---
Assignee: Calligra Words Bugs
URL:
Keywords:
: 452734 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-10-22 19:51 UTC by Jaime Torres
Modified: 2022-04-18 15:11 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
The simplified file to reproduce the crash (75.00 KB, application/msword)
2018-10-22 19:51 UTC, Jaime Torres
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jaime Torres 2018-10-22 19:51:48 UTC
Created attachment 115833 [details]
The simplified file to reproduce the crash

The calligra words thumbnailer crashes with this file (with only a picture in the header and another in the footer).

STEPS TO REPRODUCE
1. Copy the attached file to a directory.
2. Enable the previews in that directory. 
or Open the file with calligra-words.

SOFTWARE VERSIONS
(available in About System)
KDE Plasma Version: (git master)
KDE Frameworks Version: 5.51 (git)
Qt Version: 5.11.2

[KCrash Handler]
#5  0x00007f241c09c544 in convertIndexedToARGB32PM(uint*, uint const*, int, QVector<unsigned int> const*, QDitherInfo*) (buffer=0x7ffcb9c704f0, src=0x7ffcb9c704f0, count=33, clut=0x0) at painting/qdrawhelper.cpp:491
#6  0x00007f241c0b134e in BlendSrcGeneric::fetch(int, int, int) (len=<optimized out>, y=0, x=0, this=0x7ffcb9c6e450) at painting/qdrawhelper.cpp:4015
#7  0x00007f241c0b134e in handleSpans<BlendSrcGeneric>(int, QT_FT_Span_ const*, QSpanData const*, BlendSrcGeneric&) (count=count@entry=11, spans=spans@entry=0x7ffcb9c7a5e0, data=data@entry=0x4864c20, handler=...) at painting/qdrawhelper.cpp:3959
#8  0x00007f241c0aff7e in blend_src_generic_rgb64(int, QSpan const*, void*) (count=11, spans=0x7ffcb9c7a5e0, userData=0x4864c20) at painting/qdrawhelper.cpp:4077
#9  0x00007f241c0d7c81 in fillRect_normalized(QRect const&, QSpanData*, QRasterPaintEnginePrivate*) (r=..., data=data@entry=0x4864c20, pe=pe@entry=0x4864830) at painting/qpaintengine_raster.cpp:1556
#10 0x00007f241c0dd932 in QRasterPaintEngine::drawImage(QRectF const&, QImage const&, QRectF const&, QFlags<Qt::ImageConversionFlag>) (this=0x1bf36f0, r=..., img=..., sr=...) at ../../include/QtCore/../../src/corelib/tools/qrect.h:184
#11 0x00007f241c0f5365 in QPainter::drawImage(QRectF const&, QImage const&, QRectF const&, QFlags<Qt::ImageConversionFlag>) (this=this@entry=0x7ffcb9c7b5d8, targetRect=..., image=..., sourceRect=..., flags=flags@entry=...) at ../../include/QtCore/../../src/corelib/tools/qrect.h:644
#12 0x00007f23eeb2d3b6 in QPainter::drawImage(QRect const&, QImage const&, QRect const&, QFlags<Qt::ImageConversionFlag>) (flags=..., sourceRect=<synthetic pointer>..., image=..., targetRect=<synthetic pointer>..., this=0x7ffcb9c7b5d8) at /usr/include/qt5/QtCore/qrect.h:269
#13 0x00007f23eeb2d3b6 in Libemf::OutputPainterStrategy::stretchDiBits(Libemf::StretchDiBitsRecord&) (this=0x7ffcb9c7b440, record=...) at /g/5kde/calligra/calligra/libs/vectorimage/libemf/EmfOutputPainterStrategy.cpp:1367
#14 0x00007f23eeb204df in Libemf::Parser::readRecord(QDataStream&) (this=this@entry=0x7ffcb9c7b430, stream=...) at /g/5kde/calligra/calligra/libs/vectorimage/libemf/EmfParser.cpp:819
#15 0x00007f23eeb20d82 in Libemf::Parser::loadFromStream(QDataStream&) (this=this@entry=0x7ffcb9c7b430, stream=...) at /g/5kde/calligra/calligra/libs/vectorimage/libemf/EmfParser.cpp:123
#16 0x00007f23eeb21379 in Libemf::Parser::load(QByteArray const&) (this=0x7ffcb9c7b430, contents=...) at /g/5kde/calligra/calligra/libs/vectorimage/libemf/EmfParser.cpp:100
#17 0x00007f23ed69be54 in  () at /usr/lib64/qt5/plugins/calligra/shapes/calligra_shape_vector.so
#18 0x00007f23ed69c101 in  () at /usr/lib64/qt5/plugins/calligra/shapes/calligra_shape_vector.so
#19 0x00007f23ed69b5c7 in  () at /usr/lib64/qt5/plugins/calligra/shapes/calligra_shape_vector.so
#20 0x00007f23fc0e752e in KWPage::thumbnail(QSize const&, KoShapeManager*, bool) const (this=this@entry=0x7ffcb9c7b830, size=..., shapeManager=0x6d726b0, asPrint=asPrint@entry=true) at /g/5kde/calligra/calligra/words/part/KWPage.cpp:339
#21 0x00007f23fc0d5488 in KWDocument::generatePreview(QSize const&) (this=<optimized out>, size=...) at /usr/include/qt5/QtCore/qflags.h:120
#22 0x00007f23fec0985b in CalligraCreator::create(QString const&, int, int, QImage&) (this=0x1e82180, path=..., width=128, height=128, image=...) at /g/5kde/calligra/calligra/extras/thumbnail/calligracreator.cpp:125
#23 0x00007f2416003835 in ThumbnailProtocol::get(QUrl const&) (this=0x7ffcb9c7bbd0, url=...) at /usr/include/qt5/QtCore/qflags.h:120
#24 0x00007f2415c1c57c in KIO::SlaveBase::dispatch(int, QByteArray const&) (this=0x7ffcb9c7bbd0, command=<optimized out>, data=...) at /g/5kde/frameworks/kio/src/core/slavebase.cpp:1119
#25 0x00007f2415c1d8ed in KIO::SlaveBase::dispatchLoop() (this=this@entry=0x7ffcb9c7bbd0) at /g/5kde/frameworks/kio/src/core/slavebase.cpp:318
#26 0x00007f241600102f in kdemain(int, char**) (argc=<optimized out>, argv=<optimized out>) at /g/5kde/kde/kdenetwork/kio-extras/thumbnail/thumbnail.cpp:138
#27 0x0000000000409a56 in launch(int, char const*, char const*, char const*, int, char const*, bool, char const*, bool, char const*) (argc=argc@entry=4, _name=_name@entry=0x17bd178 "/opt/kde5/lib64/plugins/kf5/kio/thumbnail.so", args=<optimized out>, args@entry=0x17bd1a5 "thumbnail", cwd=cwd@entry=0x0, envc=envc@entry=0, envs=<optimized out>, envs@entry=0x17bd21f "", reset_env=false, tty=0x0, avoid_loops=false, startup_id_str=0x40d17c "0") at /g/5kde/frameworks/kinit/src/kdeinit/kinit.cpp:706
#28 0x000000000040aa35 in handle_launcher_request(int, char const*) (sock=7, who=who@entry=0x40d1d3 "launcher") at /g/5kde/frameworks/kinit/src/kdeinit/kinit.cpp:1146
#29 0x000000000040b277 in handle_requests(pid_t) (waitForPid=waitForPid@entry=0) at /g/5kde/frameworks/kinit/src/kdeinit/kinit.cpp:1339
#30 0x000000000040ba2f in main(int, char**) (argc=2, argv=0x7ffcb9c7c378) at /g/5kde/frameworks/kinit/src/kdeinit/kinit.cpp:1785

or

[KCrash Handler]
#5  0x00007f25410d4544 in convertIndexedToARGB32PM(uint*, uint const*, int, QVector<unsigned int> const*, QDitherInfo*) (buffer=0x7f2516b88b90, src=0x7f2516b88b90, count=341, clut=0x0) at painting/qdrawhelper.cpp:491
#6  0x00007f25410e934e in BlendSrcGeneric::fetch(int, int, int) (len=<optimized out>, y=0, x=0, this=0x7f2516b86af0) at painting/qdrawhelper.cpp:4015
#7  0x00007f25410e934e in handleSpans<BlendSrcGeneric>(int, QT_FT_Span_ const*, QSpanData const*, BlendSrcGeneric&) (count=count@entry=113, spans=spans@entry=0x7f2516b92c80, data=data@entry=0x7f25040556c0, handler=...) at painting/qdrawhelper.cpp:3959
#8  0x00007f25410e7f7e in blend_src_generic_rgb64(int, QSpan const*, void*) (count=113, spans=0x7f2516b92c80, userData=0x7f25040556c0) at painting/qdrawhelper.cpp:4077
#9  0x00007f254110fc81 in fillRect_normalized(QRect const&, QSpanData*, QRasterPaintEnginePrivate*) (r=..., data=data@entry=0x7f25040556c0, pe=pe@entry=0x7f25040552d0) at painting/qpaintengine_raster.cpp:1556
#10 0x00007f2541115932 in QRasterPaintEngine::drawImage(QRectF const&, QImage const&, QRectF const&, QFlags<Qt::ImageConversionFlag>) (this=0x7f25040c7a60, r=..., img=..., sr=...) at ../../include/QtCore/../../src/corelib/tools/qrect.h:184
#11 0x00007f254112d365 in QPainter::drawImage(QRectF const&, QImage const&, QRectF const&, QFlags<Qt::ImageConversionFlag>) (this=this@entry=0x7f2516b93c78, targetRect=..., image=..., sourceRect=..., flags=flags@entry=...) at ../../include/QtCore/../../src/corelib/tools/qrect.h:644
#12 0x00007f2524b8f3b6 in QPainter::drawImage(QRect const&, QImage const&, QRect const&, QFlags<Qt::ImageConversionFlag>) (flags=..., sourceRect=<synthetic pointer>..., image=..., targetRect=<synthetic pointer>..., this=0x7f2516b93c78) at /usr/include/qt5/QtCore/qrect.h:269
#13 0x00007f2524b8f3b6 in Libemf::OutputPainterStrategy::stretchDiBits(Libemf::StretchDiBitsRecord&) (this=0x7f2516b93ae0, record=...) at /g/5kde/calligra/calligra/libs/vectorimage/libemf/EmfOutputPainterStrategy.cpp:1367
#14 0x00007f2524b824df in Libemf::Parser::readRecord(QDataStream&) (this=this@entry=0x7f2516b93ad0, stream=...) at /g/5kde/calligra/calligra/libs/vectorimage/libemf/EmfParser.cpp:819
#15 0x00007f2524b82d82 in Libemf::Parser::loadFromStream(QDataStream&) (this=this@entry=0x7f2516b93ad0, stream=...) at /g/5kde/calligra/calligra/libs/vectorimage/libemf/EmfParser.cpp:123
#16 0x00007f2524b83379 in Libemf::Parser::load(QByteArray const&) (this=0x7f2516b93ad0, contents=...) at /g/5kde/calligra/calligra/libs/vectorimage/libemf/EmfParser.cpp:100
Comment 1 Justin Zobel 2020-12-17 05:38:50 UTC
Thank you for the crash report.

As it has been a while since this was reported, can you please test and confirm if this issue is still occurring or if this bug report can be marked as resolved.

I have set the bug status to "needsinfo" pending your response, please change back to "reported" or "resolved/worksforme" when you respond, thank you.
Comment 2 Jaime Torres 2020-12-17 16:40:42 UTC
It is still an issue for me, with this backtrace:

#4  0x00007f36488c9c1a in QVector<unsigned int>::at (i=<optimized out>, this=<optimized out>) at ../../include/QtCore/../../src/corelib/tools/qvector.h:455
#5  convertIndexedToARGB32PM (buffer=0x7ffc75889eb0, count=33, clut=0x0) at painting/qdrawhelper.cpp:710
#6  0x00007f36488dd646 in fetchTransformed<(TextureBlendType)2, (QPixelLayout::BPP)0> (buffer=0x7ffc75889eb0, data=0x5612c0e30f98, y=<optimized out>, x=<optimized out>, length=33) at painting/qdrawhelper.cpp:2258
#7  0x00007f36488eed9e in BlendSrcGeneric::fetch (len=<optimized out>, y=0, x=0, this=0x7ffc75887e10) at painting/qdrawhelper.cpp:4750
#8  handleSpans<BlendSrcGeneric> (count=count@entry=11, spans=spans@entry=0x7ffc75893fc0, data=data@entry=0x5612c0e30f98, handler=...) at painting/qdrawhelper.cpp:4694
#9  0x00007f36488ed2ad in blend_src_generic_rgb64 (count=11, spans=0x7ffc75893fc0, userData=0x5612c0e30f98) at painting/qdrawhelper.cpp:4816
#10 0x00007f364892222e in fillRect_normalized (r=..., data=0x5612c0e30f98, pe=0x7ffc75893fc0) at painting/qpaintengine_raster.cpp:1542
#11 0x00007f364892832e in QRasterPaintEngine::drawImage (this=0x5612c0f98b20, r=..., img=..., sr=...) at painting/qpaintengine_raster.cpp:2480
#12 0x00007f3648944671 in QPainter::drawImage (this=0x7ffc75894f70, targetRect=..., image=..., sourceRect=..., flags=...) at painting/qpainter.cpp:5562
#13 0x00007f362c8e3c79 in Libemf::OutputPainterStrategy::stretchDiBits(Libemf::StretchDiBitsRecord&) () from /usr/lib64/libkovectorimage.so.17
#14 0x00007f362c8e6898 in Libemf::Parser::readRecord(QDataStream&) () from /usr/lib64/libkovectorimage.so.17
#15 0x00007f362c8e70d4 in Libemf::Parser::loadFromStream(QDataStream&) () from /usr/lib64/libkovectorimage.so.17
#16 0x00007f362c8e97c6 in Libemf::Parser::load(QByteArray const&) () from /usr/lib64/libkovectorimage.so.17
Comment 3 Nate Graham 2022-04-18 15:11:47 UTC
*** Bug 452734 has been marked as a duplicate of this bug. ***