https://bugs.kde.org/show_bug.cgi?id=522851

            Bug ID: 522851
           Summary: Gwenview freezes/is killed (SIGABRT) due to
                    synchronous Exiv2 read in SortedDirModel::lessThan on
                    slow/remote filesystems
    Classification: Applications
           Product: gwenview
      Version First 26.04.3
       Reported In:
          Platform: Fedora RPMs
                OS: Linux
            Status: REPORTED
          Severity: crash
          Priority: NOR
         Component: general
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: ---

Created attachment 194145
  --> https://bugs.kde.org/attachment.cgi?id=194145&action=edit
Full coredumpctl backtrace (all threads)

DESCRIPTION
When browsing a folder mounted via a slow/remote filesystem (in my case, 
an rclone FUSE mount of a cloud storage provider - pCloud), Gwenview 
becomes unresponsive and is eventually killed with SIGABRT by the desktop 
environment's "application not responding" watchdog.

The crash consistently occurs while Gwenview is listing/sorting the 
parent directory, not specifically on window close as it might first 
appear (timing coincidence - see STEPS TO REPRODUCE).

ROOT CAUSE (from coredump analysis)
SortedDirModel::lessThan() calls TimeUtils::dateTimeForFileItem(), 
which calls TimeUtils::CacheItem::updateFromExif(), which calls 
Exiv2ImageLoader::load(), which performs a synchronous, blocking 
fread()/read() directly on the file path — bypassing KIO entirely, 
even though the directory listing itself (KCoreDirListerCache) 
correctly uses KIO's asynchronous worker mechanism.

On a local filesystem this read is fast enough to be invisible. On a 
FUSE-mounted remote filesystem (rclone mount, vfs-cache-mode writes), 
this read can take several seconds per file, and since it runs on 
the main/UI thread, it blocks Gwenview's event loop entirely — with 
no loading indicator shown to the user, since the thread responsible 
for drawing one is the same thread that is blocked.

This appears to be a case of the same underlying architectural issue 
documented in KDE bug 423187 (Dolphin freezes on FUSE/slow mounts), 
but occurring inside Gwenview's own sort comparator rather than in 
KIO/Dolphin itself.

Note: this is technically a forced kill (SIGABRT sent externally) 
rather than an application-internal crash (no segfault, no C++ 
exception) — but it is filed as "crash" severity since the visible 
end result is a killed process with a coredump, not just a temporary 
freeze.

STEPS TO REPRODUCE
1. Mount a remote filesystem via FUSE (e.g. rclone mount) containing 
   a folder with multiple JPEG images with EXIF data
2. Open any image from that folder in Gwenview
3. Wait a few seconds for Gwenview to load/sort the folder in the 
   background (thumbnail bar population reading EXIF data for each file)
4. Close the Gwenview window while this background sort is still in 
   progress (or simply wait/interact with the app during this window)

OBSERVED RESULT
Gwenview becomes unresponsive with no loading indicator, then is 
killed (SIGABRT) by the desktop's hang detection. This is reproducible 
consistently on the same folder.

EXPECTED RESULT
EXIF reads used for sorting/date purposes should be performed 
asynchronously (e.g. via KIO, or on a worker thread), consistent 
with how the directory listing itself is already handled, so slow 
filesystems don't block the Gwenview UI thread. At minimum, a loading 
indicator should be shown, and the application should not be killed 
for legitimate (if slow) I/O operations.

SOFTWARE/OS VERSIONS
Operating System: Fedora Linux 44
KDE Plasma Version: 6.7.2
KDE Frameworks Version: 6.27.0
Qt Version: 6.11.1
Kernel Version: 7.1.3-200.fc44.x86_64 (64-bit)
Graphics Platform: Wayland
Gwenview Version: 26.04.3-1.fc44

ADDITIONAL INFORMATION
Remote filesystem setup: rclone mount (pCloud backend, EU region), 
mounted via systemd user service with --vfs-cache-mode writes 
--dir-cache-time 720h.

Reproduced consistently across multiple attempts with different PIDs, 
all showing the identical crashing thread backtrace:

#7  read()
#8  _IO_file_underflow
#9  _IO_file_xsgetn
#10 _IO_fread
#11 Exiv2::isJpegType
#12 Exiv2::ImageFactory::open
#13 Exiv2::ImageFactory::open (string overload)
#14 Gwenview::Exiv2ImageLoader::load
#15 Gwenview::TimeUtils::CacheItem::updateFromExif
#16 Gwenview::TimeUtils::dateTimeForFileItem
#17 Gwenview::SortedDirModel::lessThan
#18 QSortFilterProxyModelGreaterThan::operator()
...
#27 KDirModelPrivate::_k_slotNewItems
#29 KCoreDirLister::itemsAdded
#31 KCoreDirListerCache::slotEntries
#33 KIO::ListJob::entries
#36 KIO::WorkerInterface::dispatch

Full coredump backtrace (all threads) available on request; happy to 
attach as a file if useful.

See also: https://bugs.kde.org/show_bug.cgi?id=423187 (related 
architectural issue in Dolphin with FUSE/slow mounts)

This crash keeps repeating. I'm not a developer, this report was completed with
the assistance of Claude AI.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to