Version: digikam-0.10.0-0.824037.2mdv2009.0 (using KDE 3.5.9) Installed from: Mandriva RPMs OS: Linux When launching digikam, it scan my pictures folder and crash when reading picture with an empty Exif.GPSInfo.GPSAltitude value. If I open the file with showfoto, showfoto crash only when I open de marble(geolocation) tab. If i try to get exif data with exiv2(0.17.1) I get: - this picture is loaded fine: [shad2@azrael Pictures]$ exiv2 -p t "IMG_6260.JPG" |grep GPS Exif.Image.GPSTag Long 1 1982 Exif.GPSInfo.GPSVersionID Byte 4 2.0.0.0 Exif.GPSInfo.GPSLatitudeRef Ascii 2 Nord Exif.GPSInfo.GPSLatitude Rational 3 43deg 17.67780' Exif.GPSInfo.GPSLongitudeRef Ascii 2 Est Exif.GPSInfo.GPSLongitude Rational 3 5deg 21.51370' Exif.GPSInfo.GPSAltitudeRef Byte 1 Au dessus du niveau de la mer Exif.GPSInfo.GPSAltitude Rational 1 41.2 m Exif.GPSInfo.GPSMapDatum Ascii 7 WGS-84 - this one make digikam or showfoto crash [shad2@azrael Pictures]$ exiv2 -p t "IMG_6264.JPG" |grep GPS Exif.Image.GPSTag Long 1 1982 Exif.GPSInfo.GPSVersionID Byte 4 2.0.0.0 Exif.GPSInfo.GPSLatitudeRef Ascii 2 Nord Exif.GPSInfo.GPSLatitude Rational 3 43deg 17.34840' Exif.GPSInfo.GPSLongitudeRef Ascii 2 Est Exif.GPSInfo.GPSLongitude Rational 3 5deg 21.29920' Exif.GPSInfo.GPSAltitudeRef Byte 1 Au dessus du niveau de la mer Exif.GPSInfo.GPSAltitude Rational 0 Exif.GPSInfo.GPSMapDatum Ascii 7 WGS-84
Can you file a gdb bactrace to see where the crash appears in source code. Thanks in advance Gilles Caulier
here what I've got: ------------------ digikam(13531): Adding item "IMG_6264.JPG" digikam(13531): "/home/shad2/Pictures/2007/2007-09 Aix-en-Provence/2007-09-04 Journée à Marseille/IMG_6264.JPG" : JPEG file identified DateTime => Exif.Photo.DateTimeOriginal => QDateTime("mar. sept. 4 12:55:27 2007") Orientation => Exif.Image.Orientation => 8 Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x40ae9950 (LWP 13535)] 0x00007ffcb589cb2c in Exiv2::ValueType<std::pair<unsigned int, unsigned int> >::toRational () from /usr/lib64/libexiv2.so.4 (gdb) backtrace #0 0x00007ffcb589cb2c in Exiv2::ValueType<std::pair<unsigned int, unsigned int> >::toRational () from /usr/lib64/libexiv2.so.4 #1 0x00007ffcb58ab51d in Exiv2::Exifdatum::toRational () from /usr/lib64/libexiv2.so.4 #2 0x00007ffcbc257784 in KExiv2Iface::KExiv2::getGPSAltitude () from /usr/lib64/libkexiv2.so.6 #3 0x00007ffcc07b1eea in Digikam::DMetadata::getMetadataField () from /usr/lib64/libdigikam.so.1 #4 0x00007ffcc07b296c in Digikam::DMetadata::getMetadataFields () from /usr/lib64/libdigikam.so.1 #5 0x00007ffcc0baf392 in Digikam::ImageScanner::scanImagePosition () from /usr/lib64/libdigikamdatabase.so.1 #6 0x00007ffcc0bb0c42 in Digikam::ImageScanner::scanFile () from /usr/lib64/libdigikamdatabase.so.1 #7 0x00007ffcc0ba70c6 in Digikam::CollectionScanner::scanAlbum () from /usr/lib64/libdigikamdatabase.so.1 #8 0x00007ffcc0ba6ef1 in Digikam::CollectionScanner::scanAlbum () from /usr/lib64/libdigikamdatabase.so.1 #9 0x00007ffcc0ba6ef1 in Digikam::CollectionScanner::scanAlbum () from /usr/lib64/libdigikamdatabase.so.1 #10 0x00007ffcc0ba6ef1 in Digikam::CollectionScanner::scanAlbum () from /usr/lib64/libdigikamdatabase.so.1 #11 0x00007ffcc0ba7c27 in Digikam::CollectionScanner::scanAlbumRoot () from /usr/lib64/libdigikamdatabase.so.1 #12 0x00007ffcc0ba7e97 in Digikam::CollectionScanner::completeScan () from /usr/lib64/libdigikamdatabase.so.1 #13 0x000000000064d4ad in Digikam::ScanController::run () #14 0x00007ffcbdbca935 in ?? () from /usr/lib64/libQtCore.so.4 #15 0x00007ffcbad752a3 in start_thread () from /lib64/libpthread.so.0 #16 0x00007ffcbb2a303d in clone () from /lib64/libc.so.6
The crash appear in Exiv2. Andreas, i think Exiv2 mess an exception rule in this case. right ? Of course, something can be done in libkexiv2. Gilles Caulier
In getGPSLatitudeNumber we check for count() of the Exifdatum. The docs of toRational(int n) says the behavior is undefined if there is no n-th component. Question is if in this case count() is 0, if this is a valid situation with the Exiv2 API (maybe with broken files, but thats not the point), and if we should always check for count()
In Exiv2 a value with 0 components is considered valid. So yes, Marcel is right, digiKam needs to check count() to make sure the required component exists in the value before accessing it in that way. Andreas
SVN commit 836603 by mwiesweg: Check for count() before accessing value with toRational() BUG: 167139 M +3 -3 kexiv2gps.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=836603
I thinks there are more issues in the interaction of exiv2 0.17.1 and digikam: When i scan my library digikam crashes on almost all non-Canon or non-Nikon files plus hugin panoramas. Most errors are "invalid type 0". This is a hugin example: Error: Directory Image, entry 0x0000 has an invalid type 768; skipping entry. digikam(16280): "/home/gerhard/Fotos/Chambord.jpg" : JPEG file identified KCrash: crashing... crashRecursionCounter = 2 $ exiv2 /var/tmp/sophie/Chambord.jpg Error: Directory Canon, entry 0x0200 has an invalid type 768; skipping entry. File name : /var/tmp/sophie/Chambord.jpg File size : 882072 Bytes MIME type : image/jpeg Image size : 2888 x 1700 Camera make : Canon Camera model : Canon EOS 40D Image timestamp : 2008:04:01 13:40:03 Image number : Exposure time : 1/250 s Aperture : F11 Exposure bias : +1/3 Flash : No, compulsory Flash bias : Focal length : 10.0 mm Subject distance: ISO speed : 400 Exposure mode : Auto Metering mode : Multi-segment Macro mode : Image quality : Exif Resolution : 2888 x 1700 White balance : Thumbnail : image/jpeg, 4492 Bytes Copyright : Exif comment : Chateaux de la Loire Chambord ---------------- For comparison the same with exiftool: $ exiftool /var/tmp/sophie/Chambord.jpg ExifTool Version Number : 7.00 File Name : Chambord.jpg Directory : /var/tmp/sophie File Size : 861 kB File Modification Date/Time : 2008:04:15 11:29:34 File Type : JPEG MIME Type : image/jpeg JFIF Version : 1.1 Comment : Exif Byte Order : Big-endian (Motorola) Processing Software : digiKam-0.9.4-beta4 Document Name : Chambord.jpg Make : Canon Camera Model Name : Canon EOS 40D Orientation : Horizontal (normal) X Resolution : 72 Y Resolution : 72 Resolution Unit : inches Software : GIMP 2.4.5 Modify Date : 2008:04:14 08:24:04 Y Cb Cr Positioning : Centered Rating : 3 Rating Percent : 50 Exposure Time : 1/250 F Number : 11.0 Exposure Program : Program AE ISO : 400 Exif Version : 0221 Date/Time Original : 2008:04:01 13:40:03 Create Date : 2008:04:01 13:40:03 Components Configuration : YCbCr Shutter Speed Value : 1/256 Aperture Value : 11.3 Exposure Compensation : +1/3 Metering Mode : Multi-segment Flash : Off Focal Length : 10.0mm Warning : Unknown format (768) for MakerNotes tag 0x200 User Comment : Chateaux de la Loire.Chambord Sub Sec Time : 81 Sub Sec Time Original : 81 Sub Sec Time Digitized : 81 Flashpix Version : 0100 Color Space : sRGB Exif Image Width : 2888 Exif Image Length : 1700 Focal Plane X Resolution : 4438.356164 Focal Plane Y Resolution : 4445.969136 Focal Plane Resolution Unit : inches Custom Rendered : Normal Exposure Mode : Auto White Balance : Auto Scene Capture Type : Standard Contrast : Normal Saturation : Normal GPS Version ID : 2.0.0.0 GPS Latitude Ref : North GPS Longitude Ref : East GPS Altitude Ref : Above Sea Level GPS Altitude : 86 m Compression : JPEG (old-style) Thumbnail Offset : 1091 Thumbnail Length : 4492 Originating Program : digiKam Program Version : 0.9.4-beta4 Urgency : 4 By-line : Gerhard Kulzer By-line Title : Independent Photographer Credit : Re-Image/Gerhard Kulzer Source : Gerhard Kulzer Copyright Notice : copyright 2008 Gerhard Kulzer, all rights reserved Profile CMM Type : scrs Profile Version : 2.1.0 Profile Class : Display Device Profile Color Space Data : RGB Profile Connection Space : XYZ Profile Date Time : 2001:04:12 19:02:14 Profile File Signature : acsp Primary Platform : Microsoft Corporation CMM Flags : Not Embedded, Independent Device Manufacturer : none Device Model : none Device Attributes : Reflective, Glossy, Positive, Color Rendering Intent : Perceptual Connection Space Illuminant : 0.9642 1 0.82491 Profile Creator : scrs Profile ID : 0 Profile Description : sRGB Profile Copyright : Media White Point : 0.9642 1 0.82491 Media Black Point : 0 0 0 Red Matrix Column : 0.4124 0.21265 0.01933 Green Matrix Column : 0.35759 0.71518 0.1192 Blue Matrix Column : 0.18048 0.0722 0.95055 Red Tone Reproduction Curve : (Binary data 524 bytes, use -b option to extract) Green Tone Reproduction Curve : (Binary data 524 bytes, use -b option to extract) Blue Tone Reproduction Curve : (Binary data 524 bytes, use -b option to extract) Image Width : 2888 Image Height : 1700 Encoding Process : Baseline DCT, Huffman coding Bits Per Sample : 8 Color Components : 3 Y Cb Cr Sub Sampling : YCbCr4:2:2 (2 1) Aperture : 11.0 Flash : Off GPS Latitude : 47 deg 36' 58.02" N GPS Longitude : 1 deg 31' 0.94" E GPS Position : 47 deg 36' 58.02" N, 1 deg 31' 0.94" E Image Size : 2888x1700 Scale Factor To 35mm Equivalent : 2.3 Shutter Speed : 1/250 Thumbnail Image : (Binary data 4492 bytes, use -b option to extract) Circle Of Confusion : 0.013 mm Focal Length : 10.0mm (35mm equivalent: 22.6mm) Hyperfocal Distance : 0.68 m Light Value : 12.9 Date/Time Original : 2008:04:01 13:40:03.81 ------------------------ Backtrace: Application: digiKam (digikam), signal SIGSEGV [Thread debugging using libthread_db enabled] [New Thread 0xb4cab720 (LWP 16280)] [New Thread 0xb367cb90 (LWP 16281)] [KCrash handler] #6 0xb4ed9acc in Exiv2::Internal::TiffEntryBase::updateValue () from /usr/lib/libexiv2.so.4 #7 0xb4ee3e40 in Exiv2::Internal::TiffEncoder::encodeTiffEntryBase () from /usr/lib/libexiv2.so.4 #8 0xb4ee3feb in Exiv2::Internal::TiffEncoder::encodeTiffEntry () from /usr/lib/libexiv2.so.4 #9 0xb4ed904b in Exiv2::Internal::TiffEntry::doEncode () from /usr/lib/libexiv2.so.4 #10 0xb4ed8a3f in Exiv2::Internal::TiffEntryBase::encode () from /usr/lib/libexiv2.so.4 #11 0xb4ee4c9b in Exiv2::Internal::TiffEncoder::encodeTiffComponent () from /usr/lib/libexiv2.so.4 #12 0xb4ee501b in Exiv2::Internal::TiffEncoder::add () from /usr/lib/libexiv2.so.4 #13 0xb4ee05d8 in Exiv2::Internal::TiffParserWorker::encode () from /usr/lib/libexiv2.so.4 #14 0xb4ee079d in Exiv2::TiffParser::encode () from /usr/lib/libexiv2.so.4 #15 0xb4e930a0 in Exiv2::ExifParser::encode () from /usr/lib/libexiv2.so.4 #16 0xb56e5674 in KExiv2Iface::KExiv2::getExif (this=0xb367b828, addExifHeader=false) at /usr/include/exiv2/exif.hpp:559 #17 0xb7ef18aa in Digikam::ImageScanner::loadFromDisk (this=0xb367b820) at /home/gerhard/OSS/graphics4/digikam/libs/database/imagescanner.cpp:446 #18 0xb7ef45b9 in Digikam::ImageScanner::fullScan (this=0xb367b820) at /home/gerhard/OSS/graphics4/digikam/libs/database/imagescanner.cpp:93 #19 0xb7eecfda in Digikam::CollectionScanner::scanAlbum (this=0xb367bec4, location=@0x8539658, album=@0xb367b960) at /home/gerhard/OSS/graphics4/digikam/libs/database/collectionscanner.cpp:361 #20 0xb7eed556 in Digikam::CollectionScanner::scanAlbum (this=0xb367bec4, location=@0x8539658, album=@0xb367baa0) at /home/gerhard/OSS/graphics4/digikam/libs/database/collectionscanner.cpp:404 #21 0xb7eed556 in Digikam::CollectionScanner::scanAlbum (this=0xb367bec4, location=@0x8539658, album=@0xb367bbe0) at /home/gerhard/OSS/graphics4/digikam/libs/database/collectionscanner.cpp:404 #22 0xb7eed556 in Digikam::CollectionScanner::scanAlbum (this=0xb367bec4, location=@0x8539658, album=@0xb367bcd8) at /home/gerhard/OSS/graphics4/digikam/libs/database/collectionscanner.cpp:404 #23 0xb7eed97e in Digikam::CollectionScanner::scanAlbumRoot (this=0xb367bec4, location=@0x8539658) at /home/gerhard/OSS/graphics4/digikam/libs/database/collectionscanner.cpp:245 #24 0xb7eee022 in Digikam::CollectionScanner::completeScan (this=0xb367bec4) at /home/gerhard/OSS/graphics4/digikam/libs/database/collectionscanner.cpp:138 #25 0xb7f357c7 in Digikam::SchemaUpdater::updateV4toV5 (this=0xb367c27c) at /home/gerhard/OSS/graphics4/digikam/libs/database/schemaupdater.cpp:945 #26 0xb7f36762 in Digikam::SchemaUpdater::makeUpdates (this=0xb367c27c) at /home/gerhard/OSS/graphics4/digikam/libs/database/schemaupdater.cpp:232 #27 0xb7f370b1 in Digikam::SchemaUpdater::startUpdates (this=0xb367c27c) at /home/gerhard/OSS/graphics4/digikam/libs/database/schemaupdater.cpp:160 #28 0xb7f377da in Digikam::SchemaUpdater::update (this=0xb367c27c) at /home/gerhard/OSS/graphics4/digikam/libs/database/schemaupdater.cpp:80 #29 0xb7f0615e in Digikam::DatabaseBackend::initSchema (this=0x84a8e28, updater=0xb367c27c) at /home/gerhard/OSS/graphics4/digikam/libs/database/databasebackend.cpp:225 #30 0xb7efed89 in Digikam::DatabaseAccess::checkReadyForUse ( observer=0x84d5588) at /home/gerhard/OSS/graphics4/digikam/libs/database/databaseaccess.cpp:240 #31 0x082a145b in Digikam::ScanController::run (this=0x84d5580) at /home/gerhard/OSS/graphics4/digikam/digikam/scancontroller.cpp:323 #32 0xb6629612 in ?? () from /usr/lib/libQtCore.so.4 #33 0xb57344fb in start_thread () from /lib/tls/i686/cmov/libpthread.so.0 #34 0xb53e7e5e in clone () from /lib/tls/i686/cmov/libc.so.6 Thread 1 (Thread 0xb4cab720 (LWP 16280)): #0 0xffffe424 in __kernel_vsyscall () #1 0xb5738aa5 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/tls/i686/cmov/libpthread.so.0 #2 0xb6628945 in ?? () from /usr/lib/libQtCore.so.4 #3 0xb6623f8c in QMutex::lock () from /usr/lib/libQtCore.so.4 #4 0xb7efeee9 in DatabaseAccess (this=0xbf9ed1bf) at /home/gerhard/OSS/graphics4/digikam/libs/database/databaseaccess.cpp:96 #5 0xb7f119b7 in Digikam::ImageInfoCache::slotImageChanged (this=0x84d5298, changeset=@0x89090f0) at /home/gerhard/OSS/graphics4/digikam/libs/database/imageinfocache.cpp:92 #6 0xb7f12412 in Digikam::ImageInfoCache::qt_metacall (this=0x84d5298, _c=QMetaObject::InvokeMetaMethod, _id=0, _a=0x88c7108) at /home/gerhard/OSS/graphics4/build/digikam/digikam/imageinfocache.moc:68 #7 0xb6722e8b in QMetaCallEvent::placeMetaCall () from /usr/lib/libQtCore.so.4 #8 0xb6724ed1 in QObject::event () from /usr/lib/libQtCore.so.4 #9 0xb5bd9c0c in QApplicationPrivate::notify_helper () from /usr/lib/libQtGui.so.4 #10 0xb5bde7a9 in QApplication::notify () from /usr/lib/libQtGui.so.4 #11 0xb6df0603 in KApplication::notify (this=0xbf9eda84, receiver=0x84d5298, event=0x88b3348) at /build/buildd/kde4libs-4.0.98a/kdeui/kernel/kapplication.cpp:311 #12 0xb67146a9 in QCoreApplication::notifyInternal () from /usr/lib/libQtCore.so.4 #13 0xb6715a59 in QCoreApplicationPrivate::sendPostedEvents () from /usr/lib/libQtCore.so.4 #14 0xb6715c7d in QCoreApplication::sendPostedEvents () from /usr/lib/libQtCore.so.4 #15 0xb673fbcf in ?? () from /usr/lib/libQtCore.so.4 #16 0xb50bedd6 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0 #17 0xb50c2193 in ?? () from /usr/lib/libglib-2.0.so.0 #18 0xb50c274e in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0 #19 0xb673ff98 in QEventDispatcherGlib::processEvents () from /usr/lib/libQtCore.so.4 #20 0xb5c6d1b5 in ?? () from /usr/lib/libQtGui.so.4 #21 0xb671392d in QEventLoop::processEvents () from /usr/lib/libQtCore.so.4 #22 0xb6713abd in QEventLoop::exec () from /usr/lib/libQtCore.so.4 #23 0x082a05cc in Digikam::ScanController::databaseInitialization ( this=0x84d5580) at /home/gerhard/OSS/graphics4/digikam/digikam/scancontroller.cpp:243 #24 0x08220378 in Digikam::AlbumManager::setDatabase (this=0x83d88c8, dbPath=@0xbf9edb34, priority=false) at /home/gerhard/OSS/graphics4/digikam/digikam/albummanager.cpp:301 #25 0x0829300d in main (argc=1, argv=0xbf9ede64) at /home/gerhard/OSS/graphics4/digikam/digikam/main.cpp:276 #0 0xffffe424 in __kernel_vsyscall ()
showfoto kde3 and kde4 crash the same way, so I guess it's really an exiv2 issue or the interaction between digikam and exiv2
Gerard, Judging from the backtrace, the crash is from the SVN version of Exiv2, not from version 0.17.1. If everything was cleanly compiled with the SVN version then that's good, it needs this kind of testing. But please make sure you don't have a mix of Exiv2 versions, there have been cases where digikam loaded one version of exiv2 and libkexiv2 depended on another one. If you think it's an exiv2 issue, can you please send me one of these images to ahuggel at gmx dot net? Thanks Andreas PS: I'd say this is a different issue from that of the OP.
Test image has been sent. I tested the crash with 0.9.4 (which uses the same libkexiv2): same crash when I ask the metadata to be re-read into the database. For me this points to exiv2 or the way libkexiv2 is handling exiv2 errors. Gerhard
I cleaned my machines from everything *exiv2 and *kexiv2, recompiled 0.17.91 from svn and the pb remains the same. $ ldd /usr/lib/kde4/bin/digikam|grep exiv libkexiv2.so.6 => /usr/lib/kde4/lib/libkexiv2.so.6 (0xb5794000) libexiv2.so.4 => /usr/lib/libexiv2.so.4 (0xb4ee0000) $ locate exiv2.so /usr/lib/libexiv2.so.4 /usr/lib/libkexiv2.so.5.0.0 /usr/lib/kde4/lib/libkisexiv2.so.5.0.0 /usr/lib/kde4/lib/libkexiv2.so /usr/lib/kde4/lib/libkisexiv2.so.5 /usr/lib/kde4/lib/libkexiv2.so.6.0.0 /usr/lib/kde4/lib/libkexiv2.so.6 /usr/lib/libkexiv2.so /usr/lib/libkexiv2.so.5 /usr/lib/libexiv2.so /usr/lib/libexiv2.so.4.0.1 Regards Gerhard
Now I went back to exiv2 0.17.1 and all works without a flaw.
Gerard, thanks for the image. You were right, this is an Exiv2 issue, I can reproduce it with the SVN version of Exiv2 aka 0.17.91: ahuggel@mowgli> ./exiv2 -M'set Exif.Image.Software GI' Chambord.jpg Error: Directory Canon, entry 0x0200 has an invalid type 768; skipping entry. Error: Directory Canon, entry 0x0200 has an invalid type 768; skipping entry. Segmentation fault
Andreas, if you need more test images, I have plenty ;-)
Gerhard, This should be fixed. Please retry with Exiv2 from trunk, rev 1551 or later and confirm if it works. Thanks, Andreas
Thanks Gerhard for the feedback. i close this file now. Gilles
Not reproducible with digiKam 7.3.0 + Exiv2 0.27.3