Summary: | PostScript thumbnailer crashes with floating point exception | ||
---|---|---|---|
Product: | [Frameworks and Libraries] kio-extras | Reporter: | Frank <scheuer> |
Component: | Thumbnails and previews | Assignee: | Plasma Bugs List <plasma-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | crash | CC: | elvis.angelaccio, L.Bonnaud, sheedy, thomas.hoepping |
Priority: | NOR | Keywords: | junior-jobs |
Version First Reported In: | 19.08.1 | ||
Target Milestone: | --- | ||
Platform: | openSUSE | ||
OS: | Linux | ||
Latest Commit: | https://commits.kde.org/kdegraphics-thumbnailers/af3f38a4d8f6ab66a463dd13e78385f34f4af933 | Version Fixed In: | 19.12.1 |
Sentry Crash Report: | |||
Attachments: | File to reproduce the crash |
Description
Frank
2019-04-12 10:25:37 UTC
Could you find the Postscript or PDF file which causes GhostScript to crash? (In reply to Christoph Feck from comment #1) > Could you find the Postscript or PDF file which causes GhostScript to crash? I'm not sure. I may have opened an e-mail attachment when it happened. i can't trace the trigger at the moment *** Bug 415190 has been marked as a duplicate of this bug. *** It is a division by zero. With certain sizes, the "scale" variable can be zero, and I suggest to modify the code to use floats. https://cgit.kde.org/kdegraphics-thumbnailers.git/tree/ps/gscreator.cpp#n276 *** Bug 414905 has been marked as a duplicate of this bug. *** Created attachment 124525 [details]
File to reproduce the crash
Git commit af3f38a4d8f6ab66a463dd13e78385f34f4af933 by Elvis Angelaccio. Committed on 28/12/2019 at 18:58. Pushed by elvisangelaccio into branch 'release/19.12'. Prevent division by zero and force ghostscript run The `scale` variable can be zero since it's an int. This code should probably be refactored to use floats, but since no one touched it in years, this is a quick workaround to not make it crash and to get a working thumbnail by forcing a ghostscript run with the `break;`. FIXED-IN: 19.12.1 M +1 -0 ps/gscreator.cpp https://commits.kde.org/kdegraphics-thumbnailers/af3f38a4d8f6ab66a463dd13e78385f34f4af933 (In reply to Christoph Feck from comment #4) > It is a division by zero. With certain sizes, the "scale" variable can be > zero, and I suggest to modify the code to use floats. > > https://cgit.kde.org/kdegraphics-thumbnailers.git/tree/ps/gscreator.cpp#n276 I took the liberty to push a different fix. I tried to use floats and while it stopped crashing, it still wouldn't get a thumbnail out of the attached file. I then looked at the rest of the code and I gave up. Not easy at all to refactor it with floats. Thanks a lot for the fix! |