Bug 178839 - digikam crashes on exiv2 error
Summary: digikam crashes on exiv2 error
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Metadata-Engine (show other bugs)
Version: 0.10.0
Platform: Ubuntu Linux
: NOR crash
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-12-26 21:58 UTC by Rob Visser
Modified: 2021-05-04 10:16 UTC (History)
2 users (show)

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 Rob Visser 2008-12-26 21:58:28 UTC
Version:           digikam 0.10 (using KDE 4.1.2)
OS:                Linux
Installed from:    Ubuntu Packages

Hello

digikam 0.10 crashes on the presence of a .NEF (raw Nikon file) which returns the following error(s) from exiv2 (0.18):

rob@visser:~/Pictures/NEF_test$ exiv2 DSC_3584.NEF 
Error: Directory SubImage1: Next pointer is out of bounds; ignored.
Error: Directory SubImage2: Next pointer is out of bounds; ignored.
File name       : DSC_3584.NEF
File size       : 6336659 Bytes
MIME type       : image/tiff
Image size      : 160 x 120
Camera make     : NIKON CORPORATION
Camera model    : NIKON D70
Image timestamp : 2006:12:18 18:35:13
Image number    : 
Exposure time   : 1/15 s
Aperture        : F4
Exposure bias   : 0
Flash           : No flash
Flash bias      : 
Focal length    : 26.0 mm (35 mm equivalent: 39.0 mm)
Subject distance: 
ISO speed       : 1600
Exposure mode   : Auto
Metering mode   : Multi-segment
Macro mode      : 
Image quality   : RAW    
Exif Resolution : 160 x 120
White balance   : AUTO        
Thumbnail       : None
Copyright       : 
Exif comment    :                                     




The crash dump of digikam 0.10 is as follows:

Application: digiKam (digikam), signal SIGSEGV
[Thread debugging using libthread_db enabled]
[New Thread 0xb4e2a6c0 (LWP 8027)]
[New Thread 0xb388cb90 (LWP 8028)]
[KCrash handler]
#6  0x00000000 in ?? ()
#7  0xb4f74c12 in Exiv2::ExifTags::tagInfo () from /usr/lib/libexiv2.so.4
#8  0xb4f7ccf5 in Exiv2::ExifTags::tagName () from /usr/lib/libexiv2.so.4
#9  0xb4f7d347 in Exiv2::ExifKey::makeKey () from /usr/lib/libexiv2.so.4
#10 0xb4f7d91d in Exiv2::ExifKey::ExifKey () from /usr/lib/libexiv2.so.4
#11 0xb4f8ab5c in Exiv2::TiffMetadataDecoder::decodeStdTiffEntry ()
   from /usr/lib/libexiv2.so.4
#12 0xb4f87711 in Exiv2::TiffMetadataDecoder::decodeTiffEntry ()
   from /usr/lib/libexiv2.so.4
#13 0xb4f87934 in Exiv2::TiffMetadataDecoder::visitEntry ()
   from /usr/lib/libexiv2.so.4
#14 0xb4f81ec8 in Exiv2::TiffEntry::doAccept () from /usr/lib/libexiv2.so.4
#15 0xb4f81ea7 in Exiv2::TiffComponent::accept () from /usr/lib/libexiv2.so.4
#16 0xb4f81f5e in Exiv2::TiffDirectory::doAccept ()
   from /usr/lib/libexiv2.so.4
#17 0xb4f81ea7 in Exiv2::TiffComponent::accept () from /usr/lib/libexiv2.so.4
#18 0xb4f82006 in Exiv2::TiffSubIfd::doAccept () from /usr/lib/libexiv2.so.4
#19 0xb4f81ea7 in Exiv2::TiffComponent::accept () from /usr/lib/libexiv2.so.4
#20 0xb4f81f5e in Exiv2::TiffDirectory::doAccept ()
   from /usr/lib/libexiv2.so.4
#21 0xb4f81ea7 in Exiv2::TiffComponent::accept () from /usr/lib/libexiv2.so.4
#22 0xb4f85fa9 in Exiv2::TiffParser::decode () from /usr/lib/libexiv2.so.4
#23 0xb4f847d6 in Exiv2::TiffImage::readMetadata ()
   from /usr/lib/libexiv2.so.4
#24 0xb569059d in KExiv2Iface::KExiv2::load (this=0xb388bfbc, 
    filePath=@0xb388bf58)
    at /home/rob/down/svn/kdegraphics/libs/libkexiv2/libkexiv2/kexiv2.cpp:257
#25 0xb7c3bcf0 in Digikam::DMetadata::load (this=0xb388bfbc, 
    filePath=@0xb388bf58)
    at /home/rob/down/svn/graphics/digikam/libs/dmetadata/dmetadata.cpp:76
#26 0xb7e99183 in Digikam::ImageScanner::loadFromDisk (this=0xb388bfb4)
    at /home/rob/down/svn/graphics/digikam/libs/database/imagescanner.cpp:513
#27 0xb7e9d077 in Digikam::ImageScanner::newFile (this=0xb388bfb4, 
    albumId=338)
    at /home/rob/down/svn/graphics/digikam/libs/database/imagescanner.cpp:89
#28 0xb7e8f843 in Digikam::CollectionScanner::scanNewFile (this=0xb388c368, 
    info=@0x86df944, albumId=338)
    at /home/rob/down/svn/graphics/digikam/libs/database/collectionscanner.cpp:557
#29 0xb7e921ac in Digikam::CollectionScanner::scanAlbum (this=0xb388c368, 
    location=@0x85ebb18, album=@0xb388c19c)
    at /home/rob/down/svn/graphics/digikam/libs/database/collectionscanner.cpp:510
#30 0xb7e924bb in Digikam::CollectionScanner::scanAlbum (this=0xb388c368, 
    location=@0x85ebb18, album=@0xb388c2a4)
    at /home/rob/down/svn/graphics/digikam/libs/database/collectionscanner.cpp:521
#31 0xb7e92a00 in Digikam::CollectionScanner::scanAlbumRoot (this=0xb388c368, 
    location=@0x85ebb18)
    at /home/rob/down/svn/graphics/digikam/libs/database/collectionscanner.cpp:314
#32 0xb7e932da in Digikam::CollectionScanner::completeScan (this=0xb388c368)
    at /home/rob/down/svn/graphics/digikam/libs/database/collectionscanner.cpp:191
#33 0x082b6855 in Digikam::ScanController::run (this=0x843df70)
    at /home/rob/down/svn/graphics/digikam/digikam/scancontroller.cpp:366
#34 0xb6f8f6ae in ?? () from /usr/lib/libQtCore.so.4
#35 0xb579250f in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
#36 0xb54c87ee in clone () from /lib/tls/i686/cmov/libc.so.6

Thread 1 (Thread 0xb4e2a6c0 (LWP 8027)):
#0  0xb7feb410 in __kernel_vsyscall ()
#1  0xb5796075 in pthread_cond_wait@@GLIBC_2.3.2 ()
   from /lib/tls/i686/cmov/libpthread.so.0
#2  0xb6f906f2 in QWaitCondition::wait () from /usr/lib/libQtCore.so.4
#3  0xb6f8f853 in QThread::wait () from /usr/lib/libQtCore.so.4
#4  0x082b59b8 in Digikam::ScanController::shutDown (this=0x843df70)
    at /home/rob/down/svn/graphics/digikam/digikam/scancontroller.cpp:226
#5  0x082b5b20 in ~ScanController (this=0x843df70)
    at /home/rob/down/svn/graphics/digikam/digikam/scancontroller.cpp:209
#6  0x082b7f4d in ~ScanControllerCreator (this=0x843df70)
    at /home/rob/down/svn/graphics/digikam/digikam/scancontroller.cpp:163
#7  0x082b5c47 in destroy ()
    at /home/rob/down/svn/graphics/digikam/digikam/scancontroller.cpp:164
#8  0x0822bb05 in ~KCleanUpGlobalStatic (this=0x838bfe8)
    at /usr/include/kglobal.h:67
#9  0xb5415d69 in exit () from /lib/tls/i686/cmov/libc.so.6
#10 0xb596ad2b in ?? () from /usr/lib/libQtGui.so.4
#11 0xb775c4da in KApplication::xioErrhandler () from /usr/lib/libkdeui.so.5
#12 0xb775c516 in ?? () from /usr/lib/libkdeui.so.5
#13 0xb689d062 in _XIOError () from /usr/lib/libX11.so.6
#14 0xb68a5135 in ?? () from /usr/lib/libX11.so.6
#15 0xb68a5985 in _XEventsQueued () from /usr/lib/libX11.so.6
#16 0xb688d90f in XEventsQueued () from /usr/lib/libX11.so.6
#17 0xb59a506d in ?? () from /usr/lib/libQtGui.so.4
#18 0xb521c308 in g_main_context_check () from /usr/lib/libglib-2.0.so.0
#19 0xb521cc8d in ?? () from /usr/lib/libglib-2.0.so.0
#20 0xb521cf61 in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#21 0xb70aa497 in QEventDispatcherGlib::processEvents ()
   from /usr/lib/libQtCore.so.4
#22 0xb59a4ea5 in ?? () from /usr/lib/libQtGui.so.4
#23 0xb707e52a in QEventLoop::processEvents () from /usr/lib/libQtCore.so.4
#24 0xb707e6ea in QEventLoop::exec () from /usr/lib/libQtCore.so.4
#25 0x082b57e6 in Digikam::ScanController::completeCollectionScan (
    this=0x843df70, splash=0x85e8f68)
    at /home/rob/down/svn/graphics/digikam/digikam/scancontroller.cpp:288
#26 0x0826b655 in DigikamApp (this=0x85ffad8)
    at /home/rob/down/svn/graphics/digikam/digikam/digikamapp.cpp:161
#27 0x082a6465 in main (argc=4, argv=0xbfa20534)
    at /home/rob/down/svn/graphics/digikam/digikam/main.cpp:162
#0  0xb7feb410 in __kernel_vsyscall ()

Regards,
Rob Visser
Comment 1 caulier.gilles 2008-12-26 22:16:38 UTC
Rob,

I CC Andreas Huggel who is Exiv2 author. I recommend you to send to him a copy of your NEF file which crash digiKam, for future investiguations.

Also, can you reproduce the crash using Exiv2 command line tool when you parse NEF file ?

Thanks in advance for your help.

Gilles Caulier
Comment 2 Andreas Huggel 2008-12-27 05:33:43 UTC
Hi Rob, Gilles,

Thanks, I have received the picture, haven't looked at it yet.

This doesn't look right though. Are you sure digikam also uses version 0.18 of Exiv2? And are you sure the picture which you used with the command line utility is the one that crashes digiKam? Because
- digiKam crashes somewhere inside of Exiv2::TiffImage::readMetadata
- The exiv2 command line utility doesn't crash - but it uses the same call to readMetadata...

Try this:

1) Ignore all errors and warnings from the exiv2 command line utility which don't crash it. (They are trying to say that the structure of the image is somehow incorrect/unexpected. But Exiv2 works around these problems and for digiKam they are transparent.)
2) Run exiv2 -v * over all your files to see if any of them crashes the application
3) Gilles, can you advise how to check which version of Exiv2 digiKam is using?

Andreas
Comment 3 caulier.gilles 2008-12-27 09:29:30 UTC
Thanks Andreas,

Rob, about point 3, go to Help/About menu and look in dialog which Exiv2 library is used.

Gilles Caulier
Comment 4 Andreas Huggel 2008-12-28 13:21:25 UTC
On Sat, Dec 27, 2008 at 8:46 PM, Rob Visser wrote:
> Hi Gilles,
>
> Is this what you want to know? I see a suspicious 0.17 at LibExiv2:
>
> digiKam version 0.10.0-beta7 (rev.: 893008)
> Exiv2 can write to Jp2: No
> Exiv2 can write to Jpeg: Yes
> Exiv2 can write to Png: No
> Exiv2 can write to Tiff: No
> Exiv2 support XMP metadata: Yes
> LibCImg: 129
> LibExiv2: 0.17
> LibJPEG: 62
> LibJasper: 1.900.1
> LibKDE: 4.1.3 (KDE 4.1.3)
> LibKExiv2: 0.5.0
> LibKdcraw: 0.4.0
> LibLCMS: 116
> LibPNG: 1.2.27
> LibQt: 4.4.3
> LibRaw: 0.6.2-Release
> LibTIFF: LIBTIFF, Version 3.8.2 Copyright (c) 1988-1996 Sam Leffler Copyright (c) 1991-1996 Silicon Graphics, Inc.
> LibGphoto2: 2.4.2
> LibKipi: 0.3.0
>
> The problem probably is that there are 2 versions on exiv2 in my computer:
> find . -name exiv2
>
> ./usr/bin/exiv2     -> 0.17
> ./usr/local/bin/exiv2 -> 0.18
>
> The latter is in my $PATH
> I removed the first and made a symlink :
> root@visser:/usr/bin# ls -l exiv2
> lrwxrwxrwx 1 root root 20 2008-12-27 13:39 exiv2 -> /usr/local/bin/exiv2
>
> digikam still crashes on the presence of this single NEF file. Also the reported version of LibExiv2: 0.17 remains the same ??????
>

Hi Rob,

Yes that version 0.17 looks suspicious. Since it is in the /usr directory, it may be from your distribution. If that's the case, then the proper way to remove it is through the package management tool of your distribution. Either way, you need to remove the library, not only the command line tool: make sure there are no more files libexiv2.* in the /usr/lib directory. Then try digiKam again. I'd be surprised if it still crashes.

Regards,
Andreas
Comment 5 Rob Visser 2008-12-28 15:46:59 UTC
Hello,

I removed the 0.17 shared libraries, Re-compiled digikam and it works now ok.

Thanks for the help

Rob Visser
Comment 6 caulier.gilles 2021-05-04 10:16:47 UTC
Not reproducible with digiKam 7.3.0 and Exiv2 0.27.4