Bug 374922 - digiKam crashes when dropping ext. image into fuzzy search target area
Summary: digiKam crashes when dropping ext. image into fuzzy search target area
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Metadata-Engine (show other bugs)
Version: 5.4.0
Platform: Other Linux
: NOR crash
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-01-11 18:42 UTC by Barbara Scheffner
Modified: 2020-08-12 08:17 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 5.5.0


Attachments
Image that causes crash in fuzzy search when dropped into target area (1.74 MB, image/jpeg)
2017-01-11 18:42 UTC, Barbara Scheffner
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Barbara Scheffner 2017-01-11 18:42:11 UTC
Created attachment 103356 [details]
Image that causes crash in fuzzy search when dropped into target area

When d&d an image, which is not in the digiKam collections, from Dolphin to the target area digiKam crashes. It's the AppImage 5.4.0. Distro: Kubuntu. Image that causes the problem (others don't) see attachment.
Reproducable: always.

GDB bachtrace is as follows:

(gdb) bt
#0  Exiv2::ExifData::findKey (this=<optimized out>, key=...) at /b/ext_exiv2/ext_exiv2-prefix/src/ext_exiv2/src/exif.cpp:583
#1  0x00000032d2b81dda in Exiv2::Internal::PentaxMakerNote::printShutterCount (os=..., value=..., metadata=<optimized out>)
    at /b/ext_exiv2/ext_exiv2-prefix/src/ext_exiv2/src/pentaxmn.cpp:1157
#2  0x00007ffff682ad4d in Exiv2::operator<< (md=..., os=...) at ././/include/exiv2/metadatum.hpp:305
#3  Digikam::MetaEngine::getExifTagsDataList (this=this@entry=0x7fffffffc820, exifKeysFilter=...,
    invertSelection=invertSelection@entry=false) at /b/dktemp/digikam-master/core/libs/dmetadata/metaengine_exif.cpp:194
#4  0x00007ffff69abb65 in Digikam::ExifWidget::decodeMetadata (this=0xdbd9a0)
    at /b/dktemp/digikam-master/core/libs/widgets/metadata/exifwidget.cpp:114
#5  0x00007ffff69a4f35 in Digikam::MetadataWidget::setMetadata (this=0xdbd9a0, data=...)
    at /b/dktemp/digikam-master/core/libs/widgets/metadata/metadatawidget.cpp:254
#6  0x00007ffff6a02e43 in Digikam::ImagePropertiesMetaDataTab::setCurrentURL (this=this@entry=0xdbdee0, url=...)
    at /b/dktemp/digikam-master/core/libs/imageproperties/imagepropertiesmetadatatab.cpp:192
#7  0x00007ffff7644083 in Digikam::ImagePropertiesSideBarDB::slotChangedTab (this=this@entry=0xd77ab0, tab=0xdbdee0)
    at /b/dktemp/digikam-master/core/libs/imageproperties/imagepropertiessidebardb.cpp:288
#8  0x00007ffff764176e in Digikam::ImagePropertiesSideBarDB::itemChanged (this=this@entry=0xd77ab0, infos=..., rect=...,
---Type <return> to continue, or q <return> to quit---
    img=img@entry=0x0, history=...) at /b/dktemp/digikam-master/core/libs/imageproperties/imagepropertiessidebardb.cpp:199
#9  0x00007ffff7641822 in Digikam::ImagePropertiesSideBarDB::itemChanged (this=0xd77ab0, infos=...)
    at /b/dktemp/digikam-master/core/libs/imageproperties/imagepropertiessidebardb.cpp:175
#10 0x00007ffff7605fc8 in Digikam::DigikamView::slotDispatchImageSelected (this=0xa5a1e0)
    at /b/dktemp/digikam-master/core/app/views/digikamview.cpp:1410
#11 0x00007ffff761b933 in Digikam::DigikamView::qt_static_metacall (_o=0xa5a1e0, _c=<optimized out>, _id=<optimized out>,
    _a=<optimized out>) at /b/dktemp/digikam-master/build/core/app/moc_digikamview.cpp:656
#12 0x000000306c8af146 in QMetaObject::activate(QObject*, int, int, void**) () from /tmp/.mount_PrSY0I/usr/lib/libQt5Core.so.5
#13 0x000000306c8bc8e8 in QTimer::timerEvent(QTimerEvent*) () from /tmp/.mount_PrSY0I/usr/lib/libQt5Core.so.5
#14 0x000000306c8b075b in QObject::event(QEvent*) () from /tmp/.mount_PrSY0I/usr/lib/libQt5Core.so.5
#15 0x00007fffef94623c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /tmp/.mount_PrSY0I/usr/lib/libQt5Widgets.so.5
#16 0x00007fffef94d148 in QApplication::notify(QObject*, QEvent*) () from /tmp/.mount_PrSY0I/usr/lib/libQt5Widgets.so.5
#17 0x000000306c887ad0 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /tmp/.mount_PrSY0I/usr/lib/libQt5Core.so.5
#18 0x000000306c8d44de in QTimerInfoList::activateTimers() () from /tmp/.mount_PrSY0I/usr/lib/libQt5Core.so.5
#19 0x000000306c8d4a19 in ?? () from /tmp/.mount_PrSY0I/usr/lib/libQt5Core.so.5
---Type <return> to continue, or q <return> to quit---
#20 0x00007fffed2041a7 in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#21 0x00007fffed204400 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#22 0x00007fffed2044ac in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#23 0x000000306c8d5547 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /tmp/.mount_PrSY0I/usr/lib/libQt5Core.so.5
#24 0x000000306c885dba in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /tmp/.mount_PrSY0I/usr/lib/libQt5Core.so.5
#25 0x000000306c88db9d in QCoreApplication::exec() () from /tmp/.mount_PrSY0I/usr/lib/libQt5Core.so.5
#26 0x0000000000404e74 in main (argc=1, argv=<optimized out>) at /b/dktemp/digikam-master/core/app/main/main.cpp:237
(gdb) q
Comment 1 caulier.gilles 2017-01-11 19:02:59 UTC
The crash appear in Exiv2 when metadata viewer is visible. This problem is also reproducible with Showfoto with Exiv2 0.26
Comment 2 caulier.gilles 2017-01-14 12:47:30 UTC
Under Mageia6, with Exiv2 0.26-svn, compiled as with CentOS6 with same options, the crash is not reproducible.

AppImage crash. I will try to recompile whole AppImage from scratch to see if result is better. Perhaps it still a mix between Exiv2 0.25 and 0.26 on CentOS.

Gilles
Comment 3 caulier.gilles 2017-01-14 15:19:31 UTC
The exif tag relevant of the crash is "Exif.Pentax.ShutterCount" from makernote.

It crash here :

for (Exiv2::ExifData::const_iterator md = exifData.begin(); md != exifData.end(); ++md)
        {
            QString key = QString::fromLatin1(md->key().c_str());

            QString tagValue;

            std::ostringstream os;
            os << *md;               <<< HERE

            tagValue = QString::fromLocal8Bit(os.str().c_str());
        }
    }
Comment 4 caulier.gilles 2017-01-14 15:21:58 UTC
Exiv2 CLI tool do not crash to show this tags value :

exiv2 -pv IMGP0249BS.jpg
...
0x005d Pentax       ShutterCount                Long        1  1859530736
...
Comment 5 caulier.gilles 2017-01-14 16:31:02 UTC
Git commit ad16da5e750fe012058efd30b1f4a8ab4d60398b by Gilles Caulier.
Committed on 14/01/2017 at 16:22.
Pushed by cgilles into branch 'master'.

fix crash when we populate Exif tags from Pentax makernotes ShutterCount.
This only occurs with Exiv2 0.26, not 0.25.
Change to use operator
   std::ostringstream << &Exiv2::ExifData::const_iterator
by
   Exiv2::ExifData::const_iterator->write(std::ostringstream, &Exiv2::ExifData)
as Exiv2::actions.cpp do to print Exif tags values.
Exerywhere, use Exiv2 metadata container const iterator when we use iterator in read only.
FIXED-IN: 5.5.0

M  +2    -1    NEWS
M  +11   -11   libs/dmetadata/metaengine_exif.cpp
M  +4    -4    libs/dmetadata/metaengine_gps.cpp
M  +29   -29   libs/dmetadata/metaengine_image.cpp
M  +12   -12   libs/dmetadata/metaengine_iptc.cpp
M  +2    -2    libs/dmetadata/metaengine_p.cpp
M  +9    -9    libs/dmetadata/metaengine_xmp.cpp

https://commits.kde.org/digikam/ad16da5e750fe012058efd30b1f4a8ab4d60398b
Comment 6 caulier.gilles 2017-01-14 18:02:11 UTC
Wolfgang,

A new DK pre-5.5.0 AppImage 64 bits is just uploaded at usual place :

https://drive.google.com/drive/folders/0BzeiVr-byqt5Y0tIRWVWelRJenM

Let's me hear if problem is now fixed. Here i cannot reproduce it.

Gilles
Comment 7 Barbara Scheffner 2017-01-15 12:28:02 UTC
5.5.0 works fine here. Tested with that same image and a few others.

Wolfgang


Am 14.01.2017 um 18:02 schrieb bugzilla_noreply@kde.org:
> https://bugs.kde.org/show_bug.cgi?id=374922
>
> --- Comment #6 from caulier.gilles@gmail.com ---
> Wolfgang,
>
> A new DK pre-5.5.0 AppImage 64 bits is just uploaded at usual place :
>
> https://drive.google.com/drive/folders/0BzeiVr-byqt5Y0tIRWVWelRJenM
>
> Let's me hear if problem is now fixed. Here i cannot reproduce it.
>
> Gilles
>