Bug 375809 - digiKam froze on opening Settings
Summary: digiKam froze on opening Settings
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Setup-Metadata (show other bugs)
Version: 5.5.0
Platform: Other Linux
: NOR crash
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-01-31 17:52 UTC by Andrius
Modified: 2020-08-31 03:12 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 7.1.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrius 2017-01-31 17:52:59 UTC
digikam 5.5 froze on opening Settings. It crash in exiv2 shared lib when Exif metadata viewer settings is populated with tags to filters.

--
Thread 1 "digikam" hit Catchpoint 1 (exception thrown), 0x00007fffebe788bd in 
__cxa_throw () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
(gdb) bt
#0  0x00007fffebe788bd in __cxa_throw () from /usr/lib/x86_64-linux-gnu/
libstdc++.so.6
#1  0x00007ffff5e43b02 in Exiv2::ExifKey::ExifKey (this=<optimized out>, 
ti=...) at /b/ext_exiv2/ext_exiv2-prefix/src/ext_exiv2/src/tags.cpp:3157
#2  0x00007ffff682aea0 in Digikam::MetaEngine::getStdExifTagsList 
(this=this@entry=0x7fffffffb100)
    at /b/dktemp/digikam-master/core/libs/dmetadata/metaengine_exif.cpp:1087
#3  0x00007ffff69a36c4 in Digikam::MetadataPanel::slotTabChanged 
(this=this@entry=0x3b65d40)
    at /b/dktemp/digikam-master/core/libs/widgets/metadata/metadatapanel.cpp:
311
#4  0x00007ffff69a402d in Digikam::MetadataPanel::MetadataPanel 
(this=0x3b65d40, tab=0x3b66970)
    at /b/dktemp/digikam-master/core/libs/widgets/metadata/metadatapanel.cpp:
232
#5  0x00007ffff768a70a in Digikam::SetupMetadata::SetupMetadata 
(this=0x3b30ee0, parent=<optimized out>)
    at /b/dktemp/digikam-master/core/utilities/setup/metadata/
setupmetadata.cpp:463
#6  0x00007ffff766294a in Digikam::Setup::Setup (this=this@entry=0x3a1f520, 
parent=parent@entry=0x84ee70)
    at /b/dktemp/digikam-master/core/utilities/setup/setup.cpp:186
#7  0x00007ffff7664725 in Digikam::Setup::execDialog (parent=0x84ee70, 
page=Digikam::Setup::LastPageUsed)
    at /b/dktemp/digikam-master/core/utilities/setup/setup.cpp:362
#8  0x00007ffff7615d44 in Digikam::DigikamApp::qt_static_metacall 
(_o=0x84ee70, _c=<optimized out>, _id=<optimized out>, _a=<optimized out>)
    at /b/dktemp/digikam-master/build/core/app/moc_digikamapp.cpp:359
#9  0x00000031e04af846 in QMetaObject::activate(QObject*, int, int, void**) () 
from /tmp/.mount_vVX2pQ/usr/lib/libQt5Core.so.5
#10 0x00007fffee338ba2 in QAction::triggered(bool) () from /tmp/.mount_vVX2pQ/
usr/lib/libQt5Widgets.so.5
#11 0x00007fffee33b57d in QAction::activate(QAction::ActionEvent) () from /
tmp/.mount_vVX2pQ/usr/lib/libQt5Widgets.so.5
#12 0x00007fffee4a3002 in ?? () from /tmp/.mount_vVX2pQ/usr/lib/
libQt5Widgets.so.5
#13 0x00007fffee4a9244 in ?? () from /tmp/.mount_vVX2pQ/usr/lib/
libQt5Widgets.so.5
#14 0x00007fffee4aa196 in QMenu::mouseReleaseEvent(QMouseEvent*) () from /
tmp/.mount_vVX2pQ/usr/lib/libQt5Widgets.so.5
#15 0x00007fffee3857c8 in QWidget::event(QEvent*) () from /tmp/.mount_vVX2pQ/
usr/lib/libQt5Widgets.so.5
#16 0x00007fffee4ac42b in QMenu::event(QEvent*) () from /tmp/.mount_vVX2pQ/
usr/lib/libQt5Widgets.so.5
#17 0x00007fffee33f8fc in QApplicationPrivate::notify_helper(QObject*, 
QEvent*) () from /tmp/.mount_vVX2pQ/usr/lib/libQt5Widgets.so.5
#18 0x00007fffee3470db in QApplication::notify(QObject*, QEvent*) () from /
tmp/.mount_vVX2pQ/usr/lib/libQt5Widgets.so.5
#19 0x00000031e04880f0 in QCoreApplication::notifyInternal2(QObject*, QEvent*) 
() from /tmp/.mount_vVX2pQ/usr/lib/libQt5Core.so.5
#20 0x00007fffee345dce in QApplicationPrivate::sendMouseEvent(QWidget*, 
QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) ()
   from /tmp/.mount_vVX2pQ/usr/lib/libQt5Widgets.so.5
#21 0x00007fffee3a1135 in ?? () from /tmp/.mount_vVX2pQ/usr/lib/
libQt5Widgets.so.5
#22 0x00007fffee3a39e3 in ?? () from /tmp/.mount_vVX2pQ/usr/lib/
libQt5Widgets.so.5
#23 0x00007fffee33f8fc in QApplicationPrivate::notify_helper(QObject*, 
QEvent*) () from /tmp/.mount_vVX2pQ/usr/lib/libQt5Widgets.so.5
#24 0x00007fffee346808 in QApplication::notify(QObject*, QEvent*) () from /
tmp/.mount_vVX2pQ/usr/lib/libQt5Widgets.so.5
#25 0x00000031e04880f0 in QCoreApplication::notifyInternal2(QObject*, QEvent*) 
() from /tmp/.mount_vVX2pQ/usr/lib/libQt5Core.so.5
#26 0x00007fffedd6a4ad in 
QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) 
() from /tmp/.mount_vVX2pQ/usr/lib/libQt5Gui.so.5
#27 0x00007fffedd6c1c5 in 
QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) 
()
   from /tmp/.mount_vVX2pQ/usr/lib/libQt5Gui.so.5
#28 0x00007fffedd4d023 in 
QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) 
() from /tmp/.mount_vVX2pQ/usr/lib/libQt5Gui.so.5
#29 0x00007fffe4d62f30 in ?? () from /tmp/.mount_vVX2pQ/usr/lib/
libQt5XcbQpa.so.5
#30 0x00007fffea9c5197 in g_main_context_dispatch () from /lib/x86_64-linux-
gnu/libglib-2.0.so.0
#31 0x00007fffea9c53f0 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
---Type <return> to continue, or q <return> to quit---
#32 0x00007fffea9c549c in g_main_context_iteration () from /lib/x86_64-linux-
gnu/libglib-2.0.so.0
#33 0x00000031e04d5d87 in 
QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () 
from /tmp/.mount_vVX2pQ/usr/lib/libQt5Core.so.5
#34 0x00000031e04863da in 
QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /
tmp/.mount_vVX2pQ/usr/lib/libQt5Core.so.5
#35 0x00000031e048e1bd in QCoreApplication::exec() () from /tmp/.mount_vVX2pQ/
usr/lib/libQt5Core.so.5
#36 0x0000000000405054 in main (argc=1, argv=<optimized out>) at /b/dktemp/
digikam-master/core/app/main/main.cpp:240
(gdb)
Comment 1 caulier.gilles 2017-01-31 19:07:23 UTC
Git commit d93eb848855e1d81f9c994a1414482f0bef0b47e by Gilles Caulier.
Committed on 31/01/2017 at 19:06.
Pushed by cgilles into branch 'master'.

try to fix crash while parsing Exif std tags list to populate Exif viewer filter from Setup dialog

M  +3    -2    libs/dmetadata/metaengine_comments.cpp
M  +21   -8    libs/dmetadata/metaengine_exif.cpp
M  +13   -12   libs/dmetadata/metaengine_gps.cpp
M  +4    -4    libs/dmetadata/metaengine_iptc.cpp
M  +4    -4    libs/dmetadata/metaengine_xmp.cpp

https://commits.kde.org/digikam/d93eb848855e1d81f9c994a1414482f0bef0b47e
Comment 2 caulier.gilles 2017-01-31 21:07:02 UTC
The new pre-version of 64 bits AppImage bundle 5.5.0 will be uploaded to GDrive in few minutes, including the last patch committed in this report.

https://docs.google.com/document/d/1YOFkqIcoopQGZVWa3wioKz5Ue22Mi68dLYsG_YB2XSo/edit?usp=sharing

Please test again with it.

Gilles Caulier
Comment 3 caulier.gilles 2017-01-31 21:09:49 UTC
Youps sorry wrong url. right one :

https://drive.google.com/drive/folders/0BzeiVr-byqt5Y0tIRWVWelRJenM
Comment 4 Maik Qualmann 2017-01-31 21:46:02 UTC
Gilles,

I have no EXIF tags listed in the Metadata tab (AppImage). Is Exiv2 broken from git? With my compiled version (still with Exiv2-0.2.5) no problems.

Maik
Comment 5 caulier.gilles 2017-01-31 22:09:06 UTC
Maik,

I confirm. I just tested under MacOS and it's reproducible. I will hack tomorow morning about this problem.

Gilles
Comment 6 caulier.gilles 2017-02-01 10:43:50 UTC
Maik,

We have a test code in digiKam core named "printtagslist" which print all Exif, Iptc, and XMP tags know by Exiv2 with description on the console. I can reproduce the dysfunction with 0.26, but not with 0.25.

2 solutions : 

1/ the bug is in Exiv2 ==> UPSTREAM
2/ the code must be adapted in dmetadata to work fine with 0.26 due to API changes (perhaps). If it's the case, why old Exiv2 API is not annotated as deprecated ?

Gilles
Comment 7 caulier.gilles 2017-02-01 12:20:47 UTC
Maik,

I cleanup Exiv2 from trunk and recompiled all.

Now the CLI test tool work as expected, but not the Setup/Metadata/View/Exif section...

I continue to investiguate

Gilles
Comment 8 caulier.gilles 2017-02-01 13:11:33 UTC
I found the problem why Exif viewer list is empty.

Exiv2 generate a C++ exception :

Thread 1 "digikam" hit Breakpoint 7, Digikam::MetaEngine::getStdExifTagsList (this=0x7fffffffaa00) at /mnt/data/5.x/core/libs/dmetadata/metaengine_exif.cpp:1106
1106	        d->printExiv2ExceptionError(QString::fromLatin1("Cannot get Exif Tags list using Exiv2 "), e);
(gdb) print e
$51 = (Exiv2::Error &) @0x558fb50: {<Exiv2::AnyError> = {<No data fields>}, code_ = 23, count_ = 1, arg1_ = "8", arg2_ = "", arg3_ = "", msg_ = "Invalid ifdId 8"}

==> Invalid ifdId 8

This is strange because the code is exactly the same with CLI tool to print all Exiv2 know tags and the error do not appear.

Gilles
Comment 9 caulier.gilles 2017-02-01 13:14:17 UTC
Arf...

The error appear well with CLI tool. It's just too much verbose :

-- Standard Exif Tags -------------------------------------------------------------
digikam.metaengine: Cannot get Exif Tags list using Exiv2   (Error # 23 :  Invalid ifdId 8
-- Makernote Tags -----------------------------------------------------------------

Gilles
Comment 10 caulier.gilles 2017-02-01 13:27:54 UTC
Maik,

I printed the tag name where the exception is generated :

digikam.metaengine: Exif tag name:  RelatedImageFileFormat
digikam.metaengine: Exif tag name:  RelatedImageWidth
digikam.metaengine: Exif tag name:  RelatedImageLength
digikam.metaengine: Exif tag name:  RelatedImageFileFormat
digikam.metaengine: Exif tag name:  RelatedImageWidth
digikam.metaengine: Exif tag name:  RelatedImageLength
digikam.metaengine: Exif tag name:  RelatedImageWidth
digikam.metaengine: Exif tag name:  RelatedImageLength
digikam.metaengine: Exif tag name:  RelatedImageLength
digikam.metaengine: Exif tag name:  MPFVersion
digikam.metaengine: Cannot get Exif Tags list using Exiv2   (Error # 23 :  Invalid ifdId 8
-- Makernote Tags -----------------------------------------------------------------

"MPFVersion" ...

Gilles
Comment 11 caulier.gilles 2017-02-01 14:01:13 UTC
The problem come from MPF Tags declared from group at Exiv2::tags.cpp::line 2166.

Typically, if i try to resume:

Exiv2::ExifKey(Exiv2::ExifData::Internal::mpfTagsList())

Generate the exception...

Gilles
Comment 12 caulier.gilles 2017-02-01 14:04:07 UTC
MPF doc :

http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/MPF.html

Gilles
Comment 13 caulier.gilles 2017-02-01 14:09:43 UTC
WildCowboy,

The problem is in Exiv2 ExifTags class. We must be able to handle MPF tags with Exiv2::ExifKey as with other Exif tag groups...

I wil fix digiKam to not handle MPF section for the moment, until Exiv2 is fixed.

Please report this problem to Exiv2 bugzilla, as UPSTREAM.

Gilles Caulier
Comment 14 caulier.gilles 2017-02-01 14:12:25 UTC
Git commit 9594cb3f9a334768aa21f827892b180ebb8c4050 by Gilles Caulier.
Committed on 01/02/2017 at 14:10.
Pushed by cgilles into branch 'master'.

With new Exiv2 0.26, MPF Exif tags group have been introduced and generate an exception if we try to handle it

M  +6    -1    libs/dmetadata/metaengine_exif.cpp

https://commits.kde.org/digikam/9594cb3f9a334768aa21f827892b180ebb8c4050
Comment 15 caulier.gilles 2017-02-01 18:45:55 UTC
wildcowboy,

New version of digiKam 5.5.0 pre-release AppImage bundle will be uploaded in few minites to GDrive. Please give me a feedback to see if crash is fixed.

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

Gilles Caulier
Comment 16 Maik Qualmann 2017-02-01 20:08:50 UTC
Yes, works here fine now.

Maik
Comment 17 caulier.gilles 2017-02-01 21:37:54 UTC
Thanks Maik...

WildCowboy,

This is very important to report this issue in Exiv2 bugzilla. There is a real bug in Exiv2 0.26-svn. My patch in DK source code is just a wrap around to prevent crash.

Gilles Caulier
Comment 18 Andrius 2017-02-06 18:00:00 UTC
Done. http://dev.exiv2.org/issues/1275

(In reply to caulier.gilles from comment #17)
> Thanks Maik...
> 
> WildCowboy,
> 
> This is very important to report this issue in Exiv2 bugzilla. There is a
> real bug in Exiv2 0.26-svn. My patch in DK source code is just a wrap around
> to prevent crash.
> 
> Gilles Caulier
Comment 19 caulier.gilles 2017-02-06 18:09:54 UTC
Thanks 

Gilles Caulier
Comment 20 Andrius 2017-02-06 18:18:05 UTC
Could you follow up, please. 
http://dev.exiv2.org/issues/1275#change-5817


(In reply to caulier.gilles from comment #19)
> Thanks 
> 
> Gilles Caulier
Comment 21 caulier.gilles 2017-02-06 19:06:47 UTC
WildCowboy,

I already resume how to reproduce the exception in comment #11.
It's possible that crash cannot be reproduced Exiv2 CLI tool if method explained in comment #11 is not used. Exiv2 team must take a look on my investigations on this report. I will not re-explain again the details.

There is no need an image to test this crash. In digiKam it's happen when code extract all avaialble Exiftags with details, descriptions, etc... for the library database.

Exiv2 tem must write a dedicated unit test code to reproduce this very simple exception case.

Gilles Caulier
Comment 22 Andrius 2017-02-08 16:56:04 UTC
Gilles,

Could you help please?
http://dev.exiv2.org/issues/1275#change-5820

(In reply to caulier.gilles from comment #21)
> WildCowboy,
> 
> I already resume how to reproduce the exception in comment #11.
> It's possible that crash cannot be reproduced Exiv2 CLI tool if method
> explained in comment #11 is not used. Exiv2 team must take a look on my
> investigations on this report. I will not re-explain again the details.
> 
> There is no need an image to test this crash. In digiKam it's happen when
> code extract all avaialble Exiftags with details, descriptions, etc... for
> the library database.
> 
> Exiv2 tem must write a dedicated unit test code to reproduce this very
> simple exception case.
> 
> Gilles Caulier
Comment 23 caulier.gilles 2017-02-09 16:12:45 UTC
Git commit 91408e9ece701961beb09461d94b1f6fdaf6a01f by Gilles Caulier.
Committed on 09/02/2017 at 15:57.
Pushed by cgilles into branch 'master'.

Exiv2 0.26-svn commit

http://dev.exiv2.org/projects/exiv2/repository/revisions/4705

fix the MPF Exif group exception

M  +1    -2    libs/dmetadata/metaengine_exif.cpp

https://commits.kde.org/digikam/91408e9ece701961beb09461d94b1f6fdaf6a01f
Comment 24 Maik Qualmann 2017-03-09 20:16:38 UTC
*** Bug 377433 has been marked as a duplicate of this bug. ***
Comment 25 caulier.gilles 2020-08-31 03:12:07 UTC
Problem is not reproducible in 7.1.0