Bug 452725 - Destroying locked mutex / running thread crash with large image files
Summary: Destroying locked mutex / running thread crash with large image files
Status: REPORTED
Alias: None
Product: gwenview
Classification: Applications
Component: general (show other bugs)
Version: 21.12.3
Platform: Arch Linux Linux
: NOR crash
Target Milestone: ---
Assignee: Gwenview Bugs
URL:
Keywords: drkonqi
Depends on:
Blocks:
 
Reported: 2022-04-18 09:48 UTC by Sami Liedes
Modified: 2022-04-18 09:48 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sami Liedes 2022-04-18 09:48:55 UTC
Application: gwenview (21.12.3)

Qt Version: 5.15.3
Frameworks Version: 5.92.0
Operating System: Linux 5.16.12-arch1-1 x86_64
Windowing System: X11
Distribution: "Arch Linux"
DrKonqi: 5.24.4 [KCrashBackend]

-- Information about the crash:
I have seen a few times this crash now, but it is not deterministic (and I think is obviously thread timing related). Here is what Gwenview outputs on stderr:

------------------------
$ gwenview mean.png var.png
kf.kio.widgets: Failed to check which JobView API is supported "The name org.kde.kuiserver was not provided by any .service files"
org.kde.kdegraphics.gwenview.lib: Unresolved mime type  "image/x-mng"
org.kde.kdegraphics.gwenview.lib: Unresolved raw mime type  "image/x-samsung-srw"
QMutex: destroying locked mutex
QThread: Destroyed while thread is still running
KCrash: crashing... crashRecursionCounter = 2
KCrash: Application Name = gwenview path = /usr/bin pid = 3328152
KCrash: Arguments: /usr/bin/gwenview mean.png var.png 
libpng error: Read Error
org.kde.kdegraphics.gwenview.lib: Could not generate thumbnail for file "file:///tmp/gwenview-zbQUYF/mean.png"
KCrash: Attempting to start /usr/lib/drkonqi
------------------------

Notice from the first line that I only gave gwenview two images as a parameter.

The output lines before the "QMutex:" one are also output when the crash does not happen. I think it may be relevant that these two files are quite large, 28 megabyte 3000x4000 16-bit PNGs. I suspect it is mainly relevant for the reason that loading them takes a long time, which apparently makes hitting this bug more likely.

I probably pressed enter to select the first picture, and maybe (but I think not) pressed ESC to get back to the preview. In any case I think this crash happens before either of the images are shown.

I doubt the exact contents of the .pngs is relevant, but I put them in https://sliedes.kapsi.fi/gwenview-bug/ in case you want to try to reproduce this.

I think the image/x-samsung-srw related message may be related to a few .dng files existing in the same directory. Perhaps Gwenview is reading/thumbnailing them despite not being given them as parameters? In any case, the directory has:

- 26 .pngs, of which 9 have size in the range [10,000,000; 33,067,081] bytes, while the rest are smaller;
- 3 .dngs, the largest of which is about 28 megabytes in size
- 2 jpegs of <4 MiB
- 12 .jxls (JPEG XL) of <8 MiB
- No other image files, and generally not many other files.

The crash can be reproduced sometimes.

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

[KCrash Handler]
#4  0x00007f6d4668434c in __pthread_kill_implementation () at /usr/lib/libc.so.6
#5  0x00007f6d466374b8 in raise () at /usr/lib/libc.so.6
#6  0x00007f6d46621534 in abort () at /usr/lib/libc.so.6
#7  0x00007f6d46ac4ee4 in qt_assert(char const*, char const*, int) () at /usr/lib/libQt5Core.so.5
#8  0x00007f6d46ac671a in  () at /usr/lib/libQt5Core.so.5
#9  0x00007f6d487b00be in Gwenview::ThumbnailGenerator::~ThumbnailGenerator() (this=0x5583d6d0bf80, this=<optimized out>) at /usr/src/debug/build/lib/gwenviewlib_autogen/6D5CK4GEXA/../../../../gwenview-21.12.3/lib/thumbnailprovider/thumbnailgenerator.h:47
#10 Gwenview::ThumbnailGenerator::~ThumbnailGenerator() (this=0x5583d6d0bf80, this=<optimized out>) at /usr/src/debug/build/lib/gwenviewlib_autogen/6D5CK4GEXA/../../../../gwenview-21.12.3/lib/thumbnailprovider/thumbnailgenerator.h:47
#11 0x00007f6d46cd55d7 in QObject::event(QEvent*) () at /usr/lib/libQt5Core.so.5
#12 0x00007f6d479811c6 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/libQt5Widgets.so.5
#13 0x00007f6d46cb15aa in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/libQt5Core.so.5
#14 0x00007f6d46cb20a9 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () at /usr/lib/libQt5Core.so.5
#15 0x00007f6d46cf9678 in  () at /usr/lib/libQt5Core.so.5
#16 0x00007f6d44593163 in g_main_dispatch (context=0x7f6d38004f70) at ../glib/glib/gmain.c:3417
#17 g_main_context_dispatch (context=0x7f6d38004f70) at ../glib/glib/gmain.c:4135
#18 0x00007f6d445e99e9 in g_main_context_iterate.constprop.0 (context=context@entry=0x7f6d38004f70, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/glib/gmain.c:4211
#19 0x00007f6d445906c5 in g_main_context_iteration (context=0x7f6d38004f70, may_block=1) at ../glib/glib/gmain.c:4276
#20 0x00007f6d46cfd57a in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Core.so.5
#21 0x00007f6d46ca988b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Core.so.5
#22 0x00007f6d46cb4fd7 in QCoreApplication::exec() () at /usr/lib/libQt5Core.so.5
#23 0x00005583d5d00987 in main(int, char**) (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/gwenview-21.12.3/app/main.cpp:197
[Inferior 1 (process 3328152) detached]

Possible duplicates by query: bug 452323, bug 451868, bug 450095, bug 450060, bug 449396.

Reported using DrKonqi