Bug 437680 - Crash if Geolocation editor is closed while coordinates are still being updated
Summary: Crash if Geolocation editor is closed while coordinates are still being updated
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Geolocation-Workflow (show other bugs)
Version: 7.2.0
Platform: Other Linux
: NOR crash
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-05-25 19:23 UTC by Jozef Říha
Modified: 2022-01-23 14:48 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jozef Říha 2021-05-25 19:23:08 UTC
SUMMARY
digiKam crashes if user makes changes to coordinates but closes the Geolocation editor window before all items are updated.

STEPS TO REPRODUCE
1. select all items of an album with a large number of items, preferably residing on a slower media (HDD is enough in my case)
2. open geolocation editor (item - edit geolocation...)
3. editor window opens
4. select all items and set a new random location for all
5. hit apply, status bar will receive an update: Saving changes - .. %
6. do not wait, until the items are updated, but instead close the editor window (using [x] in the upper right corner of the window)


OBSERVED RESULT
a moment after digiKam crashes, metadata is not updated for all of the items

EXPECTED RESULT
digiKam continues to work w/o issues

SOFTWARE/OS VERSIONS
Arch Linux, x86_64 rolling

ADDITIONAL INFORMATION
I was not able to reproduce this every time but I was able to collect a backtrace:

Thread 257 "Thread (pooled)" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fff697fa640 (LWP 1220878)]
0x00007ffff7142e0e in QListData::size (this=0x55556083dd50) at /usr/include/qt/QtCore/qlist.h:115
warning: Source file is more recent than executable.
115	    inline int size() const noexcept { return int(d->end - d->begin); }   // q6sizetype
(gdb) bt
#0  0x00007ffff7142e0e in QListData::size() const (this=0x55556083dd50) at /usr/include/qt/QtCore/qlist.h:115
#1  QtPrivate::indexOf<Digikam::GPSItemContainer*, Digikam::GPSItemContainer*>(QList<Digikam::GPSItemContainer*> const&, Digikam::GPSItemContainer* const&, int) (from=0, u=<synthetic pointer>: 0x55556083dd60, list=...)
    at /usr/include/qt/QtCore/qlist.h:1038
#2  QList<Digikam::GPSItemContainer*>::indexOf(Digikam::GPSItemContainer* const&, int) const
    (from=0, t=<synthetic pointer>: 0x55556083dd60, this=0x55556083dd50) at /usr/include/qt/QtCore/qlist.h:1026
#3  Digikam::GPSItemModel::itemChanged(Digikam::GPSItemContainer*)
    (this=0x55556083df20, changedItem=changedItem@entry=0x55556083dd60)
    at /usr/src/debug/digikam-7.2.0/core/utilities/geolocation/geoiface/items/gpsitemmodel.cpp:143
#4  0x00007ffff713e392 in Digikam::GPSItemContainer::emitDataChanged() (this=this@entry=0x55556083dd60)
    at /usr/src/debug/digikam-7.2.0/core/utilities/geolocation/geoiface/items/gpsitemcontainer.cpp:598
#5  0x00007ffff7141659 in Digikam::GPSItemContainer::saveChanges() (this=this@entry=0x55556083dd60)
    at /usr/src/debug/digikam-7.2.0/core/utilities/geolocation/geoiface/items/gpsitemcontainer.cpp:998
#6  0x00007ffff76281d3 in Digikam::ItemGPS::saveChanges() (this=0x55556083dd60)
    at /usr/src/debug/digikam-7.2.0/core/libs/database/item/containers/itemgps.cpp:143
#7  0x00007fffb92a78bb in DigikamGenericGeolocationEditPlugin::SaveChangedImagesHelper::operator()(QPersistentModelIndex const&) (itemIndex=..., this=0x555556167fa8)
    at /usr/src/debug/digikam-7.2.0/core/dplugins/generic/metadata/geolocationedit/dialog/geolocationedit.cpp:117
#8  QtConcurrent::MappedEachKernel<QList<QPersistentModelIndex>::const_iterator, DigikamGenericGeolocationEditPlugin::SaveChangedImagesHelper>::runIteration(QList<QPersistentModelIndex>::const_iterator, int, QPair<QUrl, QString>*)
    (result=0x7fff0001da68, it=..., this=0x555556167f70) at /usr/include/qt/QtConcurrent/qtconcurrentmapkernel.h:175
#9  QtConcurrent::MappedEachKernel<QList<QPersistentModelIndex>::const_iterator, DigikamGenericGeolocationEditPlugin::SaveChangedImagesHelper>::runIterations(QList<QPersistentModelIndex>::const_iterator, int, int, QPair<QUrl, QString>*)
    (this=this@entry=0x555556167f70, sequenceBeginIterator=..., beginIndex=beginIndex@entry=196, endIndex=endIndex@entry=197, results=<optimized out>) at /usr/include/qt/QtConcurrent/qtconcurrentmapkernel.h:185
#10 0x00007fffb92aa905 in QtConcurrent::IterateKernel<QList<QPersistentModelIndex>::const_iterator, QPair<QUrl, QString> >::forThreadFunction() (this=0x555556167f70) at /usr/include/qt/QtConcurrent/qtconcurrentiteratekernel.h:255
#11 0x00007fffe53d58d5 in QtConcurrent::ThreadEngineBase::run() () at /usr/lib/libQt5Concurrent.so.5
#12 0x00007ffff53eb282 in  () at /usr/lib/libQt5Core.so.5
#13 0x00007ffff53e7f7f in  () at /usr/lib/libQt5Core.so.5
#14 0x00007ffff11ef259 in start_thread () at /usr/lib/libpthread.so.0
#15 0x00007ffff50195e3 in clone () at /usr/lib/libc.so.6
(gdb)
Comment 1 Maik Qualmann 2021-05-25 19:44:25 UTC
Git commit 9ac04ab2cce3c339bef8a0adbd2877f930aae271 by Maik Qualmann.
Committed on 25/05/2021 at 19:43.
Pushed by mqualmann into branch 'master'.

ignore close event if the GUI is not ready
FIXED-IN: 7.3.0

M  +2    -1    NEWS
M  +6    -1    core/dplugins/generic/metadata/geolocationedit/dialog/geolocationedit.cpp

https://invent.kde.org/graphics/digikam/commit/9ac04ab2cce3c339bef8a0adbd2877f930aae271
Comment 2 Jozef Říha 2021-05-25 19:53:22 UTC
Thank you for this ultrafast fix!