Bug 186837 - libexiv2 crashes on certain JPGs
Summary: libexiv2 crashes on certain JPGs
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Metadata-Engine (show other bugs)
Version: 0.10.0
Platform: Gentoo Packages Linux
: NOR crash
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-03-11 08:38 UTC by Mahmoud Hashemi
Modified: 2021-05-04 10:16 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 7.3.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mahmoud Hashemi 2009-03-11 08:38:47 UTC
Version:           0.10.0-rc2 (using KDE 4.2.1)
Compiler:          gcc 3.1.2 x86_64 
OS:                Linux
Installed from:    Gentoo Packages

This bug seems similar to a few of the ones marked as resolved, but bear with me. Basically, an exiv2 call when importing an image seems to crash digikam. When running the exiv2 command line utility, it works without error. There's nothing remarkable about the JPGs, except perhaps that it was taken with an older digital camera.

Here is the backtrace. Like I said, it probably looks familiar:

Application: digiKam (digikam), signal SIGABRT
   from /lib/libpthread.so.0
[Current thread is 0 (LWP 4846)]

Thread 9 (Thread 0x2ab565ac6950 (LWP 4847)):
[KCrash Handler]
#5  0x00002ab557a7b205 in raise () from /lib/libc.so.6
#6  0x00002ab557a7c57e in abort () from /lib/libc.so.6
#7  0x00002ab557a7462f in __assert_fail () from /lib/libc.so.6
#8  0x00002ab559d00ce3 in ?? () from /usr/lib64/libexiv2.so.5
#9  0x00002ab559d00ea5 in ?? () from /usr/lib64/libexiv2.so.5
#10 0x00002ab559d047e6 in ?? () from /usr/lib64/libexiv2.so.5
#11 0x00002ab559d02a64 in ?? () from /usr/lib64/libexiv2.so.5
#12 0x00002ab559d013c0 in ?? () from /usr/lib64/libexiv2.so.5
#13 0x00002ab559d04918 in ?? () from /usr/lib64/libexiv2.so.5
#14 0x00002ab559d07c7b in ?? () from /usr/lib64/libexiv2.so.5
#15 0x00002ab559d07e03 in Exiv2::TiffParser::encode () from /usr/lib64/libexiv2.so.5
#16 0x00002ab559cae592 in Exiv2::ExifParser::encode () from /usr/lib64/libexiv2.so.5
#17 0x00002ab552b5a77b in KExiv2Iface::KExiv2::getExif () from /usr/lib64/libkexiv2.so.7
#18 0x00002ab5542cd0e8 in Digikam::ImageScanner::loadFromDisk () from /usr/lib64/libdigikamdatabase.so.1
#19 0x00002ab5542d43c8 in Digikam::ImageScanner::newFile () from /usr/lib64/libdigikamdatabase.so.1
#20 0x00002ab5542c78ad in Digikam::CollectionScanner::scanNewFile () from /usr/lib64/libdigikamdatabase.so.1
#21 0x00002ab5542c9129 in Digikam::CollectionScanner::scanAlbum () from /usr/lib64/libdigikamdatabase.so.1
#22 0x00002ab5542ca4dc in Digikam::CollectionScanner::partialScan () from /usr/lib64/libdigikamdatabase.so.1
#23 0x00002ab5542ca758 in Digikam::CollectionScanner::partialScan () from /usr/lib64/libdigikamdatabase.so.1
#24 0x0000000000644c5b in ?? ()
#25 0x00002ab555cc1d00 in ?? () from /usr/lib64/qt4/libQtCore.so.4
#26 0x00002ab556097097 in start_thread () from /lib/libpthread.so.0
#27 0x00002ab557b1077d in clone () from /lib/libc.so.6
#28 0x0000000000000000 in ?? ()

(and some unrelated threads)
============================
Running exiv2 (0.18) yields:

File name       : unl0805_1.jpg                                                                                  
File size       : 60409 Bytes                                                                                    
MIME type       : image/jpeg                                                                                     
Image size      : 480 x 640                                                                                      
Camera make     : Hewlett-Packard                                                                                
Camera model    : Photosmart M407                                                                                
Image timestamp : 2005:08:16 09:09:00                                                                            
Image number    :
Exposure time   : 1/90 s
Aperture        : F2.9
Exposure bias   : 0
Flash           : No, auto
Flash bias      :
Focal length    : 6.2 mm
Subject distance: 5.00 m
ISO speed       : 200
Exposure mode   : Auto
Metering mode   : Average
Macro mode      :
Image quality   :
Exif Resolution : 480 x 640
White balance   :
Thumbnail       : image/jpeg, 4073 Bytes
Copyright       : Copyright 2003-2004
Exif comment    :

===========================

Perhaps most importantly, here is a file with which you can reproduce the error.

1) Download http://makuro.org/~makuro/unl0805_1.jpg
2) Drag and drop it into an album/folder monitored by digikam.
3) If your digikam is like mine, it will close almost immediately with a SIGABRT
4) removing or chmod 000ing the file will allow your digikam to open again.


As far as I can tell, I'm running the latest releases of all software involved. Please let me know if there's any additional info I can provide.

Thanks,

Mahmoud
Comment 1 caulier.gilles 2009-03-11 09:11:05 UTC
Mahmoud,

With test file, when you run Exiv2 command line tool to write something in metadata, there is a crash ?

Andreas, what do you think about ?

I remember something similar already reported here. Right ?

Gilles Caulier
Comment 2 Mahmoud Hashemi 2009-03-11 09:19:06 UTC
Running:

exiv2 -M "set Exif.Photo.UserComment charset=Ascii My favorite photo" unl0805_1.jpg

got me:

exiv2: tiffcomposite.cpp:697: virtual uint32_t Exiv2::Internal::TiffMnEntry::doCount() const: Assertion `tiffType() == ttUndefined' failed.

So, yes, that looks like an exiv2 crash.
Comment 3 caulier.gilles 2009-03-11 09:26:39 UTC
So, it's sound like Exiv2 bug, not digiKam. 

Andreas is Exiv2 lead developper. We can let's open this file and solve this issue in this room instead to open new bug in Exiv2 bugzilla. it's not a problem.

I let Andreas manage this entry.

Gilles Caulier
Comment 4 Mahmoud Hashemi 2009-03-11 09:31:08 UTC
ok, that sounds good. I'm running gcc 4.1.2, not 3.1.2.

Also, is there any need or plan for more robust handling of this type of exception within digikam?
Comment 5 caulier.gilles 2009-03-11 09:35:26 UTC
It's a crash in exiv2 core.

digiKam use libkexiv2 to catch Exiv2 c++ exception. In this case, it sound like a check are missing in Exiv2 to prevent crash and generate exception instead.

Gilles
Comment 6 Andreas Huggel 2009-03-11 11:10:47 UTC
The exiv2 crash in comment #2 is the same as that in http://dev.exiv2.org/issues/show/615 so yes, I believe this is fixed in exiv2 SVN and this bug is a duplicate of bug #182738.

Mahmoud,
To test, you can upgrade to exiv2 from SVN as described here http://www.exiv2.org/download.html#devel

Andreas
Comment 7 caulier.gilles 2009-03-15 20:42:38 UTC
Mahmoud,

What news here. Please check and report to close this file.

Thanks in advance

Gilles Caulier
Comment 8 Mahmoud Hashemi 2009-03-16 05:03:53 UTC
This bug seems to be fixed in the SVN version of exiv2. I'm not sure what the exact status should be, but I'll mark it as fixed. Thanks for all your help!
Comment 9 caulier.gilles 2021-05-04 10:16:45 UTC
Not reproducible with digiKam 7.3.0 and Exiv2 0.27.4