Bug 233549 - [database] Stuck at saving new image
Summary: [database] Stuck at saving new image
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Database-Scan (show other bugs)
Version: 1.3.0
Platform: Arch Linux Unspecified
: NOR major
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-06 23:46 UTC by Johannes Wienke
Modified: 2017-08-08 09:02 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 1.3.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Johannes Wienke 2010-04-06 23:46:37 UTC
Version:           trunk (using KDE 4.4.2)
Installed from:    Archlinux Packages

Since the database branch was merged to trunk digikam sometimes gets stuck at 94% while saving an image. The complete gui (album gui and editor) is completely dead.

This is the debug output:

digikam(11223)/digikam (core) Digikam::DImg::load: "/home/languitar/Bilder/Bielefeld am Tag/2010-03-29/entwickelt/X3298980.jpg"  : JPEG file identified
digikam(11223)/digikam (core) Digikam::DImg::load: "/home/languitar/Bilder/Bielefeld am Tag/2010-03-29/entwickelt/X3298980.jpg"  : JPEG file identified
digikam(11223)/digikam (core) Digikam::ImageScanner::addImage: Adding new item "/home/languitar/Bilder/Bielefeld am Tag/2010-03-29/entwickelt/X3298980.jpg"
digikam(11223)/digikam (core) Digikam::ImageScanner::addImage: Adding new item "/home/languitar/Bilder/Bielefeld am Tag/2010-03-29/entwickelt/X3298980.jpg"
digikam(11223)/digikam (core) Digikam::DatabaseCoreBackendPrivate::debugOutputFailedQuery: Failure executing query:
digikam(11223)/digikam (core) Digikam::DatabaseCoreBackendPrivate::debugOutputFailedQuery: Failure executing query:
digikam(11223)/digikam (core) Digikam::DatabaseCoreBackendPrivate::debugOutputFailedQuery: "INSERT INTO ImageTags  (imageid, tagid) SELECT ?, tagid FROM ImageTags WHERE imageid=?;"
digikam(11223)/digikam (core) Digikam::DatabaseCoreBackendPrivate::debugOutputFailedQuery: "INSERT INTO ImageTags  (imageid, tagid) SELECT ?, tagid FROM ImageTags WHERE imageid=?;"
digikam(11223)/digikam (core) Digikam::DatabaseCoreBackendPrivate::debugOutputFailedQuery: Error messages: "constraint failed Unable to fetch row" 19 1 "constraint failed" "Unable to fetch row" QSqlError(-1, "", "")
digikam(11223)/digikam (core) Digikam::DatabaseCoreBackendPrivate::debugOutputFailedQuery: Error messages: "constraint failed Unable to fetch row" 19 1 "constraint failed" "Unable to fetch row" QSqlError(-1, "", "")
digikam(11223)/digikam (core) Digikam::DatabaseCoreBackendPrivate::debugOutputFailedQuery: Bound values:  (QVariant(qlonglong, 46753) ,  QVariant(qlonglong, 45998) )
digikam(11223)/digikam (core) Digikam::DatabaseCoreBackendPrivate::debugOutputFailedQuery: Bound values:  (QVariant(qlonglong, 46753) ,  QVariant(qlonglong, 45998) )
Comment 1 Johannes Wienke 2010-04-06 23:47:18 UTC
Backend is sqlite.
Comment 2 Johannes Wienke 2010-04-06 23:52:31 UTC
Maybe it's also worth to notice that this only happened for me when a new image is generated in the database as a result of the saving process.
Comment 3 Marcel Wiesweg 2010-04-07 20:39:13 UTC
I remember a similar problem of yours with a backtrace recently, dont remember where. Can you attach gdb when digikam is stuck and give a backtrace?
Comment 4 Johannes Wienke 2010-04-08 21:14:57 UTC
Ok, this time it got stuck at 99%. Here is the backtrace:

(gdb) thread apply all bt

Thread 22 (Thread 0x7f2ae4a7e710 (LWP 13453)):
#0  0x00007f2af41a210c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#1  0x00007f2af442711b in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/libQtCore.so.4
#2  0x000000000065157c in Digikam::ScanController::run (this=0x1b77950) at /home/languitar/workspace/digiKam/digikam/scancontroller.cpp:516
#3  0x00007f2af4426155 in ?? () from /usr/lib/libQtCore.so.4
#4  0x00007f2af419d88a in start_thread () from /lib/libpthread.so.0
#5  0x00007f2af34ec9ed in clone () from /lib/libc.so.6
#6  0x0000000000000000 in ?? ()

Thread 21 (Thread 0x7f2ae427d710 (LWP 13455)):
#0  0x00007f2af34e41c3 in poll () from /lib/libc.so.6
#1  0x00007f2aeff9f979 in g_main_context_iterate () from /usr/lib/libglib-2.0.so.0
#2  0x00007f2aeff9fdcc in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#3  0x00007f2af4543c13 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#4  0x00007f2af45190c2 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#5  0x00007f2af451949c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#6  0x00007f2af4423759 in QThread::exec() () from /usr/lib/libQtCore.so.4
#7  0x00007f2af4426155 in ?? () from /usr/lib/libQtCore.so.4
#8  0x00007f2af419d88a in start_thread () from /lib/libpthread.so.0
#9  0x00007f2af34ec9ed in clone () from /lib/libc.so.6
#10 0x0000000000000000 in ?? ()

Thread 20 (Thread 0x7f2ae3870710 (LWP 13456)):
#0  0x00007f2af34e41c3 in poll () from /lib/libc.so.6
#1  0x00007f2aeff9f979 in g_main_context_iterate () from /usr/lib/libglib-2.0.so.0
#2  0x00007f2aeff9fdcc in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#3  0x00007f2af4543c13 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#4  0x00007f2af45190c2 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#5  0x00007f2af451949c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#6  0x00007f2af4423759 in QThread::exec() () from /usr/lib/libQtCore.so.4
#7  0x00007f2af4426155 in ?? () from /usr/lib/libQtCore.so.4
#8  0x00007f2af419d88a in start_thread () from /lib/libpthread.so.0
#9  0x00007f2af34ec9ed in clone () from /lib/libc.so.6
#10 0x0000000000000000 in ?? ()

Thread 19 (Thread 0x7f2ae306f710 (LWP 13457)):
#0  0x00007f2af41a210c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#1  0x00007f2af442711b in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/libQtCore.so.4
#2  0x00007f2af7d1ef42 in Digikam::LoadSaveThread::run (this=0x7f2adc013740) at /home/languitar/workspace/digiKam/libs/threadimageio/loadsavethread.cpp:131
---Type <return> to continue, or q <return> to quit---
#3  0x00007f2af4426155 in ?? () from /usr/lib/libQtCore.so.4
#4  0x00007f2af419d88a in start_thread () from /lib/libpthread.so.0
#5  0x00007f2af34ec9ed in clone () from /lib/libc.so.6
#6  0x0000000000000000 in ?? ()

Thread 18 (Thread 0x7f2ae286e710 (LWP 13458)):
#0  0x00007f2af34e41c3 in poll () from /lib/libc.so.6
#1  0x00007f2aeff9f979 in g_main_context_iterate () from /usr/lib/libglib-2.0.so.0
#2  0x00007f2aeff9fdcc in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#3  0x00007f2af4543c13 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#4  0x00007f2af45190c2 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#5  0x00007f2af451949c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#6  0x00007f2af4423759 in QThread::exec() () from /usr/lib/libQtCore.so.4
#7  0x00007f2af4426155 in ?? () from /usr/lib/libQtCore.so.4
#8  0x00007f2af419d88a in start_thread () from /lib/libpthread.so.0
#9  0x00007f2af34ec9ed in clone () from /lib/libc.so.6
#10 0x0000000000000000 in ?? ()

Thread 17 (Thread 0x7f2ae206d710 (LWP 13459)):
#0  0x00007f2af34e41c3 in poll () from /lib/libc.so.6
#1  0x00007f2aeff9f979 in g_main_context_iterate () from /usr/lib/libglib-2.0.so.0
#2  0x00007f2aeff9fdcc in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#3  0x00007f2af4543c13 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#4  0x00007f2af45190c2 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#5  0x00007f2af451949c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#6  0x00007f2af4423759 in QThread::exec() () from /usr/lib/libQtCore.so.4
#7  0x00007f2af4426155 in ?? () from /usr/lib/libQtCore.so.4
#8  0x00007f2af419d88a in start_thread () from /lib/libpthread.so.0
#9  0x00007f2af34ec9ed in clone () from /lib/libc.so.6
#10 0x0000000000000000 in ?? ()

Thread 16 (Thread 0x7f2ad6103710 (LWP 13460)):
#0  0x00007f2af41a2479 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#1  0x00007f2adb888af1 in metronom_sync_loop () from /usr/lib/libxine.so.1
#2  0x00007f2af419d88a in start_thread () from /lib/libpthread.so.0
#3  0x00007f2af34ec9ed in clone () from /lib/libc.so.6
#4  0x0000000000000000 in ?? ()

Thread 15 (Thread 0x7f2ad4692710 (LWP 13461)):
#0  0x00007f2af34e6233 in select () from /lib/libc.so.6
---Type <return> to continue, or q <return> to quit---
#1  0x00007f2adb8b0a65 in xine_usec_sleep () from /usr/lib/libxine.so.1
#2  0x00007f2adb896499 in video_out_loop () from /usr/lib/libxine.so.1
#3  0x00007f2af419d88a in start_thread () from /lib/libpthread.so.0
#4  0x00007f2af34ec9ed in clone () from /lib/libc.so.6
#5  0x0000000000000000 in ?? ()

Thread 14 (Thread 0x7f2ad3e91710 (LWP 13462)):
#0  0x00007f2af34e41c3 in poll () from /lib/libc.so.6
#1  0x00007f2aeff9f979 in g_main_context_iterate () from /usr/lib/libglib-2.0.so.0
#2  0x00007f2aeff9fdcc in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#3  0x00007f2af4543c13 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#4  0x00007f2af45190c2 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#5  0x00007f2af451949c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#6  0x00007f2af4423759 in QThread::exec() () from /usr/lib/libQtCore.so.4
#7  0x00007f2adbae17c6 in Phonon::Xine::XineThread::run() () from /usr/lib/kde4/plugins/phonon_backend/phonon_xine.so
#8  0x00007f2af4426155 in ?? () from /usr/lib/libQtCore.so.4
#9  0x00007f2af419d88a in start_thread () from /lib/libpthread.so.0
#10 0x00007f2af34ec9ed in clone () from /lib/libc.so.6
#11 0x0000000000000000 in ?? ()

Thread 13 (Thread 0x7f2ad3487710 (LWP 13467)):
#0  0x00007f2af34e41c3 in poll () from /lib/libc.so.6
#1  0x00007f2ad348d7ae in ao_alsa_handle_event_thread () from /usr/lib/xine/plugins/1.28/xineplug_ao_out_alsa.so
#2  0x00007f2af419d88a in start_thread () from /lib/libpthread.so.0
#3  0x00007f2af34ec9ed in clone () from /lib/libc.so.6
#4  0x0000000000000000 in ?? ()

Thread 12 (Thread 0x7f2ad2c86710 (LWP 13468)):
#0  0x00007f2af41a210c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#1  0x00007f2adb8995fb in ao_loop () from /usr/lib/libxine.so.1
#2  0x00007f2af419d88a in start_thread () from /lib/libpthread.so.0
#3  0x00007f2af34ec9ed in clone () from /lib/libc.so.6
#4  0x0000000000000000 in ?? ()

Thread 11 (Thread 0x7f2ad09ff710 (LWP 13469)):
#0  0x00007f2af41a210c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#1  0x00007f2af442711b in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/libQtCore.so.4
#2  0x00007f2af7d1ef42 in Digikam::LoadSaveThread::run (this=0x2594470) at /home/languitar/workspace/digiKam/libs/threadimageio/loadsavethread.cpp:131
#3  0x00007f2af4426155 in ?? () from /usr/lib/libQtCore.so.4
#4  0x00007f2af419d88a in start_thread () from /lib/libpthread.so.0
---Type <return> to continue, or q <return> to quit---
#5  0x00007f2af34ec9ed in clone () from /lib/libc.so.6
#6  0x0000000000000000 in ?? ()

Thread 10 (Thread 0x7f2ad01fe710 (LWP 13475)):
#0  0x00007f2af41a210c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#1  0x00007f2af442711b in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/libQtCore.so.4
#2  0x00007f2af7d1ef42 in Digikam::LoadSaveThread::run (this=0x28bd080) at /home/languitar/workspace/digiKam/libs/threadimageio/loadsavethread.cpp:131
#3  0x00007f2af4426155 in ?? () from /usr/lib/libQtCore.so.4
#4  0x00007f2af419d88a in start_thread () from /lib/libpthread.so.0
#5  0x00007f2af34ec9ed in clone () from /lib/libc.so.6
#6  0x0000000000000000 in ?? ()

Thread 9 (Thread 0x7f2ace1fa710 (LWP 13476)):
#0  0x00007f2af41a210c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#1  0x00007f2af442711b in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/libQtCore.so.4
#2  0x00007f2af7d1ef42 in Digikam::LoadSaveThread::run (this=0x2958470) at /home/languitar/workspace/digiKam/libs/threadimageio/loadsavethread.cpp:131
#3  0x00007f2af4426155 in ?? () from /usr/lib/libQtCore.so.4
#4  0x00007f2af419d88a in start_thread () from /lib/libpthread.so.0
#5  0x00007f2af34ec9ed in clone () from /lib/libc.so.6
#6  0x0000000000000000 in ?? ()

Thread 8 (Thread 0x7f2acf9fd710 (LWP 13479)):
#0  0x00007f2af41a210c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#1  0x00007f2af442711b in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/libQtCore.so.4
#2  0x00007f2af7d1ef42 in Digikam::LoadSaveThread::run (this=0x3f847a0) at /home/languitar/workspace/digiKam/libs/threadimageio/loadsavethread.cpp:131
#3  0x00007f2af4426155 in ?? () from /usr/lib/libQtCore.so.4
#4  0x00007f2af419d88a in start_thread () from /lib/libpthread.so.0
#5  0x00007f2af34ec9ed in clone () from /lib/libc.so.6
#6  0x0000000000000000 in ?? ()

Thread 7 (Thread 0x7f2acf1fc710 (LWP 17295)):
#0  0x00007f2af41a210c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#1  0x00007f2af442711b in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/libQtCore.so.4
#2  0x00007f2af7d1ef42 in Digikam::LoadSaveThread::run (this=0x5920a30) at /home/languitar/workspace/digiKam/libs/threadimageio/loadsavethread.cpp:131
#3  0x00007f2af4426155 in ?? () from /usr/lib/libQtCore.so.4
#4  0x00007f2af419d88a in start_thread () from /lib/libpthread.so.0
#5  0x00007f2af34ec9ed in clone () from /lib/libc.so.6
#6  0x0000000000000000 in ?? ()

Thread 6 (Thread 0x7f2acd9f9710 (LWP 17296)):
---Type <return> to continue, or q <return> to quit---
#0  0x00007f2af41a210c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#1  0x00007f2af442711b in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/libQtCore.so.4
#2  0x00007f2af7d1ef42 in Digikam::LoadSaveThread::run (this=0x6e662b0) at /home/languitar/workspace/digiKam/libs/threadimageio/loadsavethread.cpp:131

#3  0x00007f2af4426155 in ?? () from /usr/lib/libQtCore.so.4
#4  0x00007f2af419d88a in start_thread () from /lib/libpthread.so.0
#5  0x00007f2af34ec9ed in clone () from /lib/libc.so.6
#6  0x0000000000000000 in ?? ()

Thread 5 (Thread 0x7f2ab8cc2710 (LWP 18778)):
#0  0x00007f2af41a210c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#1  0x00007f2af442711b in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/libQtCore.so.4
#2  0x00007f2af7d1ef42 in Digikam::LoadSaveThread::run (this=0x5bc6800) at /home/languitar/workspace/digiKam/libs/threadimageio/loadsavethread.cpp:131
#3  0x00007f2af4426155 in ?? () from /usr/lib/libQtCore.so.4
#4  0x00007f2af419d88a in start_thread () from /lib/libpthread.so.0
#5  0x00007f2af34ec9ed in clone () from /lib/libc.so.6
#6  0x0000000000000000 in ?? ()

Thread 4 (Thread 0x7f2ace9fb710 (LWP 18779)):
#0  0x00007f2af41a210c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#1  0x00007f2af442711b in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/libQtCore.so.4
#2  0x00007f2af7d1ef42 in Digikam::LoadSaveThread::run (this=0x65075f0) at /home/languitar/workspace/digiKam/libs/threadimageio/loadsavethread.cpp:131
#3  0x00007f2af4426155 in ?? () from /usr/lib/libQtCore.so.4
#4  0x00007f2af419d88a in start_thread () from /lib/libpthread.so.0
#5  0x00007f2af34ec9ed in clone () from /lib/libc.so.6
#6  0x0000000000000000 in ?? ()

Thread 3 (Thread 0x7f2ab84c1710 (LWP 18785)):
#0  0x00007f2af41a210c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#1  0x00007f2af442711b in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/libQtCore.so.4
#2  0x00007f2af7d1ef42 in Digikam::LoadSaveThread::run (this=0x5c49e80) at /home/languitar/workspace/digiKam/libs/threadimageio/loadsavethread.cpp:131
#3  0x00007f2af4426155 in ?? () from /usr/lib/libQtCore.so.4
#4  0x00007f2af419d88a in start_thread () from /lib/libpthread.so.0
#5  0x00007f2af34ec9ed in clone () from /lib/libc.so.6
#6  0x0000000000000000 in ?? ()

Thread 2 (Thread 0x7f2ab74bf710 (LWP 18788)):
#0  0x00007f2af41a210c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#1  0x00007f2af442711b in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/libQtCore.so.4
#2  0x00007f2af7d1ef42 in Digikam::LoadSaveThread::run (this=0x574e220) at /home/languitar/workspace/digiKam/libs/threadimageio/loadsavethread.cpp:131
#3  0x00007f2af4426155 in ?? () from /usr/lib/libQtCore.so.4
---Type <return> to continue, or q <return> to quit---
#4  0x00007f2af419d88a in start_thread () from /lib/libpthread.so.0
#5  0x00007f2af34ec9ed in clone () from /lib/libc.so.6
#6  0x0000000000000000 in ?? ()

Thread 1 (Thread 0x7f2afacad7c0 (LWP 13449)):
#0  0x00007f2af41a210c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#1  0x00007f2af442711b in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/libQtCore.so.4
#2  0x00007f2af7d00222 in Digikam::DatabaseCoreBackendPrivate::ErrorLocker::wait (this=0x7fffc8ad3fc0)
    at /home/languitar/workspace/digiKam/libs/database/databasecorebackend.cpp:288
#3  0x00007f2af7d0026b in Digikam::DatabaseCoreBackendPrivate::checkOperationStatus (this=0x1be1520)
    at /home/languitar/workspace/digiKam/libs/database/databasecorebackend.cpp:329
#4  0x00007f2af7d01f84 in Digikam::DatabaseCoreBackend::exec (this=0x1bc4710, query=...)
    at /home/languitar/workspace/digiKam/libs/database/databasecorebackend.cpp:902
#5  0x00007f2af7d02b5f in Digikam::DatabaseCoreBackend::execQuery (this=0x1bc4710, sql=<value optimized out>, boundValue1=...)
    at /home/languitar/workspace/digiKam/libs/database/databasecorebackend.cpp:745
#6  0x00007f2af7d02bc2 in Digikam::DatabaseCoreBackend::execSql (this=0x1bc4710, sql=<value optimized out>, boundValue1=<value optimized out>, 
    values=0x7fffc8ad4110, lastInsertId=0x0) at /home/languitar/workspace/digiKam/libs/database/databasecorebackend.cpp:694
#7  0x00007f2af77d7e57 in Digikam::AlbumDB::getAlbumRelativePath (this=0x1bedf30, albumID=<value optimized out>)
    at /home/languitar/workspace/digiKam/libs/database/albumdb.cpp:2840
#8  0x00007f2af7814dc3 in Digikam::ImageInfoCache::albumName (this=<value optimized out>, access=<value optimized out>, albumId=639)
    at /home/languitar/workspace/digiKam/libs/database/imageinfocache.cpp:94
#9  0x00007f2af78108c2 in Digikam::ImageInfo::filePath (this=<value optimized out>) at /home/languitar/workspace/digiKam/libs/database/imageinfo.cpp:443
#10 0x000000000064e411 in Digikam::ScanControllerLoadingCacheFileWatch::slotImageChanged (this=<value optimized out>, changeset=<value optimized out>)
    at /home/languitar/workspace/digiKam/digikam/scancontroller.cpp:839
#11 0x000000000065101d in Digikam::ScanControllerLoadingCacheFileWatch::qt_metacall (this=0x1b06460, _c=QMetaObject::InvokeMetaMethod, 
    _id=<value optimized out>, _a=0x8a108f0) at /home/languitar/workspace/build/digiKam/digikam/scancontroller.moc:72
#12 0x00007f2af452a419 in QObject::event(QEvent*) () from /usr/lib/libQtCore.so.4
#13 0x00007f2af53d85ec in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#14 0x00007f2af53debdb in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#15 0x00007f2af6325256 in KApplication::notify(QObject*, QEvent*) () from /usr/lib/libkdeui.so.5
#16 0x00007f2af451a79c in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/libQtCore.so.4
#17 0x00007f2af451cf17 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /usr/lib/libQtCore.so.4
#18 0x00007f2af45440d3 in ?? () from /usr/lib/libQtCore.so.4
#19 0x00007f2aeff9bda2 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#20 0x00007f2aeff9fc18 in g_main_context_iterate () from /usr/lib/libglib-2.0.so.0
#21 0x00007f2aeff9fdcc in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#22 0x00007f2af4543c13 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#23 0x00007f2af5486d6e in ?? () from /usr/lib/libQtGui.so.4
#24 0x00007f2af45190c2 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#25 0x00007f2af451949c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
---Type <return> to continue, or q <return> to quit---
#26 0x000000000066a528 in Digikam::DatabaseGUIErrorHandler::checkDatabaseConnection (this=0x6e96820)
    at /home/languitar/workspace/digiKam/digikam/databaseguierrorhandler.cpp:179
#27 0x000000000066a67a in Digikam::DatabaseGUIErrorHandler::databaseError (this=<value optimized out>, answer=0x1be1520, query=<value optimized out>)
    at /home/languitar/workspace/digiKam/digikam/databaseguierrorhandler.cpp:216
#28 0x00007f2af7d010af in Digikam::DatabaseCoreBackendPrivate::checkDatabaseError (this=0x1be1520, query=...)
    at /home/languitar/workspace/digiKam/libs/database/databasecorebackend.cpp:349
#29 0x00007f2af7d01fc5 in Digikam::DatabaseCoreBackend::exec (this=0x1bc4710, query=...)
    at /home/languitar/workspace/digiKam/libs/database/databasecorebackend.cpp:916
#30 0x00007f2af7d02a54 in Digikam::DatabaseCoreBackend::execQuery (this=0x1bc4710, sql=<value optimized out>, boundValue1=..., boundValue2=...)
    at /home/languitar/workspace/digiKam/libs/database/databasecorebackend.cpp:755
#31 0x00007f2af7d02ac5 in Digikam::DatabaseCoreBackend::execSql (this=0x1bc4710, sql=<value optimized out>, boundValue1=<value optimized out>, 
    boundValue2=<value optimized out>, values=0x0, lastInsertId=0x0) at /home/languitar/workspace/digiKam/libs/database/databasecorebackend.cpp:702
#32 0x00007f2af77d3c31 in Digikam::AlbumDB::copyImageTags (this=0x1bedf30, srcId=<value optimized out>, dstId=46774)
    at /home/languitar/workspace/digiKam/libs/database/albumdb.cpp:3172
#33 0x00007f2af782b3c1 in Digikam::ImageScanner::copyProperties (source=46541, dest=46774)
    at /home/languitar/workspace/digiKam/libs/database/imagescanner.cpp:586
#34 0x000000000064ff37 in Digikam::ScanController::scanFileDirectlyCopyAttributes (this=0x1b77950, filePath=<value optimized out>, parentVersion=46541)
    at /home/languitar/workspace/digiKam/digikam/scancontroller.cpp:434
#35 0x000000000047fb0b in Digikam::ImageWindow::saveAsIsComplete (this=0x6be3a80)
    at /home/languitar/workspace/digiKam/utilities/imageeditor/editor/imagewindow.cpp:958
#36 0x00007f2af7e113f4 in Digikam::EditorWindow::movingSaveFileFinished (this=0x6be3a80, successful=<value optimized out>)
    at /home/languitar/workspace/digiKam/utilities/imageeditor/editor/editorwindow.cpp:1441
#37 0x00007f2af7e11807 in Digikam::EditorWindow::moveFile (this=0x6be3a80)
    at /home/languitar/workspace/digiKam/utilities/imageeditor/editor/editorwindow.cpp:1983
#38 0x00007f2af7e11af5 in Digikam::EditorWindow::slotSavingFinished (this=0x1b37f8c, filename=<value optimized out>, success=true)
    at /home/languitar/workspace/digiKam/utilities/imageeditor/editor/editorwindow.cpp:1471
#39 0x00007f2af7e1b06e in Digikam::EditorWindow::qt_metacall (this=0x6be3a80, _c=QMetaObject::InvokeMetaMethod, _id=<value optimized out>, _a=0x7fffc8ad5950)
    at /home/languitar/workspace/build/digiKam/digikam/editorwindow.moc:214
#40 0x0000000000480510 in Digikam::ImageWindow::qt_metacall (this=0x1b37f8c, _c=128, _id=1, _a=0xffffffffffffffff)
    at /home/languitar/workspace/build/digiKam/digikam/imagewindow.moc:126
#41 0x00007f2af452d4df in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/libQtCore.so.4
#42 0x00007f2af7e01666 in Digikam::Canvas::signalSavingFinished (this=0x1b37f8c, _t1=<value optimized out>, _t2=true)
    at /home/languitar/workspace/build/digiKam/digikam/canvas.moc:288
#43 0x00007f2af7e02dce in Digikam::Canvas::qt_metacall (this=0x64ab820, _c=QMetaObject::InvokeMetaMethod, _id=<value optimized out>, _a=0x7fffc8ad5aa0)
    at /home/languitar/workspace/build/digiKam/digikam/canvas.moc:181
#44 0x00007f2af452d4df in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/libQtCore.so.4
#45 0x00007f2af7df8d86 in Digikam::DImgInterface::signalImageSaved (this=0x1b37f8c, _t1=<value optimized out>, _t2=true)
    at /home/languitar/workspace/build/digiKam/digikam/dimginterface.moc:166
#46 0x00007f2af7df971c in Digikam::DImgInterface::slotImageSaved (this=0x3ebae10, filePath=..., success=true)
    at /home/languitar/workspace/digiKam/utilities/imageeditor/canvas/dimginterface.cpp:555
---Type <return> to continue, or q <return> to quit---
#47 0x00007f2af7dfa807 in Digikam::DImgInterface::qt_metacall (this=0x3ebae10, _c=QMetaObject::InvokeMetaMethod, _id=<value optimized out>, _a=0x7f2adc7a62a0)
    at /home/languitar/workspace/build/digiKam/digikam/dimginterface.moc:109
#48 0x00007f2af452a419 in QObject::event(QEvent*) () from /usr/lib/libQtCore.so.4
#49 0x00007f2af53d85ec in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#50 0x00007f2af53debdb in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#51 0x00007f2af6325256 in KApplication::notify(QObject*, QEvent*) () from /usr/lib/libkdeui.so.5
#52 0x00007f2af451a79c in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/libQtCore.so.4
#53 0x00007f2af451cf17 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /usr/lib/libQtCore.so.4
#54 0x00007f2af45440d3 in ?? () from /usr/lib/libQtCore.so.4
#55 0x00007f2aeff9bda2 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#56 0x00007f2aeff9fc18 in g_main_context_iterate () from /usr/lib/libglib-2.0.so.0
#57 0x00007f2aeff9fdcc in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#58 0x00007f2af4543c13 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#59 0x00007f2af5486d6e in ?? () from /usr/lib/libQtGui.so.4
#60 0x00007f2af45190c2 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#61 0x00007f2af451949c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#62 0x00007f2af451d1db in QCoreApplication::exec() () from /usr/lib/libQtCore.so.4
#63 0x00000000006ab30c in main (argc=<value optimized out>, argv=<value optimized out>) at /home/languitar/workspace/digiKam/digikam/main.cpp:196
Comment 5 Johannes Wienke 2010-04-08 21:30:31 UTC
Ok, even if digikam doesn't hang, this error message appears every time. Moreover the database connection is completely closed then without any user notification and suddenly there a no more albums and images visible in the album view.

First of all, the user should be notified that something bad has happened with the db connection and that this most likely doesn't mean any data loss.

Second, it shouldn't happen at all. ;)
Comment 6 Johannes Wienke 2010-04-10 19:46:26 UTC
This must be related to copying the tags because it doesn't happen if the source image has no tags assigned.
Comment 7 Marcel Wiesweg 2010-04-15 22:23:29 UTC
SVN commit 1115276 by mwiesweg:

The DatabaseErrorHandler is a great mechanism to give feedback to the user,
mostly in the case of a MySQL connection error.
It now came to be used a bit too often - for every db error that came along,
and in that case, disabling all subsequent db actions.

Move error classification to the backend. Use the error handler for connection
errors only, the code to display a message box is currently unused.
Tolerate the occasional SQL error (which should be debugged, but not impair
user experience).

Hope this fixes the problem. Johannes, can you test with your established testcase?

CCBUG: 233549

 M  +15 -17    digikam/databaseguierrorhandler.cpp  
 M  +2 -1      digikam/databaseguierrorhandler.h  
 M  +37 -11    libs/database/databasecorebackend.cpp  
 M  +5 -3      libs/database/databasecorebackend_p.h  
 M  +13 -2     libs/database/databaseerrorhandler.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1115276
Comment 8 Johannes Wienke 2010-04-15 23:30:41 UTC
Ok, now the database isn't disconnected. Should the SQL warning still be printed on the console? Because I can't find that message too.

Marcel, I could send you my db file if you want to.
Comment 9 Marcel Wiesweg 2010-04-17 12:43:07 UTC
The messages from DatabaseCoreBackendPrivate::debugOutputFailedQuery are gone?
I did not change that part as far as I know.
Comment 10 Johannes Wienke 2010-04-17 12:56:37 UTC
I cannot reproduce them. Or did they move to the new debug output are and are thus swallowed? Self-healing database ;)
Comment 11 Marcel Wiesweg 2010-04-17 15:59:16 UTC
I dont know. But the main part of this problem should be fixed.
Comment 12 Johannes Wienke 2010-05-08 18:07:48 UTC
Unfortunately this isn't fixed (anymore). Right now the same situation as described above happens again every time with these console messages:

digikam(20429)/digikam (core) Digikam::DatabaseCoreBackendPrivate::debugOutputFailedQuery: Failure executing query:
 "INSERT INTO ImageTags  (imageid, tagid) SELECT ?, tagid FROM ImageTags WHERE imageid=?;" 
Error messages: "constraint failed Unable to fetch row" 19 1 "constraint failed" "Unable to fetch row" QSqlError(-1, "", "") 
Bound values:  (QVariant(qlonglong, 47941) ,  QVariant(qlonglong, 47854) )
digikam(20429)/digikam (core) Digikam::DatabaseCoreBackendPrivate::debugOutputFailedQuery: Failure executing query:
 "INSERT INTO ImageTags  (imageid, tagid) SELECT ?, tagid FROM ImageTags WHERE imageid=?;" 
Error messages: "constraint failed Unable to fetch row" 19 1 "constraint failed" "Unable to fetch row" QSqlError(-1, "", "") 
Bound values:  (QVariant(qlonglong, 47941) ,  QVariant(qlonglong, 47854) )
Comment 13 Marcel Wiesweg 2010-05-17 21:20:36 UTC
Johannes, can you still reproduce after the recent fixes?
Comment 14 Johannes Wienke 2010-05-17 21:46:42 UTC
Hm, right now I can't, but what did you change on the database handling since I reopened the bug?
Comment 15 Marcel Wiesweg 2010-05-17 22:19:44 UTC
Various fixes on May 13 and 15. CC'ed to 235928. Can very well have fixed this problem.
Comment 16 Johannes Wienke 2010-05-17 22:21:43 UTC
Or not ;) This wasn't absolutely reproducible... So I can't tell right now.
Comment 17 caulier.gilles 2010-10-06 15:47:49 UTC
Johannes,

What's news there with current implementation from svn trunk ?

Gilles Caulier
Comment 18 Johannes Wienke 2010-10-06 16:00:40 UTC
Didn't find this again in the last time.