Bug 182903

Summary: digikam crashes after removing the database file
Product: [Applications] digikam Reporter: S. Burmeister <sven.burmeister>
Component: Metadata-EngineAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: crash CC: ahuggel, caulier.gilles, marcel.wiesweg
Priority: NOR    
Version: 0.10.0   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In: 0.10.0
Sentry Crash Report:

Description S. Burmeister 2009-02-02 18:30:18 UTC
Version:           0.10 svn Rev: 920276 (using KDE 4.2.0)
OS:                Linux
Installed from:    SuSE RPMs

I wanted to try the new fixes in exiv2, so I compiled it and re-compiled libkdcraw and libkexiv as well. After that I recompiled digikam.

Since the information in the database is not updated automatically, I removed the database file, while digikam was not running. Now, if I start digikam it crashes instantly.

Anwendung: digiKam (digikam), Signal SIGABRT
[?1034h[Thread debugging using libthread_db enabled]
   from /lib64/libpthread.so.0
[Current thread is 0 (LWP 21185)]

Thread 2 (Thread 0x40acd950 (LWP 21186)):
[KCrash Handler]
#5  0x00007fecf6a515c5 in raise () from /lib64/libc.so.6
#6  0x00007fecf6a52bb3 in abort () from /lib64/libc.so.6
#7  0x00007fecf6a4a1e9 in __assert_fail () from /lib64/libc.so.6
#8  0x00007fecf486765e in Exiv2::Internal::TiffCreator::getPath () from /usr/lib64/libexiv2.so.5
#9  0x00007fecf486fe35 in Exiv2::Internal::TiffEncoder::add () from /usr/lib64/libexiv2.so.5
#10 0x00007fecf486841a in Exiv2::Internal::TiffParserWorker::encode () from /usr/lib64/libexiv2.so.5
#11 0x00007fecf4868797 in Exiv2::TiffParser::encode () from /usr/lib64/libexiv2.so.5
#12 0x00007fecf480dc4b in Exiv2::ExifParser::encode () from /usr/lib64/libexiv2.so.5
#13 0x00007fecfc2bb98d in KExiv2Iface::KExiv2::getExif (this=0x40acc7a0, addExifHeader=false) at /usr/include/exiv2/exif.hpp:570
#14 0x00007fecfaa82c0a in Digikam::ImageScanner::loadFromDisk (this=<value optimized out>) at /home/kde-devel/kde/src/extragear/graphics/digikam/libs/database/imagescanner.cpp:606
#15 0x00007fecfaa8a008 in Digikam::ImageScanner::newFile (this=0x52c1, albumId=21186) at /home/kde-devel/kde/src/extragear/graphics/digikam/libs/database/imagescanner.cpp:89
#16 0x00007fecfaa7c7e1 in Digikam::CollectionScanner::scanNewFile (this=0x40acd070, info=@0xc2ee88, albumId=9)
    at /home/kde-devel/kde/src/extragear/graphics/digikam/libs/database/collectionscanner.cpp:592
#17 0x00007fecfaa7df1f in Digikam::CollectionScanner::scanAlbum (this=0x40acd070, location=@0xad8590, album=@0x40accdb0)
    at /home/kde-devel/kde/src/extragear/graphics/digikam/libs/database/collectionscanner.cpp:545
#18 0x00007fecfaa7dca1 in Digikam::CollectionScanner::scanAlbum (this=0x40acd070, location=@0xad8590, album=@0x40accf10)
    at /home/kde-devel/kde/src/extragear/graphics/digikam/libs/database/collectionscanner.cpp:556
#19 0x00007fecfaa7e947 in Digikam::CollectionScanner::scanAlbumRoot (this=0x40acd070, location=@0xad8590) at /home/kde-devel/kde/src/extragear/graphics/digikam/libs/database/collectionscanner.cpp:345
#20 0x00007fecfaa7ebf7 in Digikam::CollectionScanner::completeScan (this=0x40acd070) at /home/kde-devel/kde/src/extragear/graphics/digikam/libs/database/collectionscanner.cpp:192
#21 0x0000000000652a42 in Digikam::ScanController::run (this=0xabdc20) at /home/kde-devel/kde/src/extragear/graphics/digikam/digikam/scancontroller.cpp:432
#22 0x00007fecf89ef022 in QThreadPrivate::start (arg=0xabdc20) at thread/qthread_unix.cpp:185
#23 0x00007fecf877b040 in start_thread () from /lib64/libpthread.so.0
#24 0x00007fecf6af208d in clone () from /lib64/libc.so.6
#25 0x0000000000000000 in ?? ()

Thread 1 (Thread 0x7fecfdb22700 (LWP 21185)):
#0  0x00007fecf877edd9 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007fecf89effd9 in QWaitCondition::wait (this=0xabdd90, mutex=0xabdd70, time=18446744073709551615) at thread/qwaitcondition_unix.cpp:82
#2  0x00007fecf89ef1cc in QThread::wait (this=<value optimized out>, time=18446744073709551615) at thread/qthread_unix.cpp:476
#3  0x000000000065183d in Digikam::ScanController::shutDown (this=0xabdc20) at /home/kde-devel/kde/src/extragear/graphics/digikam/digikam/scancontroller.cpp:264
#4  0x000000000065567b in ~ScanController (this=0xabdddc) at /home/kde-devel/kde/src/extragear/graphics/digikam/digikam/scancontroller.cpp:247
#5  0x0000000000655817 in destroy () at /home/kde-devel/kde/src/extragear/graphics/digikam/digikam/scancontroller.cpp:188
#6  0x00007fecf6a5426d in exit () from /lib64/libc.so.6
#7  0x00007fecf7905178 in qt_xio_errhandler () at kernel/qapplication_x11.cpp:584
#8  0x00007fecf98ce738 in KApplication::xioErrhandler (this=0x7fff05b79250, dpy=0x978e00) at /usr/src/debug/kdelibs-4.2.0/kdeui/kernel/kapplication.cpp:413
#9  0x00007fecf585fee4 in _XIOError () from /usr/lib64/libX11.so.6
#10 0x00007fecf5867918 in ?? () from /usr/lib64/libX11.so.6
#11 0x00007fecf5868076 in _XEventsQueued () from /usr/lib64/libX11.so.6
#12 0x00007fecf5850623 in XEventsQueued () from /usr/lib64/libX11.so.6
#13 0x00007fecf793becc in x11EventSourceCheck (s=0x975a00) at kernel/qguieventdispatcher_glib.cpp:83
#14 0x00007fecf4103632 in g_main_context_check () from /usr/lib64/libglib-2.0.so.0
#15 0x00007fecf4103f29 in ?? () from /usr/lib64/libglib-2.0.so.0
#16 0x00007fecf41041dc in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#17 0x00007fecf8b003ce in QEventDispatcherGlib::processEvents (this=0x9719e0, flags=<value optimized out>) at kernel/qeventdispatcher_glib.cpp:321
#18 0x00007fecf793bd0f in QGuiEventDispatcherGlib::processEvents (this=0xabdddc, flags=<value optimized out>) at kernel/qguieventdispatcher_glib.cpp:198
#19 0x00007fecf8ad6782 in QEventLoop::processEvents (this=<value optimized out>, flags={i = 95915840}) at kernel/qeventloop.cpp:143
#20 0x00007fecf8ad690d in QEventLoop::exec (this=0xa94890, flags={i = 95915920}) at kernel/qeventloop.cpp:194
#21 0x0000000000653964 in Digikam::ScanController::completeCollectionScan (this=0xabdc20, splash=<value optimized out>)
    at /home/kde-devel/kde/src/extragear/graphics/digikam/digikam/scancontroller.cpp:326
#22 0x00000000006155c4 in DigikamApp (this=0xac14f0) at /home/kde-devel/kde/src/extragear/graphics/digikam/digikam/digikamapp.cpp:160
#23 0x00000000006773c9 in main (argc=<value optimized out>, argv=0x7fff05b799d8) at /home/kde-devel/kde/src/extragear/graphics/digikam/digikam/main.cpp:167
Comment 1 S. Burmeister 2009-02-02 18:32:33 UTC
libkdcraw is Rev: 917285
libkexiv2 is Rev: 918642
exiv2 is Rev: 1740
Comment 2 Marcel Wiesweg 2009-02-02 19:41:08 UTC
This is the same backtrace as in 182738 (but more complete). Marking as duplicate. I think Andreas has already located the problem. Sven, look at his last comment there. He'd like to have a picture that causes this.
From your console output, you will probably get a hint at the last picture that did not crash (Digikam::DImg::load: ... file identified). Perhaps from this information you can isolate the one that crashes here.

*** This bug has been marked as a duplicate of bug 182738 ***
Comment 3 Andreas Huggel 2009-02-03 10:51:27 UTC
S. Burmeister (copied from bug #182738, comment 10):

Having a look at the output of digikam, it works fine indexing until it hits the first RAW picture. 

ate Photos/2006, Oktober, 21/dscf0012.jpg" : JPEG file identified digikam(22181)/digikam (core) Digikam::ImageScanner::addImage: Adding new item "/media/Bueffel/Bilder/Private Photos/2006, Oktober, 21/dscf0012.jpg" digikam(22181)/KEXIV2 KExiv2Iface::KExiv2::getImageDateTime: DateTime => Exif.Photo.DateTimeOriginal => QDateTime("Mi Nov 22 18:34:21 2006") digikam(22181)/KEXIV2 KExiv2Iface::KExiv2::getDigitizationDateTime: DateTime (Exif digitalized): Mi Nov 22 18:34:21 2006 digikam(22181)/KEXIV2 KExiv2Iface::KExiv2::getImageOrientation: Orientation => Exif.Image.Orientation => 1 digikam(22181)/digikam (core) Digikam::DImg::load: "/media/Bueffel/Bilder/Private Photos/2008-12-26 Weihnachten 2008/p1000036.rw2" : RAW file identified digikam: tiffimage.cpp:688: static void Exiv2::Internal::TiffCreator::getPath(Exiv2::Internal::TiffPath&, uint32_t, uint16_t, uint32_t): Zusicherung »ts !=0« nicht erfüllt. digikam: Fatal IO error: client killed 
Comment 4 caulier.gilles 2009-02-03 10:55:23 UTC
I'm agree with Andreas : it's famous RW2 file...

Gilles
Comment 5 Andreas Huggel 2009-02-03 10:56:42 UTC
Thanks for the report. I can reproduce this with the exiv2 command line tool:

ahuggel@mowgli> exiv2 -v -ie -S.rw2 image.jpg
File 1/1: image.jpg
Writing Exif data from ./image.rw2 to image.jpg
exiv2: tiffimage.cpp:688: static void Exiv2::Internal::TiffCreator::getPath(Exiv2::Internal::TiffPath&, uint32_t, uint16_t, uint32_t): Assertion `ts != 0' failed.
Aborted

It's fixed with r1742 in the Exiv2 SVN - http://dev.exiv2.org/repositories/revision/exiv2/1742

Please retest.

-ahu.
Comment 6 S. Burmeister 2009-02-04 00:55:07 UTC
It does not crash anymore. So it seems fixed. Thanks!