Bug 456237 - Crash after changing the collection
Summary: Crash after changing the collection
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Database-Scan (show other bugs)
Version: 7.6.0
Platform: Fedora RPMs Linux
: NOR crash
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords: drkonqi
Depends on:
Blocks:
 
Reported: 2022-07-02 12:35 UTC by Paulo Fidalgo
Modified: 2022-07-02 17:11 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Paulo Fidalgo 2022-07-02 12:35:37 UTC
Application: digikam (7.6.0)

Qt Version: 5.15.3
Frameworks Version: 5.94.0
Operating System: Linux 5.18.6-200.fc36.x86_64 x86_64
Windowing System: X11
Distribution: Fedora Linux 36 (KDE Plasma)
DrKonqi: 5.24.5 [KCrashBackend]

-- Information about the crash:
- What I was doing when the application crashed:
I've moved my photo colection from an external drive to my internal drive and changed both the database and the photo collection path.
After "reindex" like 2% I get a constant crash everytime I've restarted the application

The crash can be reproduced every time.

-- Backtrace:
Application: digiKam (digikam), signal: Aborted

[KCrash Handler]
#4  0x00007f3224ab4c4c in __pthread_kill_implementation () from /lib64/libc.so.6
#5  0x00007f3224a649c6 in raise () from /lib64/libc.so.6
#6  0x00007f3224a4e7f4 in abort () from /lib64/libc.so.6
#7  0x00007f3224f2e4e5 in QMessageLogger::fatal(char const*, ...) const () from /lib64/libQt5Core.so.5
#8  0x00007f3224f2d828 in qt_assert(char const*, char const*, int) () from /lib64/libQt5Core.so.5
#9  0x00007f322738018f in QArrayData::data() [clone .part.0] [clone .lto_priv.0] () from /lib64/libdigikamgui.so.7.6.0
#10 0x00007f3227399d6c in Digikam::Album::childAtRow(int) const [clone .cold] () from /lib64/libdigikamgui.so.7.6.0
#11 0x00007f32274ed789 in Digikam::AbstractAlbumModel::index(int, int, QModelIndex const&) const () from /lib64/libdigikamgui.so.7.6.0
#12 0x00007f32275153f8 in Digikam::AbstractCheckableAlbumTreeView::rowsInserted(QModelIndex const&, int, int) () from /lib64/libdigikamgui.so.7.6.0
#13 0x00007f3225157dbf in void doActivate<false>(QObject*, int, void**) () from /lib64/libQt5Core.so.5
#14 0x00007f32250d53d2 in QAbstractItemModel::rowsInserted(QModelIndex const&, int, int, QAbstractItemModel::QPrivateSignal) () from /lib64/libQt5Core.so.5
#15 0x00007f32250de21e in QAbstractItemModel::endInsertRows() () from /lib64/libQt5Core.so.5
#16 0x00007f3225101b5d in QSortFilterProxyModelPrivate::insert_source_items(QVector<int>&, QVector<int>&, QVector<int> const&, QModelIndex const&, Qt::Orientation, bool) () from /lib64/libQt5Core.so.5
#17 0x00007f3225104639 in QSortFilterProxyModelPrivate::source_items_inserted(QModelIndex const&, int, int, Qt::Orientation) () from /lib64/libQt5Core.so.5
#18 0x00007f32251073ad in QSortFilterProxyModelPrivate::_q_sourceRowsInserted(QModelIndex const&, int, int) () from /lib64/libQt5Core.so.5
#19 0x00007f3225157dbf in void doActivate<false>(QObject*, int, void**) () from /lib64/libQt5Core.so.5
#20 0x00007f32250d53d2 in QAbstractItemModel::rowsInserted(QModelIndex const&, int, int, QAbstractItemModel::QPrivateSignal) () from /lib64/libQt5Core.so.5
#21 0x00007f32250de21e in QAbstractItemModel::endInsertRows() () from /lib64/libQt5Core.so.5
#22 0x00007f32274e9155 in Digikam::AbstractAlbumModel::slotAlbumAdded(Digikam::Album*) () from /lib64/libdigikamgui.so.7.6.0
#23 0x00007f3225157c36 in void doActivate<false>(QObject*, int, void**) () from /lib64/libQt5Core.so.5
#24 0x00007f32274f22f6 in Digikam::AlbumManager::signalAlbumAdded(Digikam::Album*) () from /lib64/libdigikamgui.so.7.6.0
#25 0x00007f3227529695 in Digikam::AlbumManager::scanPAlbums() () from /lib64/libdigikamgui.so.7.6.0
#26 0x00007f3225157dbf in void doActivate<false>(QObject*, int, void**) () from /lib64/libQt5Core.so.5
#27 0x00007f322515afce in QTimer::timeout(QTimer::QPrivateSignal) () from /lib64/libQt5Core.so.5
#28 0x00007f322514e525 in QObject::event(QEvent*) () from /lib64/libQt5Core.so.5
#29 0x00007f3225bf0c82 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /lib64/libQt5Widgets.so.5
#30 0x00007f3225124658 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /lib64/libQt5Core.so.5
#31 0x00007f3225174681 in QTimerInfoList::activateTimers() () from /lib64/libQt5Core.so.5
#32 0x00007f3225174f5c in timerSourceDispatch(_GSource*, int (*)(void*), void*) () from /lib64/libQt5Core.so.5
#33 0x00007f3222eabfaf in g_main_context_dispatch () from /lib64/libglib-2.0.so.0
#34 0x00007f3222f012c8 in g_main_context_iterate.constprop () from /lib64/libglib-2.0.so.0
#35 0x00007f3222ea9940 in g_main_context_iteration () from /lib64/libglib-2.0.so.0
#36 0x00007f32251752fa in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt5Core.so.5
#37 0x00007f32251230ba in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt5Core.so.5
#38 0x00007f32274a7881 in Digikam::ScanController::completeCollectionScanCore(bool, bool, bool) () from /lib64/libdigikamgui.so.7.6.0
#39 0x00007f32275ce074 in Digikam::NewItemsFinder::slotStart() () from /lib64/libdigikamgui.so.7.6.0
#40 0x00007f322514e694 in QObject::event(QEvent*) () from /lib64/libQt5Core.so.5
#41 0x00007f3225bf0c82 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /lib64/libQt5Widgets.so.5
#42 0x00007f3225124658 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /lib64/libQt5Core.so.5
#43 0x00007f32251279b4 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /lib64/libQt5Core.so.5
#44 0x00007f3225175807 in postEventSourceDispatch(_GSource*, int (*)(void*), void*) () from /lib64/libQt5Core.so.5
#45 0x00007f3222eabfaf in g_main_context_dispatch () from /lib64/libglib-2.0.so.0
#46 0x00007f3222f012c8 in g_main_context_iterate.constprop () from /lib64/libglib-2.0.so.0
#47 0x00007f3222ea9940 in g_main_context_iteration () from /lib64/libglib-2.0.so.0
#48 0x00007f32251752fa in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt5Core.so.5
#49 0x00007f32251230ba in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt5Core.so.5
#50 0x00007f322512b162 in QCoreApplication::exec() () from /lib64/libQt5Core.so.5
#51 0x000055ae13aa0300 in main ()
[Inferior 1 (process 898423) detached]

Possible duplicates by query: bug 451868, bug 434072, bug 427333, bug 425404, bug 424617.

Reported using DrKonqi
Comment 1 caulier.gilles 2022-07-02 12:45:54 UTC
The QFatal exception appear. It must be generated internally by Qt.

Please post the debug trace of application (not the GDB trace). digiKam is verbose and these information can help to investiguate.

See the details at: https://www.digikam.org/contribute/

Gilles Caulier
Comment 2 caulier.gilles 2022-07-02 12:49:34 UTC
Another tip: please try the digiKam 7.7.0 appimage linux bundle instead the system package. 

https://download.kde.org/stable/digikam/7.7.0/

Gilles Caulier
Comment 3 Maik Qualmann 2022-07-02 13:57:39 UTC
The cause is clear, 2 threads access a QVector List, one writes, one reads. This causes a crash. We need a mutex here.

Maik
Comment 4 Maik Qualmann 2022-07-02 17:11:01 UTC
Git commit 2519366789ec8767077bb845fadea2126fcde886 by Maik Qualmann.
Committed on 02/07/2022 at 17:10.
Pushed by mqualmann into branch 'master'.

protect album child cache QVector with a QReadWriteLock
If no problems occur we can it backport to digiKam-7.8.0.
FIXED-IN: 8.0.0

M  +2    -1    NEWS
M  +31   -3    core/libs/album/engine/album.cpp
M  +6    -3    core/libs/album/engine/album.h

https://invent.kde.org/graphics/digikam/commit/2519366789ec8767077bb845fadea2126fcde886