Bug 399896 - kdeinit5 crashes in ThumbnailProtocol::createSubThumbnail() when opening a folder with a WMF file that has the .eps file extension
Summary: kdeinit5 crashes in ThumbnailProtocol::createSubThumbnail() when opening a fo...
Status: RESOLVED FIXED
Alias: None
Product: kio-extras
Classification: Frameworks and Libraries
Component: Thumbnails and previews (show other bugs)
Version: 18.08.2
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
: 400592 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-10-16 18:41 UTC by eseifert
Modified: 2018-11-04 10:33 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In: 18.08.3


Attachments
kdeinit5-20181016-202519.kcrash.txt (5.67 KB, text/plain)
2018-10-16 18:41 UTC, eseifert
Details
bug399896.eps (806 bytes, application/octet-stream)
2018-10-17 17:37 UTC, eseifert
Details

Note You need to log in before you can comment on or make changes to this bug.
Description eseifert 2018-10-16 18:41:23 UTC
Created attachment 115687 [details]
kdeinit5-20181016-202519.kcrash.txt

SUMMARY
Each time I open a certain folder in Dolphin I see a notification of kdeinit5 crashing with a segfault. Dolphin still remains completely functional though.
The problems occurs after I upgraded to frameworks 5.51.0.

STEPS TO REPRODUCE
1. Open Dolphin
2. Click on a specific folder or refresh the view of that folder

OBSERVED RESULT
Segmentation fault in kdeinit5

EXPECTED RESULT
No segmentation fault

SOFTWARE VERSIONS
(available in About System)
Linux distribution: Gentoo
KDE Plasma Version: 5.14.1
KDE Frameworks Version: 5.51.0
Qt Version: 5.11.1

ADDITIONAL INFORMATION
See attached kcrash traceback
Comment 1 Nate Graham 2018-10-17 14:36:15 UTC
Crash is in ThumbnailProtocol::createSubThumbnail().

It looks like the thumbnailer is choking on a particular file.  Could you remove all files from that folder and re-add them one at a time until you find the one that causes the crash, and then attach that file? Thanks!
Comment 2 eseifert 2018-10-17 17:36:22 UTC
Thanks for the quick response Nate. Unfortunately, there were way too many files, so I had to use gdb to dig my way to the file path. It turned out to be a WMF (Windows Meta File) file, which accidentally got the file extension .eps. So, the thumbnailer tries to parse it as PostScript, which probably causes the segfault.

I cannot attach the original file because of copyright reasons, but I saved a WMF file with Inkscape, renamed it and will attach it. It causes the same crash.
Comment 3 eseifert 2018-10-17 17:37:56 UTC
Created attachment 115708 [details]
bug399896.eps

WMF vector graphics file renamed to EPS.
Comment 4 Nate Graham 2018-10-18 03:13:20 UTC
Thanks so much for the info! Very helpful.
Comment 5 Kai Uwe Broulik 2018-10-19 09:35:13 UTC
Git commit edbac9239ef8ad915b4b125ba4f22b45238be6f8 by Kai Uwe Broulik.
Committed on 19/10/2018 at 09:34.
Pushed by broulik into branch 'Applications/18.08'.

Avoid nullptr access

When we get a bogus file bbox() may be null and accessing it will crash the thumbnailer.

CHANGELOG: Fixed crash when trying to generate a thumbnail for bogus .eps files
FIXED-IN: 18.08.3

Differential Revision: https://phabricator.kde.org/D16290

M  +5    -2    ps/gscreator.cpp

https://commits.kde.org/kdegraphics-thumbnailers/edbac9239ef8ad915b4b125ba4f22b45238be6f8
Comment 6 Kai Uwe Broulik 2018-11-02 22:04:05 UTC
*** Bug 400592 has been marked as a duplicate of this bug. ***
Comment 7 Patrick Silva 2018-11-04 10:33:27 UTC
*** Bug 400650 has been marked as a duplicate of this bug. ***