Bug 441121

Summary: gwenview crashes when opening .jpg in X11 Session (wayland not possible on graphics card)
Product: gwenview Reporter: friendofanimals
Component: generalAssignee: Gwenview Bugs <gwenview-bugs-null>
Status: RESOLVED FIXED    
Severity: crash CC: alexander.fieroch, braunmh, cfigura77, cs, daffy, david_0704, eeickmeyer, fe.a.ernst, gabrielrvargas, gordon.lack, guille2306, jan.rathmann, jeanclaude.brevard, k_d_hudson, lukas.karas, mail_to_wrt, mhoppstaedter, nate, p92, qydwhotmail, richard, syiad.al-duri, yfprojects
Priority: NOR Keywords: drkonqi
Version: 21.04.3   
Target Milestone: ---   
Platform: Ubuntu Packages   
OS: Linux   
See Also: https://launchpad.net/bugs/1941752
Latest Commit: Version Fixed In: 21.12.1
Attachments: New crash information added by DrKonqi
New crash information added by DrKonqi
New crash information added by DrKonqi
New crash information added by DrKonqi
New crash information added by DrKonqi
New crash information added by DrKonqi
New crash information added by DrKonqi
New crash information added by DrKonqi
New crash information added by DrKonqi
New crash information added by DrKonqi
sample image that is causing the crash
New crash information added by DrKonqi

Description friendofanimals 2021-08-18 09:17:31 UTC
Application: gwenview (20.12.3)

Qt Version: 5.15.2
Frameworks Version: 5.80.0
Operating System: Linux 5.11.0-31-generic x86_64
Windowing System: X11
Drkonqi Version: 5.21.4
Distribution: Ubuntu 21.04

-- Information about the crash:
- What I was doing when the application crashed: tried to open a .jpg picture out of dolphin. retried with different pictures, always crashing. Same happening when opening a picture out of gwenview.

The crash can be reproduced every time.

-- Backtrace:
Application: Gwenview (gwenview), signal: Aborted

[KCrash Handler]
#4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:49
#5  0x00007efd984e8864 in __GI_abort () at abort.c:79
#6  0x00007efd9874fa31 in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6
#7  0x00007efd9875b4fc in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6
#8  0x00007efd9875b567 in std::terminate() () from /lib/x86_64-linux-gnu/libstdc++.so.6
#9  0x00007efd9875b809 in __cxa_throw () from /lib/x86_64-linux-gnu/libstdc++.so.6
#10 0x00007efd98752452 in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6
#11 0x00007efd981bbad3 in ?? () from /lib/x86_64-linux-gnu/libexiv2.so.27
#12 0x00007efd9815f92d in Exiv2::Xmpdatum::write(std::ostream&, Exiv2::ExifData const*) const () from /lib/x86_64-linux-gnu/libexiv2.so.27
#13 0x00007efd9a66a250 in Gwenview::ImageMetaInfoModel::setExiv2Image(Exiv2::Image const*) () from /lib/x86_64-linux-gnu/libgwenviewlib.so.5
#14 0x00007efd9a634a70 in Gwenview::Document::setExiv2Image(std::unique_ptr<Exiv2::Image, std::default_delete<Exiv2::Image> >) () from /lib/x86_64-linux-gnu/libgwenviewlib.so.5
#15 0x00007efd9a63e39b in ?? () from /lib/x86_64-linux-gnu/libgwenviewlib.so.5
#16 0x00007efd98bb75c7 in ?? () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#17 0x00007efd9899ea25 in QFutureWatcherBase::event(QEvent*) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#18 0x00007efd99854783 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#19 0x00007efd98b7f7ba in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#20 0x00007efd98b827e1 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#21 0x00007efd98bd9ba7 in ?? () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#22 0x00007efd962c38eb in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#23 0x00007efd96316d28 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#24 0x00007efd962c1023 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#25 0x00007efd98bd9204 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#26 0x00007efd98b7e11b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#27 0x00007efd98b86604 in QCoreApplication::exec() () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#28 0x0000564728787c1f in ?? ()
#29 0x00007efd984ea565 in __libc_start_main (main=0x5647287876f0, argc=2, argv=0x7ffe3e40e118, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffe3e40e108) at ../csu/libc-start.c:332
#30 0x000056472878813e in _start ()
[Inferior 1 (process 13527) detached]

Possible duplicates by query: bug 440777, bug 440257, bug 434072, bug 429344, bug 427716.

Reported using DrKonqi
Comment 1 Alexander Fieroch 2021-08-19 19:37:18 UTC
same here since this week. Maybe a bug through latest gwenview, x11 or libjpeg library because last week I had no problem?!
I can load original JPGs from my digital camera with gwenview but trying to load edited and exported jpegs by darktable will crash gwenview immediately. Until last week this was working!

gwenview 4:21.04.3-0ubuntu1~ubuntu21.04~ppa1
libgl1-mesa-dri (21.0.3-0ubuntu0.2 => 21.0.3-0ubuntu0.3)

darktable  org.darktable.Darktable  3.6.0                     stable            system
Comment 2 Jan Rathmann 2021-08-24 20:33:52 UTC
This seems to be related to a recent security update of exiv2 in Ubuntu 21.04.

libexiv2-27 version 0.27.3-3ubuntu1.5: Gwenview (21.08.0) crashes when I try to open JPEG files generated by darktable.

libexiv2-27 version 0.27.3-3ubuntu1.4: Gwenview (21.08.0) doesn't crash.

Link to the changelog of exiv2 package on Ubuntu:
http://changelogs.ubuntu.com/changelogs/pool/main/e/exiv2/exiv2_0.27.3-3ubuntu1.5/changelog

Temporary workaround: Downgrade libexiv2-27 to version 0.27.3-3ubuntu1.4
Comment 3 Alexander Fieroch 2021-08-26 07:58:39 UTC
Thanks!
Downgrade libexiv2-27 to version 0.27.3-3ubuntu1.4 is working!
Comment 4 Jan Rathmann 2021-08-29 13:52:17 UTC
I have tracked this down to the following change in CVE-2021-37620-3.patch (Ubuntu src package exiv2-0.27.3-3ubuntu1.5):

===================================================================
--- exiv2-0.27.3.orig/src/tags_int.cpp
+++ exiv2-0.27.3/src/tags_int.cpp
@@ -2865,7 +2865,7 @@ namespace Exiv2 {
         }
 
         std::string stringValue = value.toString();
-        if (stringValue[19] == 'Z') {
+        if (stringValue.at(19) == 'Z') {
             stringValue = stringValue.substr(0, 19);
         }
         for (size_t i = 0; i < stringValue.length(); ++i) {
Comment 5 Michael Braun 2021-09-26 18:15:47 UTC
Created attachment 141931 [details]
New crash information added by DrKonqi

gwenview (20.12.3) using Qt 5.15.2

- What I was doing when the application crashed:
Every time when I open a directory containing a picture or only a picture gwenview will crash.

-- Backtrace (Reduced):
#4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:49
#5  0x00007fb8485c5864 in __GI_abort () at abort.c:79
[...]
#12 0x00007fb84823c92d in Exiv2::Xmpdatum::write(std::ostream&, Exiv2::ExifData const*) const () from /lib/x86_64-linux-gnu/libexiv2.so.27
#13 0x00007fb84a747250 in Gwenview::ImageMetaInfoModel::setExiv2Image(Exiv2::Image const*) () from /lib/x86_64-linux-gnu/libgwenviewlib.so.5
#14 0x00007fb84a711a70 in Gwenview::Document::setExiv2Image(std::unique_ptr<Exiv2::Image, std::default_delete<Exiv2::Image> >) () from /lib/x86_64-linux-gnu/libgwenviewlib.so.5
Comment 6 Richard Johnson 2021-09-28 01:47:12 UTC
Created attachment 141971 [details]
New crash information added by DrKonqi

gwenview (20.12.3) using Qt 5.15.2

- What I was doing when the application crashed:

This seems to happen reliably on jpg's produced by darktable.  Darktable-rendered pics all cause the crash.  These were all NEF (Nikon) raw processed into jpg.   JPG's made by other tools seem to all work fine.

-- Backtrace (Reduced):
#4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:49
#5  0x00007f0de4254864 in __GI_abort () at abort.c:79
[...]
#12 0x00007f0de3ecb92d in Exiv2::Xmpdatum::write(std::ostream&, Exiv2::ExifData const*) const () from /lib/x86_64-linux-gnu/libexiv2.so.27
#13 0x00007f0de63d6250 in Gwenview::ImageMetaInfoModel::setExiv2Image(Exiv2::Image const*) () from /lib/x86_64-linux-gnu/libgwenviewlib.so.5
#14 0x00007f0de63a0a70 in Gwenview::Document::setExiv2Image(std::unique_ptr<Exiv2::Image, std::default_delete<Exiv2::Image> >) () from /lib/x86_64-linux-gnu/libgwenviewlib.so.5
Comment 7 Tony 2021-10-03 21:20:06 UTC
*** Bug 443069 has been marked as a duplicate of this bug. ***
Comment 8 Guillermo Rozas 2021-10-09 15:52:03 UTC
Created attachment 142281 [details]
New crash information added by DrKonqi

gwenview (21.08.1) using Qt 5.15.2

- What I was doing when the application crashed: Opening JPG exported by darktable. This happens reliably since a few weeks ago with every images (either new or exported before the crashes started)

-- Backtrace (Reduced):
#4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:49
#5  0x00007fc9b6bac864 in __GI_abort () at abort.c:79
[...]
#12 0x00007fc9b692a92d in Exiv2::Xmpdatum::write(std::ostream&, Exiv2::ExifData const*) const () from /lib/x86_64-linux-gnu/libexiv2.so.27
#13 0x00007fc9b8eb3468 in Gwenview::ImageMetaInfoModel::setExiv2Image(Exiv2::Image const*) () from /lib/x86_64-linux-gnu/libgwenviewlib.so.5
#14 0x00007fc9b8e780e0 in Gwenview::Document::setExiv2Image(std::unique_ptr<Exiv2::Image, std::default_delete<Exiv2::Image> >) () from /lib/x86_64-linux-gnu/libgwenviewlib.so.5
Comment 9 Tony 2021-10-13 02:59:24 UTC
*** Bug 443651 has been marked as a duplicate of this bug. ***
Comment 10 Charlie Figura 2021-10-25 18:54:46 UTC
Created attachment 142865 [details]
New crash information added by DrKonqi

gwenview (21.08.1) using Qt 5.15.2

Gwenview crashed when trying to open a jpg.  The images in question were saved by Darktable from Canon Raw images, and ranged in size from 8.2 to 16.4 MiB.

-- Backtrace (Reduced):
#4  __pthread_kill_implementation (no_tid=0, signo=6, threadid=139626298358848) at pthread_kill.c:44
#5  __pthread_kill_internal (signo=6, threadid=139626298358848) at pthread_kill.c:80
#6  __GI___pthread_kill (threadid=139626298358848, signo=signo@entry=6) at pthread_kill.c:91
#7  0x00007efd4d5d6476 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#8  0x00007efd4d5bc7b7 in __GI_abort () at abort.c:79
Comment 11 p92 2021-11-02 19:10:49 UTC
Created attachment 143150 [details]
New crash information added by DrKonqi

gwenview (21.08.1) using Qt 5.15.2

- What I was doing when the application crashed:
I clicked on a PNG file on dolphin
gwenview opened the image
I cropped this image 
closed gwenview

clicked on another image on the same dir
gwenview opened the image
clicked on next image button on gwenview ==> this crash

- Unusual behavior I noticed:
now each time I click on an image on dolphin, gwenview crashes

-- Backtrace (Reduced):
#4  __pthread_kill_implementation (no_tid=0, signo=6, threadid=139983886013632) at pthread_kill.c:44
#5  __pthread_kill_internal (signo=6, threadid=139983886013632) at pthread_kill.c:80
#6  __GI___pthread_kill (threadid=139983886013632, signo=signo@entry=6) at pthread_kill.c:91
#7  0x00007f508f3f7476 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#8  0x00007f508f3dd7b7 in __GI_abort () at abort.c:79
Comment 12 cs 2021-11-02 19:46:59 UTC
Mee too! Can't no longer view my photos saved by darktable... 

Gwenview 21.08.2
Kubuntu 21.10
KDE Frameworks Version 5.87.0
Qt 5.15.2
libexiv2-27 0.27.3-3ubuntu4

$ gwenview dsc_0013_jf.jpg
org.kde.kdegraphics.gwenview.lib: Unresolved mime type  "image/x-mng"
org.kde.kdegraphics.gwenview.lib: Unresolved raw mime type  "image/x-nikon-nrw"
org.kde.kdegraphics.gwenview.lib: Unresolved raw mime type  "image/x-samsung-srw"
terminate called after throwing an instance of 'std::out_of_range'
  what():  basic_string::at: __n (which is 19) >= this->size() (which is 19)
KCrash: crashing... crashRecursionCounter = 2
KCrash: Application Name = gwenview path = /usr/bin pid = 235591
KCrash: Arguments: /usr/bin/gwenview dsc_0013_jf.jpg 
KCrash: Attempting to start /usr/lib/x86_64-linux-gnu/libexec/drkonqi

[1]+  Angehalten              gwenview dsc_0013_jf.jpg



Application: Gwenview (gwenview), signal: Aborted

[KCrash Handler]
#4  __pthread_kill_implementation (no_tid=0, signo=6, threadid=140084165356608) at pthread_kill.c:44
#5  __pthread_kill_internal (signo=6, threadid=140084165356608) at pthread_kill.c:80
#6  __GI___pthread_kill (threadid=140084165356608, signo=signo@entry=6) at pthread_kill.c:91
#7  0x00007f67e85db476 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#8  0x00007f67e85c17b7 in __GI_abort () at abort.c:79
#9  0x00007f67e885ea31 in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6
#10 0x00007f67e886a4ec in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6
#11 0x00007f67e886a557 in std::terminate() () from /lib/x86_64-linux-gnu/libstdc++.so.6
#12 0x00007f67e886a7f9 in __cxa_throw () from /lib/x86_64-linux-gnu/libstdc++.so.6
#13 0x00007f67e8861448 in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6
#14 0x00007f67e83967fd in ?? () from /lib/x86_64-linux-gnu/libexiv2.so.27
#15 0x00007f67e833612d in Exiv2::Xmpdatum::write(std::ostream&, Exiv2::ExifData const*) const () from /lib/x86_64-linux-gnu/libexiv2.so.27
#16 0x00007f67ea8fa6d6 in Gwenview::ImageMetaInfoModel::setExiv2Image(Exiv2::Image const*) () from /lib/x86_64-linux-gnu/libgwenviewlib.so.5
#17 0x00007f67ea8bfcd0 in Gwenview::Document::setExiv2Image(std::unique_ptr<Exiv2::Image, std::default_delete<Exiv2::Image> >) () from /lib/x86_64-linux-gnu/libgwenviewlib.so.5
#18 0x00007f67ea8cacab in ?? () from /lib/x86_64-linux-gnu/libgwenviewlib.so.5
#19 0x00007f67e8cc6a53 in ?? () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#20 0x00007f67e8aacec5 in QFutureWatcherBase::event(QEvent*) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#21 0x00007f67e99f66b3 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#22 0x00007f67e8c8f16a in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#23 0x00007f67e8c92257 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#24 0x00007f67e8ce8ef7 in ?? () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#25 0x00007f67e63708bb in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#26 0x00007f67e63c3f08 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#27 0x00007f67e636e003 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#28 0x00007f67e8ce8548 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#29 0x00007f67e8c8da9b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#30 0x00007f67e8c96024 in QCoreApplication::exec() () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#31 0x00005646e78c5553 in ?? ()
#32 0x00007f67e85c2fd0 in __libc_start_call_main (main=main@entry=0x5646e78c4fe0, argc=argc@entry=2, argv=argv@entry=0x7ffcec921388) at ../sysdeps/nptl/libc_start_call_main.h:58
#33 0x00007f67e85c307d in __libc_start_main_impl (main=0x5646e78c4fe0, argc=2, argv=0x7ffcec921388, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffcec921378) at ../csu/libc-start.c:409
#34 0x00005646e78c5b75 in ?? ()
[Inferior 1 (process 235591) detached]
Comment 13 mhoppstaedter 2021-11-09 14:22:50 UTC
Same here.

Ubuntu 21.10
Gwenview 21.08.1

Application: Gwenview (gwenview), signal: Aborted

[KCrash Handler]
#4  __pthread_kill_implementation (no_tid=0, signo=6, threadid=140017931865152) at pthread_kill.c:44
#5  __pthread_kill_internal (signo=6, threadid=140017931865152) at pthread_kill.c:80
#6  __GI___pthread_kill (threadid=140017931865152, signo=signo@entry=6) at pthread_kill.c:91
#7  0x00007f587c8a7476 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#8  0x00007f587c88d7b7 in __GI_abort () at abort.c:79
#9  0x00007f587cb2aa31 in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6
#10 0x00007f587cb364ec in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6
#11 0x00007f587cb36557 in std::terminate() () from /lib/x86_64-linux-gnu/libstdc++.so.6
#12 0x00007f587cb367f9 in __cxa_throw () from /lib/x86_64-linux-gnu/libstdc++.so.6
#13 0x00007f587cb2d448 in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6
#14 0x00007f587c6627fd in ?? () from /lib/x86_64-linux-gnu/libexiv2.so.27
#15 0x00007f587c60212d in Exiv2::Xmpdatum::write(std::ostream&, Exiv2::ExifData const*) const () from /lib/x86_64-linux-gnu/libexiv2.so.27
#16 0x00007f587ebb86d6 in Gwenview::ImageMetaInfoModel::setExiv2Image(Exiv2::Image const*) () from /lib/x86_64-linux-gnu/libgwenviewlib.so.5
#17 0x00007f587eb7dcd0 in Gwenview::Document::setExiv2Image(std::unique_ptr<Exiv2::Image, std::default_delete<Exiv2::Image> >) () from /lib/x86_64-linux-gnu/libgwenviewlib.so.5
#18 0x00007f587eb88cab in ?? () from /lib/x86_64-linux-gnu/libgwenviewlib.so.5
#19 0x00007f587cf92a53 in ?? () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#20 0x00007f587cd78ec5 in QFutureWatcherBase::event(QEvent*) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#21 0x00007f587dcc16b3 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#22 0x00007f587cf5b16a in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#23 0x00007f587cf5e257 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#24 0x00007f587cfb4ef7 in ?? () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#25 0x00007f587a6428bb in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#26 0x00007f587a695f08 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#27 0x00007f587a640003 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#28 0x00007f587cfb4548 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#29 0x00007f587cf59a9b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#30 0x00007f587cf62024 in QCoreApplication::exec() () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#31 0x0000563a42669553 in ?? ()
#32 0x00007f587c88efd0 in __libc_start_call_main (main=main@entry=0x563a42668fe0, argc=argc@entry=2, argv=argv@entry=0x7fffa40d4c98) at ../sysdeps/nptl/libc_start_call_main.h:58
#33 0x00007f587c88f07d in __libc_start_main_impl (main=0x563a42668fe0, argc=2, argv=0x7fffa40d4c98, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffa40d4c88) at ../csu/libc-start.c:409
#34 0x0000563a42669b75 in ?? ()
[Inferior 1 (process 28983) detached]
Comment 14 k_d_hudson 2021-11-10 21:53:21 UTC
Created attachment 143424 [details]
New crash information added by DrKonqi

gwenview (20.12.3) using Qt 5.15.2

- What I was doing when the application crashed:

This is a little bizarre. I encountered this while rapidly scrolling through thumbnails in a directory. One particular image reliably crashes QwenView, but it isn't the image itself because QwenView opens the image just fine if I copy it to another directory. If I copy just a few of the images to another directory, QwenView also works just fine. The directory contents are available online to replicate this issue. I downloaded and replicated again just to be sure.

The directory contents are available online inside this archive: https://downloads.open-tx.org/2.3/release/sdcard/opentx-t16/sdcard-480x272-2.3V0025.zip. The directory is IMAGES. The image QwenView crashes on is IMAGES/P51.jpg.

To replicate, extract the archive, and start clicking through the images. I double clicked on in Dolphin to start.

The crash can be reproduced every time.

-- Backtrace (Reduced):
#4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:49
#5  0x00007f191f393864 in __GI_abort () at abort.c:79
[...]
#12 0x00007f191f00a92d in Exiv2::Xmpdatum::write(std::ostream&, Exiv2::ExifData const*) const () from /lib/x86_64-linux-gnu/libexiv2.so.27
#13 0x00007f1921515250 in Gwenview::ImageMetaInfoModel::setExiv2Image(Exiv2::Image const*) () from /lib/x86_64-linux-gnu/libgwenviewlib.so.5
#14 0x00007f19214dfa70 in Gwenview::Document::setExiv2Image(std::unique_ptr<Exiv2::Image, std::default_delete<Exiv2::Image> >) () from /lib/x86_64-linux-gnu/libgwenviewlib.so.5
Comment 15 Jan Rathmann 2021-11-10 22:14:54 UTC
For me this seems to be fixed under Kubuntu 21.10 with Gwenview 21.08.2 from kubuntu-backports-ppa.
Comment 16 p92 2021-11-11 11:13:22 UTC
Created attachment 143444 [details]
New crash information added by DrKonqi

gwenview (21.08.2) using Qt 5.15.2

- What I was doing when the application crashed:
just viewing pics in a folder with gwenview when on one of them gwenview systematically crashes 

- Unusual behavior I noticed:
crash  of gwenview when selecting next pic that crashes gwenview

-- Backtrace (Reduced):
#4  __pthread_kill_implementation (no_tid=0, signo=6, threadid=140610082931904) at pthread_kill.c:44
#5  __pthread_kill_internal (signo=6, threadid=140610082931904) at pthread_kill.c:80
#6  __GI___pthread_kill (threadid=140610082931904, signo=signo@entry=6) at pthread_kill.c:91
#7  0x00007fe25b7e8476 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#8  0x00007fe25b7ce7b7 in __GI_abort () at abort.c:79
Comment 17 p92 2021-11-11 11:14:52 UTC
(In reply to p92 from comment #16)
> Created attachment 143444 [details]
> New crash information added by DrKonqi
> 
> gwenview (21.08.2) using Qt 5.15.2
> 
> - What I was doing when the application crashed:
> just viewing pics in a folder with gwenview when on one of them gwenview
> systematically crashes 
> 
> - Unusual behavior I noticed:
> crash  of gwenview when selecting next pic that crashes gwenview
> 
> -- Backtrace (Reduced):
> #4  __pthread_kill_implementation (no_tid=0, signo=6,
> threadid=140610082931904) at pthread_kill.c:44
> #5  __pthread_kill_internal (signo=6, threadid=140610082931904) at
> pthread_kill.c:80
> #6  __GI___pthread_kill (threadid=140610082931904, signo=signo@entry=6) at
> pthread_kill.c:91
> #7  0x00007fe25b7e8476 in __GI_raise (sig=sig@entry=6) at
> ../sysdeps/posix/raise.c:26
> #8  0x00007fe25b7ce7b7 in __GI_abort () at abort.c:79

not fixed :)
Comment 18 Jan Rathmann 2021-11-11 13:45:35 UTC
(In reply to Jan Rathmann from comment #15)
> For me this seems to be fixed under Kubuntu 21.10 with Gwenview 21.08.2 from
> kubuntu-backports-ppa.

Please disregard this comment - I totally forgot that I had installed a patched version of exiv2 (with the change described in Comment 4) to workaround the bug, sorry for causing confusion.
Comment 19 Erich Eickmeyer 2021-12-01 04:22:38 UTC
Created attachment 144108 [details]
New crash information added by DrKonqi

gwenview (21.11.90) using Qt 5.15.2

- What I was doing when the application crashed:
Attempting to open a family photo I had just exported from Darktable

-- Backtrace (Reduced):
#4  __pthread_kill_implementation (no_tid=0, signo=6, threadid=139723732405312) at pthread_kill.c:44
#5  __pthread_kill_internal (signo=6, threadid=139723732405312) at pthread_kill.c:80
#6  __GI___pthread_kill (threadid=139723732405312, signo=signo@entry=6) at pthread_kill.c:91
#7  0x00007f13fcc35476 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#8  0x00007f13fcc1b7b7 in __GI_abort () at abort.c:79
Comment 20 Richard Johnson 2021-12-04 04:38:24 UTC
Created attachment 144195 [details]
New crash information added by DrKonqi

gwenview (21.08.1) using Qt 5.15.2

- What I was doing when the application crashed:  
1. used darktable to create a jpg from nef
2. opened jpg with showfoto (success, including metadata)
3. attempted to open jpg with gwenview, immediate app abort

- Unusual behavior I noticed:
* all tools are in default configuration
* Gwenview frame started to open but then aborted.

This machine is now kubuntu 21.10, and both qwenview and darktable have been updated since the original bug report.

-- Backtrace (Reduced):
#4  __pthread_kill_implementation (no_tid=0, signo=6, threadid=139933381518528) at pthread_kill.c:44
#5  __pthread_kill_internal (signo=6, threadid=139933381518528) at pthread_kill.c:80
#6  __GI___pthread_kill (threadid=139933381518528, signo=signo@entry=6) at pthread_kill.c:91
#7  0x00007f44ccf20476 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#8  0x00007f44ccf067b7 in __GI_abort () at abort.c:79
Comment 21 Gordon Lack 2021-12-14 22:45:12 UTC
Created attachment 144559 [details]
New crash information added by DrKonqi

gwenview (21.08.1) using Qt 5.15.2

- What I was doing when the application crashed:

Browsing through images with Dolphin. Select to open one in Gwenview.
Crashes every time.

-- Backtrace (Reduced):
#4  __pthread_kill_implementation (no_tid=0, signo=6, threadid=140466192913600) at pthread_kill.c:44
#5  __pthread_kill_internal (signo=6, threadid=140466192913600) at pthread_kill.c:80
#6  __GI___pthread_kill (threadid=140466192913600, signo=signo@entry=6) at pthread_kill.c:91
#7  0x00007fc0dafab476 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#8  0x00007fc0daf917b7 in __GI_abort () at abort.c:79
Comment 22 Gordon Lack 2021-12-14 23:12:44 UTC
(In reply to Gordon Lack from comment #21)

Seems to be related to how old the jpegs are.

2016 and earlier it crashes.
2017 and late its OK.
Roughly.....

If I run gwenview on the command line for a failing one this is what I see reported:

====================
[gmllaptop]: gwenview DSCN1657.JPG 
org.kde.kdegraphics.gwenview.lib: Unresolved mime type  "image/x-mng"
org.kde.kdegraphics.gwenview.lib: Unresolved raw mime type  "image/x-nikon-nrw"
org.kde.kdegraphics.gwenview.lib: Unresolved raw mime type  "image/x-samsung-srw"
terminate called after throwing an instance of 'std::out_of_range'
  what():  basic_string::at: __n (which is 19) >= this->size() (which is 19)
KCrash: crashing... crashRecursionCounter = 2
KCrash: Application Name = gwenview path = /usr/bin pid = 15230
KCrash: Arguments: /usr/bin/gwenview DSCN1657.JPG 
KCrash: Attempting to start /usr/lib/x86_64-linux-gnu/libexec/drkonqi

[1]+  Stopped                 gwenview DSCN1657.JPG
[gmllaptop]: fg
gwenview DSCN1657.JPG
QSocketNotifier: Invalid socket 8 and type 'Read', disabling...
QSocketNotifier: Invalid socket 10 and type 'Read', disabling...
QSocketNotifier: Invalid socket 13 and type 'Read', disabling...
QSocketNotifier: Invalid socket 18 and type 'Read', disabling...

;
^C
[gmllaptop]: fg
bash: fg: current: no such job
[gmllaptop]: gwenview DSCN1657.JPG 
org.kde.kdegraphics.gwenview.lib: Unresolved mime type  "image/x-mng"
org.kde.kdegraphics.gwenview.lib: Unresolved raw mime type  "image/x-nikon-nrw"
org.kde.kdegraphics.gwenview.lib: Unresolved raw mime type  "image/x-samsung-srw"
terminate called after throwing an instance of 'std::out_of_range'
  what():  basic_string::at: __n (which is 19) >= this->size() (which is 19)
KCrash: crashing... crashRecursionCounter = 2
KCrash: Application Name = gwenview path = /usr/bin pid = 15230
KCrash: Arguments: /usr/bin/gwenview DSCN1657.JPG 
KCrash: Attempting to start /usr/lib/x86_64-linux-gnu/libexec/drkonqi

[1]+  Stopped                 gwenview DSCN1657.JPG
[gmllaptop]: fg
gwenview DSCN1657.JPG
QSocketNotifier: Invalid socket 8 and type 'Read', disabling...
QSocketNotifier: Invalid socket 10 and type 'Read', disabling...
QSocketNotifier: Invalid socket 13 and type 'Read', disabling...
QSocketNotifier: Invalid socket 18 and type 'Read', disabling...

;
^C
[gmllaptop]: fg
bash: fg: current: no such job
====================
Comment 23 Lukáš Karas 2021-12-16 08:02:29 UTC
Created attachment 144593 [details]
sample image that is causing the crash

Here is jpg file that is causing the the crash. It is clear that libexiv is throwing exception when it tries to parse date. This exception is not catched in gwenview. 

$ exiv2 -P X print  test.jpg 
Xmp.tiff.Software                            XmpText    13  digiKam-7.1.0
Xmp.tiff.DateTime                            XmpText    19  2014-09-13T14:36:40
Xmp.tiff.ImageWidth                          XmpText     4  3110
Xmp.tiff.ImageLength                         XmpText     4  1553
Xmp.xmp.CreatorTool                          XmpText    13  digiKam-3.5.0
Xmp.xmp.CreateDate                           XmpText    19  2014-09-13T14:36:40
Xmp.xmp.MetadataDate                         XmpText    19  2014-09-13T14:36:40
Xmp.xmp.ModifyDate                           XmpText    19  2014-09-13T14:36:40
Xmp.xmp.Rating                               XmpText     1  2
Xmp.exif.DateTimeOriginal                    XmpText    19  Uncaught exception: basic_string::at: __n (which is 19) >= this->size() (which is 19)

$ echo $?
1

So, fix is obvious. But where it should be fixed? In libexiv or gwenview? 

Ubuntu 21.10
exiv2 0.27.3
gwenview 21.08.1
Comment 24 Lukáš Karas 2021-12-16 08:40:30 UTC
Here is my proposed fix in Gwenview: https://invent.kde.org/graphics/gwenview/-/merge_requests/125
Comment 25 David 2021-12-17 19:56:23 UTC
Created attachment 144631 [details]
New crash information added by DrKonqi

gwenview (21.08.1) using Qt 5.15.2

- What I was doing when the application crashed: I was trying to open a .jpg. All .jpg's in that folder crash; I can open jpg's from different folders. If I copy the jpg's that crash to a diffent folder they open (no crash). The afected folder is a copy of my old windows 10 desktop. PNG images in the same folder as the crashy jpg's open just fine.

-- Backtrace (Reduced):
#4  __pthread_kill_implementation (no_tid=0, signo=6, threadid=139954795291840) at pthread_kill.c:44
#5  __pthread_kill_internal (signo=6, threadid=139954795291840) at pthread_kill.c:80
#6  __GI___pthread_kill (threadid=139954795291840, signo=signo@entry=6) at pthread_kill.c:91
#7  0x00007f49c94e4476 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#8  0x00007f49c94ca7b7 in __GI_abort () at abort.c:79
Comment 26 Gordon Lack 2021-12-17 22:44:13 UTC
(In reply to Lukáš Karas from comment #24)
> Here is my proposed fix in Gwenview:
> https://invent.kde.org/graphics/gwenview/-/merge_requests/125

Do we need a prod on the libexiv2 package as well to indicate that it needs an update to fix the cause of the crash? (The fix for gwenview to handle such crashes better is welcome, but not sufficient).

I can't see any bug report with libexiv2 as the product.
Comment 27 Felix Ernst 2021-12-17 23:51:56 UTC
This is now fixed both upstream in libexiv2 0.27.5 with https://github.com/Exiv2/exiv2/pull/1918/commits/8a1e949bff482f74599f60b8ab518442036b1834 and in Gwenview for version 21.12.1 with https://invent.kde.org/graphics/gwenview/-/commit/91fcbe9c63c17bc20dbb3dd90e0451997f1c78a6 by Lukáš Karas.

The fix in Gwenview has not been merged into master and will not be present for example in future Gwenview 22.04 because we expect packagers to have shipped the fixed libexiv2 versions by the time Gwenview 22.04 is released.
Comment 28 Felix Ernst 2021-12-17 23:59:51 UTC
(In reply to Gordon Lack from comment #26)
> Do we need a prod on the libexiv2 package as well to indicate that it needs
> an update to fix the cause of the crash? (The fix for gwenview to handle
> such crashes better is welcome, but not sufficient).
> 
> I can't see any bug report with libexiv2 as the product.

There is https://bugs.launchpad.net/ubuntu/+source/exiv2/+bug/1942799
Comment 29 Nicolas Fella 2021-12-20 23:40:35 UTC
*** Bug 445763 has been marked as a duplicate of this bug. ***
Comment 30 Nicolas Fella 2021-12-20 23:44:54 UTC
*** Bug 447039 has been marked as a duplicate of this bug. ***
Comment 31 Nicolas Fella 2021-12-20 23:46:22 UTC
*** Bug 444851 has been marked as a duplicate of this bug. ***
Comment 32 Nicolas Fella 2021-12-27 21:48:05 UTC
*** Bug 447585 has been marked as a duplicate of this bug. ***
Comment 33 Simon Schmeisser 2022-01-11 15:39:54 UTC
Patched exiv2 packages for Ubuntu have just been released.