Bug 392826 - Crash when opening .xps file
Summary: Crash when opening .xps file
Status: RESOLVED FIXED
Alias: None
Product: okular
Classification: Applications
Component: XPS backend (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-04-07 11:42 UTC by Luca Weiss
Modified: 2018-04-08 11:02 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
demo file (1.83 MB, application/oxps)
2018-04-07 11:42 UTC, Luca Weiss
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Luca Weiss 2018-04-07 11:42:56 UTC
Created attachment 111885 [details]
demo file

Just opening the attached .xps file makes Okular crash. Version is master branch today (revision b25979121fd3f28788a2958b0faed250f1d1054c)

Backtrace:
#0  0x00007f99642bd89c in loadEntry(KZip*, QString const&, Qt::CaseSensitivity) [clone .constprop.299] () from /usr/lib/qt/plugins/okular/generators/okularGenerator_xps.so                  
#1  0x00007f99642c2d6b in XpsPage::loadImageFromFile(QString const&) () from /usr/lib/qt/plugins/okular/generators/okularGenerator_xps.so
#2  0x00007f99642c301c in XpsHandler::processImageBrush(XpsRenderNode&) () from /usr/lib/qt/plugins/okular/generators/okularGenerator_xps.so
#3  0x00007f99642c3b0e in XpsHandler::processEndElement(XpsRenderNode&) () from /usr/lib/qt/plugins/okular/generators/okularGenerator_xps.so
#4  0x00007f99642c425d in XpsHandler::endElement(QString const&, QString const&, QString const&) () from /usr/lib/qt/plugins/okular/generators/okularGenerator_xps.so
#5  0x00007f99876dc478 in ?? () from /usr/lib/libQt5Xml.so.5
#6  0x00007f99876e58ff in ?? () from /usr/lib/libQt5Xml.so.5
#7  0x00007f99876e4e48 in ?? () from /usr/lib/libQt5Xml.so.5
#8  0x00007f99876e5880 in ?? () from /usr/lib/libQt5Xml.so.5
#9  0x00007f99876e4e48 in ?? () from /usr/lib/libQt5Xml.so.5
#10 0x00007f99876e5880 in ?? () from /usr/lib/libQt5Xml.so.5
#11 0x00007f99876e4e48 in ?? () from /usr/lib/libQt5Xml.so.5
#12 0x00007f99876e5880 in ?? () from /usr/lib/libQt5Xml.so.5
#13 0x00007f99876e845c in ?? () from /usr/lib/libQt5Xml.so.5
#14 0x00007f99876e8977 in QXmlSimpleReader::parse(QXmlInputSource const*, bool) () from /usr/lib/libQt5Xml.so.5
#15 0x00007f99642c2850 in XpsPage::renderToPainter(QPainter*) () from /usr/lib/qt/plugins/okular/generators/okularGenerator_xps.so
#16 0x00007f99642c2a32 in XpsPage::renderToImage(QImage*) () from /usr/lib/qt/plugins/okular/generators/okularGenerator_xps.so
#17 0x00007f99642c2b4d in XpsGenerator::image(Okular::PixmapRequest*) () from /usr/lib/qt/plugins/okular/generators/okularGenerator_xps.so
#18 0x00007f996eca15f5 in Okular::PixmapGenerationThread::run() () from /usr/lib/libOkular5Core.so.9
#19 0x00007f9988883acd in ?? () from /usr/lib/libQt5Core.so.5
#20 0x00007f998517508c in start_thread () from /usr/lib/libpthread.so.0
#21 0x00007f998818be7f in clone () from /usr/lib/libc.so.6

If the backtrace in the Qt5 libs is needed, I can recompile it.
Comment 1 Albert Astals Cid 2018-04-08 10:52:23 UTC
Git commit 985e06a2f572236df9637e9590231b4caa2628ea by Albert Astals Cid.
Committed on 08/04/2018 at 10:50.
Pushed by aacid into branch 'Applications/18.04'.

Fix crash in some more xps files

Some more tweaks to path resolving.

Don't prepend a / in entryPath if path already starts with /
Fonts can also have relative paths, so use the absolutePath before
calling getFontByName

M  +21   -16   generators/xps/generator_xps.cpp
M  +1    -0    generators/xps/generator_xps.h

https://commits.kde.org/okular/985e06a2f572236df9637e9590231b4caa2628ea
Comment 2 Luca Weiss 2018-04-08 10:54:57 UTC
Thanks for the quick fix! :)
Comment 3 Albert Astals Cid 2018-04-08 11:02:23 UTC
You're welcome :)