Bug 414631 - gwenview crashes with output "Floating point exception (core dumped)"
Summary: gwenview crashes with output "Floating point exception (core dumped)"
Status: RESOLVED FIXED
Alias: None
Product: gwenview
Classification: Applications
Component: general (show other bugs)
Version: 19.08.3
Platform: Manjaro Linux
: NOR crash
Target Milestone: ---
Assignee: Gwenview Bugs
URL:
Keywords:
: 414835 424170 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-11-28 19:47 UTC by Julian
Modified: 2020-08-03 17:21 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In: 19.12.2


Attachments
image file with exif data leading to gwenview crash (68.45 KB, image/jpeg)
2019-11-28 19:47 UTC, Julian
Details
Crash report / backtrace on KDE Neon Developer Edition (7.35 KB, text/plain)
2019-12-20 17:28 UTC, Julian
Details
Crash report / backtrace on KDE Neon Developer Edition (6.32 KB, text/plain)
2019-12-20 17:39 UTC, Julian
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Julian 2019-11-28 19:47:43 UTC
Created attachment 124168 [details]
image file with exif data leading to gwenview crash

gwenview crashes with output "Floating point exception (core dumped)"

The picture was exported from darktable. The problem must be related to the EXIF data embedded into the picture, as it does not crash if the exact same image is exported without EXIF infomration.


STEPS TO REPRODUCE
1. open attached image in gwenview (better in terminal to see stdout):
   $ gwenview DSC00174_03.jpg
2. I have the Thumbnail Bar activated. The issue might be related to thumbnail loading... 


OBSERVED RESULT
gwenview crashes with message "Floating point exception (core dumped)" printed to stdout.

EXPECTED RESULT
no crash

SOFTWARE/OS VERSIONS
Operating System: Manjaro Linux 
KDE Plasma Version: 5.17.3
KDE Frameworks Version: 5.64.0
Qt Version: 5.13.2
Kernel Version: 4.19.85-1-MANJARO
OS Type: 64-bit
Processors: 4 × Intel® Core™ i7-7600U CPU @ 2.80GHz
Memory: 19.5 GiB of RAM

Many thanks for looking into this issue.
Please let me know, if darktable is exporting a problematic / invalid EXIF tag which is causing the problem.
Comment 1 Julian 2019-11-28 20:30:46 UTC
The problem only occurs when the Thumbnail Bar is activated.
Comment 2 Christoph Feck 2019-12-19 15:25:12 UTC
If this is reproducible, could you add the backtrace for the crash? For more information, please read https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
Comment 3 Julian 2019-12-20 17:28:19 UTC
Created attachment 124626 [details]
Crash report / backtrace on KDE Neon Developer Edition
Comment 4 Julian 2019-12-20 17:29:32 UTC
(In reply to Christoph Feck from comment #2)
> If this is reproducible, could you add the backtrace for the crash? For more
> information, please read
> https://community.kde.org/Guidelines_and_HOWTOs/Debugging/
> How_to_create_useful_crash_reports

Thank you for the advice.
I was able to reproduce the crash on the most recent KDE Neon Developer Edition (in a virtual machine).

SOFTWARE/OS VERSIONS
Operating System: DE neon Unstable Edition
KDE Plasma Version: 5.17.80
KDE Frameworks Version: 5.66.0
Qt Version: 5.13.2
Kernel Version: 5.0.0-37-generic
OS Type: 64-bit
Processors: 2 × Intel® Core™ i7-7600U CPU @ 2.80GHz
Memory: 982.8MiB of RAM

The resulting backtrace was added as an attachment to this bug report.
Comment 5 Julian 2019-12-20 17:39:51 UTC
Created attachment 124627 [details]
Crash report / backtrace on KDE Neon Developer Edition
Comment 6 Julian 2019-12-20 17:45:26 UTC
Comment on attachment 124627 [details]
Crash report / backtrace on KDE Neon Developer Edition

incl debug symbols for libQt5Core
Gvenview version: 20.03.70
Comment 7 Christoph Feck 2019-12-21 08:29:46 UTC
Crashes because image.loadFromData() doesn't lead to a valid image. When image.width() is 0, that causes a division by zero error later.

https://cgit.kde.org/gwenview.git/tree/lib/jpegcontent.cpp#n576

Relevant part of backtrace:

Application: Gwenview (gwenview), signal: Floating point exception

Thread 7 (Thread 0x7f2c5ac9b700 (LWP 3094)):
[KCrash Handler]
#6  0x00007f2c99d0edad in Gwenview::JpegContent::thumbnail (this=this@entry=0x7f2c5ac9ab78) at ./lib/jpegcontent.cpp:591
#7  0x00007f2c99d25a75 in Gwenview::ThumbnailContext::load (this=this@entry=0x7f2c5ac9acb0, pixPath=..., pixelSize=pixelSize@entry=256) at ./lib/thumbnailprovider/thumbnailgenerator.cpp:117
#8  0x00007f2c99d26446 in Gwenview::ThumbnailGenerator::run (this=0x55585116af10) at ./lib/thumbnailprovider/thumbnailgenerator.cpp:263
Comment 8 Christoph Feck 2019-12-27 16:56:28 UTC
*** Bug 414835 has been marked as a duplicate of this bug. ***
Comment 9 Nate Graham 2020-01-09 17:09:51 UTC
Git commit fdd5ecc344edc7444bd57a080c3d9ec91b245592 by Nate Graham.
Committed on 09/01/2020 at 17:09.
Pushed by ngraham into branch 'release/19.12'.

Fix divide-by-zero crash

Summary:
Bug was introduced in D21398.
FIXED-IN: 19.12.2

Test Plan:
Compile only and verify normal functionality only; can't reproduce the issue so can't
test the fix

Reviewers: #gwenview, cfeck, tommo

Subscribers: tommo

Tags: #gwenview

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

M  +12   -10   lib/jpegcontent.cpp

https://commits.kde.org/gwenview/fdd5ecc344edc7444bd57a080c3d9ec91b245592
Comment 10 Christoph Feck 2020-08-03 17:21:00 UTC
*** Bug 424170 has been marked as a duplicate of this bug. ***