Bug 318873 - digiKam crashes when clicking on image in thumbnails [patch]
Summary: digiKam crashes when clicking on image in thumbnails [patch]
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Thumbs-Engine (show other bugs)
Version: 3.1.0
Platform: Compiled Sources Linux
: NOR crash
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-25 20:50 UTC by Simon Munton
Modified: 2017-07-28 15:04 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 4.0.0


Attachments
Patch to detach image data before replacing the image data in rotate function (1.01 KB, patch)
2013-04-26 06:25 UTC, Simon Munton
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Munton 2013-04-25 20:50:03 UTC
Clicking on an image in the thumbnails causes a crash. The image is displayed in portrait mode in the thumbnail window, i.e. needs rotation to display in correct orientation.

Running under gdb gives:
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fff08a37700 (LWP 12441)]
Digikam::ImageHistogram::calculate (this=0x5e0b8e0) at /home/simon/build/kde4/digikam-3.1.0/core/libs/dimg/filters/levels/imagehistogram.cpp:232
232                 blue  = data[i    ];
(gdb) print data
$1 = (const uchar * const) 0x7fff08a38010 <Address 0x7fff08a38010 out of bounds>
(gdb) print d->img.bits()
$2 = (uchar *) 
    0x7fff01239010
[data and d->img.bits() should be the same]

If I add a watch on the 'data' member stored in the DImg::Private member, the value of 'data' changes in DImg::rotate() rotate function.

It appears as though digikam is trying to rotate the image at the same time as computing the histogram; the rotate finishes first and deletes the 'data', which the histogram function is still using. The next access in the histogram function causes a segfault.

I believe the crash is an example of the comment #40 here: 
https://bugs.kde.org/show_bug.cgi?id=274555#c40

This crash also occurs on 3.2.0-beta1

Reproducible: Always

Steps to Reproduce:
1. Click on a portrait format image inthumbnail window
2.
3.
Actual Results:  
Digikam crashes

Expected Results:  
No crash

Application: digikam (3.1.0)
KDE Platform Version: 4.10.2 (Compiled from sources)
Qt Version: 4.8.4
Operating System: Linux 3.8.8 x86_64

-- Information about the crash:
<In detail, tell us what you were doing  when the application crashed.>

The crash can be reproduced every time.

-- Backtrace:
Application: digiKam (digikam), signal: Segmentation fault
Using host libthread_db library "/lib64/libthread_db.so.1".
[Current thread is 1 (Thread 0x7ff961e2f980 (LWP 16273))]

Thread 66 (Thread 0x7ff939616700 (LWP 16274)):
#0  0x00007ff959d5ca94 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007ff959ff989b in wait (time=18446744073709551615, this=0x25c09e0) at thread/qwaitcondition_unix.cpp:86
#2  QWaitCondition::wait (this=<optimized out>, mutex=0x25c08d8, time=18446744073709551615) at thread/qwaitcondition_unix.cpp:158
#3  0x00000000005dc788 in Digikam::ScanController::run (this=0x25c0670) at /home/simon/build/kde4/digikam-3.1.0/core/digikam/database/scancontroller.cpp:705
#4  0x00007ff959ff933c in QThreadPrivate::start (arg=0x25c0670) at thread/qthread_unix.cpp:338
#5  0x00007ff959d58eae in start_thread () from /lib64/libpthread.so.0
#6  0x00007ff958adffed in clone () from /lib64/libc.so.6

Thread 65 (Thread 0x7ff938e15700 (LWP 16275)):
#0  0x00007ff958ad74cf in poll () from /lib64/libc.so.6
#1  0x00007ff951002314 in g_main_context_iterate.isra.24 () from /usr/lib64/libglib-2.0.so.0
#2  0x00007ff951002434 in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#3  0x00007ff95a1239b6 in QEventDispatcherGlib::processEvents (this=0x7ff92c0008c0, flags=...) at kernel/qeventdispatcher_glib.cpp:426
#4  0x00007ff95a0f425f in QEventLoop::processEvents (this=this@entry=0x7ff938e14bd0, flags=...) at kernel/qeventloop.cpp:149
#5  0x00007ff95a0f44e8 in QEventLoop::exec (this=0x7ff938e14bd0, flags=...) at kernel/qeventloop.cpp:204
#6  0x00007ff959ff63b0 in QThread::exec (this=<optimized out>) at thread/qthread.cpp:550
#7  0x00007ff95a0d4c2f in QInotifyFileSystemWatcherEngine::run (this=0x25c2c30) at io/qfilesystemwatcher_inotify.cpp:256
#8  0x00007ff959ff933c in QThreadPrivate::start (arg=0x25c2c30) at thread/qthread_unix.cpp:338
#9  0x00007ff959d58eae in start_thread () from /lib64/libpthread.so.0
#10 0x00007ff958adffed in clone () from /lib64/libc.so.6

Thread 64 (Thread 0x7ff922748700 (LWP 16282)):
#0  0x00007ff959d5ce01 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007ff959ff97f7 in wait (time=30000, this=0x27101c0) at thread/qwaitcondition_unix.cpp:84
#2  QWaitCondition::wait (this=<optimized out>, mutex=0x25ee1c8, time=30000) at thread/qwaitcondition_unix.cpp:158
#3  0x00007ff959fed09f in QThreadPoolThread::run (this=0x51ff9e0) at concurrent/qthreadpool.cpp:141
#4  0x00007ff959ff933c in QThreadPrivate::start (arg=0x51ff9e0) at thread/qthread_unix.cpp:338
#5  0x00007ff959d58eae in start_thread () from /lib64/libpthread.so.0
#6  0x00007ff958adffed in clone () from /lib64/libc.so.6

Thread 63 (Thread 0x7ff923bd4700 (LWP 16283)):
#0  0x00007ff959d5ce01 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007ff959ff97f7 in wait (time=30000, this=0x27101c0) at thread/qwaitcondition_unix.cpp:84
#2  QWaitCondition::wait (this=<optimized out>, mutex=0x25ee1c8, time=30000) at thread/qwaitcondition_unix.cpp:158
#3  0x00007ff959fed09f in QThreadPoolThread::run (this=0x52ffa60) at concurrent/qthreadpool.cpp:141
#4  0x00007ff959ff933c in QThreadPrivate::start (arg=0x52ffa60) at thread/qthread_unix.cpp:338
#5  0x00007ff959d58eae in start_thread () from /lib64/libpthread.so.0
#6  0x00007ff958adffed in clone () from /lib64/libc.so.6

Thread 62 (Thread 0x7ff919e2d700 (LWP 16284)):
#0  0x00007ff959d5ce01 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007ff959ff97f7 in wait (time=30000, this=0x27101c0) at thread/qwaitcondition_unix.cpp:84
#2  QWaitCondition::wait (this=<optimized out>, mutex=0x25ee1c8, time=30000) at thread/qwaitcondition_unix.cpp:158
#3  0x00007ff959fed09f in QThreadPoolThread::run (this=0x52ffcf0) at concurrent/qthreadpool.cpp:141
#4  0x00007ff959ff933c in QThreadPrivate::start (arg=0x52ffcf0) at thread/qthread_unix.cpp:338
#5  0x00007ff959d58eae in start_thread () from /lib64/libpthread.so.0
#6  0x00007ff958adffed in clone () from /lib64/libc.so.6

Thread 61 (Thread 0x7ff91962c700 (LWP 16285)):
#0  0x00007ff959d5ce01 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007ff959ff97f7 in wait (time=30000, this=0x27101c0) at thread/qwaitcondition_unix.cpp:84
#2  QWaitCondition::wait (this=<optimized out>, mutex=0x25ee1c8, time=30000) at thread/qwaitcondition_unix.cpp:158
#3  0x00007ff959fed09f in QThreadPoolThread::run (this=0x5300100) at concurrent/qthreadpool.cpp:141
#4  0x00007ff959ff933c in QThreadPrivate::start (arg=0x5300100) at thread/qthread_unix.cpp:338
#5  0x00007ff959d58eae in start_thread () from /lib64/libpthread.so.0
#6  0x00007ff958adffed in clone () from /lib64/libc.so.6

Thread 60 (Thread 0x7ff918e2b700 (LWP 16286)):
[KCrash Handler]
#6  Digikam::ImageHistogram::calculate (this=0x6cc96c0) at /home/simon/build/kde4/digikam-3.1.0/core/libs/dimg/filters/levels/imagehistogram.cpp:232
#7  0x00007ff95ebae95e in Digikam::DynamicThread::DynamicThreadPriv::run (this=0x2c81df0) at /home/simon/build/kde4/digikam-3.1.0/core/libs/threads/dynamicthread.cpp:186
#8  0x00007ff959fecfad in QThreadPoolThread::run (this=0x5300530) at concurrent/qthreadpool.cpp:107
#9  0x00007ff959ff933c in QThreadPrivate::start (arg=0x5300530) at thread/qthread_unix.cpp:338
#10 0x00007ff959d58eae in start_thread () from /lib64/libpthread.so.0
#11 0x00007ff958adffed in clone () from /lib64/libc.so.6

Thread 59 (Thread 0x7ff91862a700 (LWP 16287)):
#0  0x00007ff959d5ce01 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007ff959ff97f7 in wait (time=30000, this=0x27101c0) at thread/qwaitcondition_unix.cpp:84
#2  QWaitCondition::wait (this=<optimized out>, mutex=0x25ee1c8, time=30000) at thread/qwaitcondition_unix.cpp:158
#3  0x00007ff959fed09f in QThreadPoolThread::run (this=0x5300960) at concurrent/qthreadpool.cpp:141
#4  0x00007ff959ff933c in QThreadPrivate::start (arg=0x5300960) at thread/qthread_unix.cpp:338
#5  0x00007ff959d58eae in start_thread () from /lib64/libpthread.so.0
#6  0x00007ff958adffed in clone () from /lib64/libc.so.6

Thread 58 (Thread 0x7ff917e29700 (LWP 16288)):
#0  0x00007ff959d5ce01 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007ff959ff97f7 in wait (time=30000, this=0x27101c0) at thread/qwaitcondition_unix.cpp:84
#2  QWaitCondition::wait (this=<optimized out>, mutex=0x25ee1c8, time=30000) at thread/qwaitcondition_unix.cpp:158
#3  0x00007ff959fed09f in QThreadPoolThread::run (this=0x5300d90) at concurrent/qthreadpool.cpp:141
#4  0x00007ff959ff933c in QThreadPrivate::start (arg=0x5300d90) at thread/qthread_unix.cpp:338
#5  0x00007ff959d58eae in start_thread () from /lib64/libpthread.so.0
#6  0x00007ff958adffed in clone () from /lib64/libc.so.6

Thread 57 (Thread 0x7ff8e7628700 (LWP 16289)):
#0  0x00007ff959d5ce01 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007ff959ff97f7 in wait (time=30000, this=0x27101c0) at thread/qwaitcondition_unix.cpp:84
#2  QWaitCondition::wait (this=<optimized out>, mutex=0x25ee1c8, time=30000) at thread/qwaitcondition_unix.cpp:158
#3  0x00007ff959fed09f in QThreadPoolThread::run (this=0x53011c0) at concurrent/qthreadpool.cpp:141
#4  0x00007ff959ff933c in QThreadPrivate::start (arg=0x53011c0) at thread/qthread_unix.cpp:338
#5  0x00007ff959d58eae in start_thread () from /lib64/libpthread.so.0
#6  0x00007ff958adffed in clone () from /lib64/libc.so.6

Thread 56 (Thread 0x7ff917628700 (LWP 16290)):
#0  0x00007ff959d5ce01 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007ff959ff97f7 in wait (time=30000, this=0x27101c0) at thread/qwaitcondition_unix.cpp:84
#2  QWaitCondition::wait (this=<optimized out>, mutex=0x25ee1c8, time=30000) at thread/qwaitcondition_unix.cpp:158
#3  0x00007ff959fed09f in QThreadPoolThread::run (this=0x53015d0) at concurrent/qthreadpool.cpp:141
#4  0x00007ff959ff933c in QThreadPrivate::start (arg=0x53015d0) at thread/qthread_unix.cpp:338
#5  0x00007ff959d58eae in start_thread () from /lib64/libpthread.so.0
#6  0x00007ff958adffed in clone () from /lib64/libc.so.6

Thread 55 (Thread 0x7ff916e27700 (LWP 16291)):
#0  0x00007ff959d5ce01 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007ff959ff97f7 in wait (time=30000, this=0x27101c0) at thread/qwaitcondition_unix.cpp:84
#2  QWaitCondition::wait (this=<optimized out>, mutex=0x25ee1c8, time=30000) at thread/qwaitcondition_unix.cpp:158
#3  0x00007ff959fed09f in QThreadPoolThread::run (this=0x5301a00) at concurrent/qthreadpool.cpp:141
#4  0x00007ff959ff933c in QThreadPrivate::start (arg=0x5301a00) at thread/qthread_unix.cpp:338
#5  0x00007ff959d58eae in start_thread () from /lib64/libpthread.so.0
#6  0x00007ff958adffed in clone () from /lib64/libc.so.6

Thread 54 (Thread 0x7ff916626700 (LWP 16292)):
#0  0x00007ff959d5ce01 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007ff959ff97f7 in wait (time=30000, this=0x27101c0) at thread/qwaitcondition_unix.cpp:84
#2  QWaitCondition::wait (this=<optimized out>, mutex=0x25ee1c8, time=30000) at thread/qwaitcondition_unix.cpp:158
#3  0x00007ff959fed09f in QThreadPoolThread::run (this=0x5301e30) at concurrent/qthreadpool.cpp:141
#4  0x00007ff959ff933c in QThreadPrivate::start (arg=0x5301e30) at thread/qthread_unix.cpp:338
#5  0x00007ff959d58eae in start_thread () from /lib64/libpthread.so.0
#6  0x00007ff958adffed in clone () from /lib64/libc.so.6

Thread 53 (Thread 0x7ff915e25700 (LWP 16293)):
#0  0x00007ff959d5ce01 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007ff959ff97f7 in wait (time=30000, this=0x27101c0) at thread/qwaitcondition_unix.cpp:84
#2  QWaitCondition::wait (this=<optimized out>, mutex=0x25ee1c8, time=30000) at thread/qwaitcondition_unix.cpp:158
#3  0x00007ff959fed09f in QThreadPoolThread::run (this=0x5302260) at concurrent/qthreadpool.cpp:141
#4  0x00007ff959ff933c in QThreadPrivate::start (arg=0x5302260) at thread/qthread_unix.cpp:338
#5  0x00007ff959d58eae in start_thread () from /lib64/libpthread.so.0
#6  0x00007ff958adffed in clone () from /lib64/libc.so.6

Thread 52 (Thread 0x7ff915624700 (LWP 16294)):
#0  0x00007ff959d5ce01 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007ff959ff97f7 in wait (time=30000, this=0x27101c0) at thread/qwaitcondition_unix.cpp:84
#2  QWaitCondition::wait (this=<optimized out>, mutex=0x25ee1c8, time=30000) at thread/qwaitcondition_unix.cpp:158
#3  0x00007ff959fed09f in QThreadPoolThread::run (this=0x5302690) at concurrent/qthreadpool.cpp:141
#4  0x00007ff959ff933c in QThreadPrivate::start (arg=0x5302690) at thread/qthread_unix.cpp:338
#5  0x00007ff959d58eae in start_thread () from /lib64/libpthread.so.0
#6  0x00007ff958adffed in clone () from /lib64/libc.so.6

Thread 51 (Thread 0x7ff914e23700 (LWP 16295)):
#0  0x00007ff959d5ce01 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007ff959ff97f7 in wait (time=30000, this=0x27101c0) at thread/qwaitcondition_unix.cpp:84
#2  QWaitCondition::wait (this=<optimized out>, mutex=0x25ee1c8, time=30000) at thread/qwaitcondition_unix.cpp:158
#3  0x00007ff959fed09f in QThreadPoolThread::run (this=0x5302ac0) at concurrent/qthreadpool.cpp:141
#4  0x00007ff959ff933c in QThreadPrivate::start (arg=0x5302ac0) at thread/qthread_unix.cpp:338
#5  0x00007ff959d58eae in start_thread () from /lib64/libpthread.so.0
#6  0x00007ff958adffed in clone () from /lib64/libc.so.6

Thread 50 (Thread 0x7ff90ffff700 (LWP 16296)):
[KCrash Handler]
#6  Digikam::ImageHistogram::calculate (this=0x6f2aad0) at /home/simon/build/kde4/digikam-3.1.0/core/libs/dimg/filters/levels/imagehistogram.cpp:232
#7  0x00007ff95ebae95e in Digikam::DynamicThread::DynamicThreadPriv::run (this=0x73653f0) at /home/simon/build/kde4/digikam-3.1.0/core/libs/threads/dynamicthread.cpp:186
#8  0x00007ff959fecfad in QThreadPoolThread::run (this=0x5302ef0) at concurrent/qthreadpool.cpp:107
#9  0x00007ff959ff933c in QThreadPrivate::start (arg=0x5302ef0) at thread/qthread_unix.cpp:338
#10 0x00007ff959d58eae in start_thread () from /lib64/libpthread.so.0
#11 0x00007ff958adffed in clone () from /lib64/libc.so.6

Thread 49 (Thread 0x7ff90f7fe700 (LWP 16297)):
#0  0x00007ff959d5ce01 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007ff959ff97f7 in wait (time=30000, this=0x27101c0) at thread/qwaitcondition_unix.cpp:84
#2  QWaitCondition::wait (this=<optimized out>, mutex=0x25ee1c8, time=30000) at thread/qwaitcondition_unix.cpp:158
#3  0x00007ff959fed09f in QThreadPoolThread::run (this=0x5303320) at concurrent/qthreadpool.cpp:141
#4  0x00007ff959ff933c in QThreadPrivate::start (arg=0x5303320) at thread/qthread_unix.cpp:338
#5  0x00007ff959d58eae in start_thread () from /lib64/libpthread.so.0
#6  0x00007ff958adffed in clone () from /lib64/libc.so.6

Thread 48 (Thread 0x7ff90effd700 (LWP 16298)):
#0  0x00007ff959d5ce01 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007ff959ff97f7 in wait (time=30000, this=0x27101c0) at thread/qwaitcondition_unix.cpp:84
#2  QWaitCondition::wait (this=<optimized out>, mutex=0x25ee1c8, time=30000) at thread/qwaitcondition_unix.cpp:158
#3  0x00007ff959fed09f in QThreadPoolThread::run (this=0x5303750) at concurrent/qthreadpool.cpp:141
#4  0x00007ff959ff933c in QThreadPrivate::start (arg=0x5303750) at thread/qthread_unix.cpp:338
#5  0x00007ff959d58eae in start_thread () from /lib64/libpthread.so.0
#6  0x00007ff958adffed in clone () from /lib64/libc.so.6

Thread 47 (Thread 0x7ff90e7fc700 (LWP 16299)):
#0  0x00007ff959d5ce01 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007ff959ff97f7 in wait (time=30000, this=0x27101c0) at thread/qwaitcondition_unix.cpp:84
#2  QWaitCondition::wait (this=<optimized out>, mutex=0x25ee1c8, time=30000) at thread/qwaitcondition_unix.cpp:158
#3  0x00007ff959fed09f in QThreadPoolThread::run (this=0x5303b80) at concurrent/qthreadpool.cpp:141
#4  0x00007ff959ff933c in QThreadPrivate::start (arg=0x5303b80) at thread/qthread_unix.cpp:338
#5  0x00007ff959d58eae in start_thread () from /lib64/libpthread.so.0
#6  0x00007ff958adffed in clone () from /lib64/libc.so.6

Thread 46 (Thread 0x7ff90dffb700 (LWP 16300)):
#0  0x00007ff959d5ce01 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007ff959ff97f7 in wait (time=30000, this=0x27101c0) at thread/qwaitcondition_unix.cpp:84
#2  QWaitCondition::wait (this=<optimized out>, mutex=0x25ee1c8, time=30000) at thread/qwaitcondition_unix.cpp:158
#3  0x00007ff959fed09f in QThreadPoolThread::run (this=0x53040c0) at concurrent/qthreadpool.cpp:141
#4  0x00007ff959ff933c in QThreadPrivate::start (arg=0x53040c0) at thread/qthread_unix.cpp:338
#5  0x00007ff959d58eae in start_thread () from /lib64/libpthread.so.0
#6  0x00007ff958adffed in clone () from /lib64/libc.so.6

Thread 45 (Thread 0x7ff90d7fa700 (LWP 16301)):
#0  0x00007ff959d5ce01 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007ff959ff97f7 in wait (time=30000, this=0x27101c0) at thread/qwaitcondition_unix.cpp:84
#2  QWaitCondition::wait (this=<optimized out>, mutex=0x25ee1c8, time=30000) at thread/qwaitcondition_unix.cpp:158
#3  0x00007ff959fed09f in QThreadPoolThread::run (this=0x53044d0) at concurrent/qthreadpool.cpp:141
#4  0x00007ff959ff933c in QThreadPrivate::start (arg=0x53044d0) at thread/qthread_unix.cpp:338
#5  0x00007ff959d58eae in start_thread () from /lib64/libpthread.so.0
#6  0x00007ff958adffed in clone () from /lib64/libc.so.6

Thread 44 (Thread 0x7ff90cff9700 (LWP 16302)):
#0  0x00007ff959d5ce01 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007ff959ff97f7 in wait (time=30000, this=0x27101c0) at thread/qwaitcondition_unix.cpp:84
#2  QWaitCondition::wait (this=<optimized out>, mutex=0x25ee1c8, time=30000) at thread/qwaitcondition_unix.cpp:158
#3  0x00007ff959fed09f in QThreadPoolThread::run (this=0x5304900) at concurrent/qthreadpool.cpp:141
#4  0x00007ff959ff933c in QThreadPrivate::start (arg=0x5304900) at thread/qthread_unix.cpp:338
#5  0x00007ff959d58eae in start_thread () from /lib64/libpthread.so.0
#6  0x00007ff958adffed in clone () from /lib64/libc.so.6

Thread 43 (Thread 0x7ff907fff700 (LWP 16303)):
#0  0x00007ff959d5ce01 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007ff959ff97f7 in wait (time=30000, this=0x27101c0) at thread/qwaitcondition_unix.cpp:84
#2  QWaitCondition::wait (this=<optimized out>, mutex=0x25ee1c8, time=30000) at thread/qwaitcondition_unix.cpp:158
#3  0x00007ff959fed09f in QThreadPoolThread::run (this=0x5304d30) at concurrent/qthreadpool.cpp:141
#4  0x00007ff959ff933c in QThreadPrivate::start (arg=0x5304d30) at thread/qthread_unix.cpp:338
#5  0x00007ff959d58eae in start_thread () from /lib64/libpthread.so.0
#6  0x00007ff958adffed in clone () from /lib64/libc.so.6

Thread 42 (Thread 0x7ff9077fe700 (LWP 16304)):
#0  0x00007ff959d5ce01 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007ff959ff97f7 in wait (time=30000, this=0x27101c0) at thread/qwaitcondition_unix.cpp:84
#2  QWaitCondition::wait (this=<optimized out>, mutex=0x25ee1c8, time=30000) at thread/qwaitcondition_unix.cpp:158
#3  0x00007ff959fed09f in QThreadPoolThread::run (this=0x4e5a340) at concurrent/qthreadpool.cpp:141
#4  0x00007ff959ff933c in QThreadPrivate::start (arg=0x4e5a340) at thread/qthread_unix.cpp:338
#5  0x00007ff959d58eae in start_thread () from /lib64/libpthread.so.0
#6  0x00007ff958adffed in clone () from /lib64/libc.so.6

Thread 41 (Thread 0x7ff906ffd700 (LWP 16305)):
#0  0x00007ff959d5ce01 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007ff959ff97f7 in wait (time=30000, this=0x27101c0) at thread/qwaitcondition_unix.cpp:84
#2  QWaitCondition::wait (this=<optimized out>, mutex=0x25ee1c8, time=30000) at thread/qwaitcondition_unix.cpp:158
#3  0x00007ff959fed09f in QThreadPoolThread::run (this=0x4e5a720) at concurrent/qthreadpool.cpp:141
#4  0x00007ff959ff933c in QThreadPrivate::start (arg=0x4e5a720) at thread/qthread_unix.cpp:338
#5  0x00007ff959d58eae in start_thread () from /lib64/libpthread.so.0
#6  0x00007ff958adffed in clone () from /lib64/libc.so.6

Thread 40 (Thread 0x7ff9067fc700 (LWP 16306)):
#0  0x00007ff959d5ce01 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007ff959ff97f7 in wait (time=30000, this=0x27101c0) at thread/qwaitcondition_unix.cpp:84
#2  QWaitCondition::wait (this=<optimized out>, mutex=0x25ee1c8, time=30000) at thread/qwaitcondition_unix.cpp:158
#3  0x00007ff959fed09f in QThreadPoolThread::run (this=0x4e5ab50) at concurrent/qthreadpool.cpp:141
#4  0x00007ff959ff933c in QThreadPrivate::start (arg=0x4e5ab50) at thread/qthread_unix.cpp:338
#5  0x00007ff959d58eae in start_thread () from /lib64/libpthread.so.0
#6  0x00007ff958adffed in clone () from /lib64/libc.so.6

Thread 39 (Thread 0x7ff905ffb700 (LWP 16307)):
#0  0x00007ff959d5ce01 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007ff959ff97f7 in wait (time=30000, this=0x27101c0) at thread/qwaitcondition_unix.cpp:84
#2  QWaitCondition::wait (this=<optimized out>, mutex=0x25ee1c8, time=30000) at thread/qwaitcondition_unix.cpp:158
#3  0x00007ff959fed09f in QThreadPoolThread::run (this=0x4e5af80) at concurrent/qthreadpool.cpp:141
#4  0x00007ff959ff933c in QThreadPrivate::start (arg=0x4e5af80) at thread/qthread_unix.cpp:338
#5  0x00007ff959d58eae in start_thread () from /lib64/libpthread.so.0
#6  0x00007ff958adffed in clone () from /lib64/libc.so.6

Thread 38 (Thread 0x7ff9057fa700 (LWP 16308)):
#0  0x00007ff959d5ce01 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007ff959ff97f7 in wait (time=30000, this=0x27101c0) at thread/qwaitcondition_unix.cpp:84
#2  QWaitCondition::wait (this=<optimized out>, mutex=0x25ee1c8, time=30000) at thread/qwaitcondition_unix.cpp:158
#3  0x00007ff959fed09f in QThreadPoolThread::run (this=0x4e5b3f0) at concurrent/qthreadpool.cpp:141
#4  0x00007ff959ff933c in QThreadPrivate::start (arg=0x4e5b3f0) at thread/qthread_unix.cpp:338
#5  0x00007ff959d58eae in start_thread () from /lib64/libpthread.so.0
#6  0x00007ff958adffed in clone () from /lib64/libc.so.6

Thread 37 (Thread 0x7ff904ff9700 (LWP 16309)):
#0  0x00007ff959d5ce01 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007ff959ff97f7 in wait (time=30000, this=0x27101c0) at thread/qwaitcondition_unix.cpp:84
#2  QWaitCondition::wait (this=<optimized out>, mutex=0x25ee1c8, time=30000) at thread/qwaitcondition_unix.cpp:158
#3  0x00007ff959fed09f in QThreadPoolThread::run (this=0x4e5b820) at concurrent/qthreadpool.cpp:141
#4  0x00007ff959ff933c in QThreadPrivate::start (arg=0x4e5b820) at thread/qthread_unix.cpp:338
#5  0x00007ff959d58eae in start_thread () from /lib64/libpthread.so.0
#6  0x00007ff958adffed in clone () from /lib64/libc.so.6

Thread 36 (Thread 0x7ff8fffff700 (LWP 16310)):
[KCrash Handler]
#6  Digikam::ImageHistogram::calculate (this=0x6cd2420) at /home/simon/build/kde4/digikam-3.1.0/core/libs/dimg/filters/levels/imagehistogram.cpp:232
#7  0x00007ff95ebae95e in Digikam::DynamicThread::DynamicThreadPriv::run (this=0x29afa20) at /home/simon/build/kde4/digikam-3.1.0/core/libs/threads/dynamicthread.cpp:186
#8  0x00007ff959fecfad in QThreadPoolThread::run (this=0x4e5bc50) at concurrent/qthreadpool.cpp:107
#9  0x00007ff959ff933c in QThreadPrivate::start (arg=0x4e5bc50) at thread/qthread_unix.cpp:338
#10 0x00007ff959d58eae in start_thread () from /lib64/libpthread.so.0
#11 0x00007ff958adffed in clone () from /lib64/libc.so.6

Thread 35 (Thread 0x7ff8ff7fe700 (LWP 16311)):
#0  0x00007ff959d5ce01 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007ff959ff97f7 in wait (time=30000, this=0x27101c0) at thread/qwaitcondition_unix.cpp:84
#2  QWaitCondition::wait (this=<optimized out>, mutex=0x25ee1c8, time=30000) at thread/qwaitcondition_unix.cpp:158
#3  0x00007ff959fed09f in QThreadPoolThread::run (this=0x4e5c080) at concurrent/qthreadpool.cpp:141
#4  0x00007ff959ff933c in QThreadPrivate::start (arg=0x4e5c080) at thread/qthread_unix.cpp:338
#5  0x00007ff959d58eae in start_thread () from /lib64/libpthread.so.0
#6  0x00007ff958adffed in clone () from /lib64/libc.so.6

Thread 34 (Thread 0x7ff8feffd700 (LWP 16312)):
#0  0x00007ff959d5ce01 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007ff959ff97f7 in wait (time=30000, this=0x27101c0) at thread/qwaitcondition_unix.cpp:84
#2  QWaitCondition::wait (this=<optimized out>, mutex=0x25ee1c8, time=30000) at thread/qwaitcondition_unix.cpp:158
#3  0x00007ff959fed09f in QThreadPoolThread::run (this=0x4e5c4b0) at concurrent/qthreadpool.cpp:141
#4  0x00007ff959ff933c in QThreadPrivate::start (arg=0x4e5c4b0) at thread/qthread_unix.cpp:338
#5  0x00007ff959d58eae in start_thread () from /lib64/libpthread.so.0
#6  0x00007ff958adffed in clone () from /lib64/libc.so.6

Thread 33 (Thread 0x7ff8fe7fc700 (LWP 16313)):
#0  0x00007ff959d5ce01 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007ff959ff97f7 in wait (time=30000, this=0x27101c0) at thread/qwaitcondition_unix.cpp:84
#2  QWaitCondition::wait (this=<optimized out>, mutex=0x25ee1c8, time=30000) at thread/qwaitcondition_unix.cpp:158
#3  0x00007ff959fed09f in QThreadPoolThread::run (this=0x4e5c8e0) at concurrent/qthreadpool.cpp:141
#4  0x00007ff959ff933c in QThreadPrivate::start (arg=0x4e5c8e0) at thread/qthread_unix.cpp:338
#5  0x00007ff959d58eae in start_thread () from /lib64/libpthread.so.0
#6  0x00007ff958adffed in clone () from /lib64/libc.so.6

Thread 32 (Thread 0x7ff8fdffb700 (LWP 16314)):
#0  0x00007ff959d5ce01 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007ff959ff97f7 in wait (time=30000, this=0x27101c0) at thread/qwaitcondition_unix.cpp:84
#2  QWaitCondition::wait (this=<optimized out>, mutex=0x25ee1c8, time=30000) at thread/qwaitcondition_unix.cpp:158
#3  0x00007ff959fed09f in QThreadPoolThread::run (this=0x4e5cd10) at concurrent/qthreadpool.cpp:141
#4  0x00007ff959ff933c in QThreadPrivate::start (arg=0x4e5cd10) at thread/qthread_unix.cpp:338
#5  0x00007ff959d58eae in start_thread () from /lib64/libpthread.so.0
#6  0x00007ff958adffed in clone () from /lib64/libc.so.6

Thread 31 (Thread 0x7ff87e236700 (LWP 16336)):
#0  0x00007ff958fc8fe6 in ?? () from /usr/lib64/libgomp.so.1
#1  0x00007ff958fc787e in ?? () from /usr/lib64/libgomp.so.1
#2  0x00007ff959d58eae in start_thread () from /lib64/libpthread.so.0
#3  0x00007ff958adffed in clone () from /lib64/libc.so.6

Thread 30 (Thread 0x7ff87da35700 (LWP 16337)):
#0  0x00007ff958fc8fe6 in ?? () from /usr/lib64/libgomp.so.1
#1  0x00007ff958fc787e in ?? () from /usr/lib64/libgomp.so.1
#2  0x00007ff959d58eae in start_thread () from /lib64/libpthread.so.0
#3  0x00007ff958adffed in clone () from /lib64/libc.so.6

Thread 29 (Thread 0x7ff87d234700 (LWP 16338)):
#0  0x00007ff958fc8fe6 in ?? () from /usr/lib64/libgomp.so.1
#1  0x00007ff958fc787e in ?? () from /usr/lib64/libgomp.so.1
#2  0x00007ff959d58eae in start_thread () from /lib64/libpthread.so.0
#3  0x00007ff958adffed in clone () from /lib64/libc.so.6

Thread 28 (Thread 0x7ff87ca33700 (LWP 16339)):
#0  0x00007ff958fc8fe6 in ?? () from /usr/lib64/libgomp.so.1
#1  0x00007ff958fc787e in ?? () from /usr/lib64/libgomp.so.1
#2  0x00007ff959d58eae in start_thread () from /lib64/libpthread.so.0
#3  0x00007ff958adffed in clone () from /lib64/libc.so.6

Thread 27 (Thread 0x7ff877fff700 (LWP 16340)):
#0  0x00007ff958fc8fe6 in ?? () from /usr/lib64/libgomp.so.1
#1  0x00007ff958fc787e in ?? () from /usr/lib64/libgomp.so.1
#2  0x00007ff959d58eae in start_thread () from /lib64/libpthread.so.0
#3  0x00007ff958adffed in clone () from /lib64/libc.so.6

Thread 26 (Thread 0x7ff8777fe700 (LWP 16341)):
#0  0x00007ff958fc8fe6 in ?? () from /usr/lib64/libgomp.so.1
#1  0x00007ff958fc787e in ?? () from /usr/lib64/libgomp.so.1
#2  0x00007ff959d58eae in start_thread () from /lib64/libpthread.so.0
#3  0x00007ff958adffed in clone () from /lib64/libc.so.6

Thread 25 (Thread 0x7ff876ffd700 (LWP 16342)):
#0  0x00007ff958fc8fe6 in ?? () from /usr/lib64/libgomp.so.1
#1  0x00007ff958fc787e in ?? () from /usr/lib64/libgomp.so.1
#2  0x00007ff959d58eae in start_thread () from /lib64/libpthread.so.0
#3  0x00007ff958adffed in clone () from /lib64/libc.so.6

Thread 24 (Thread 0x7ff87545a700 (LWP 16345)):
#0  0x00007ff959d5ce01 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007ff959ff97f7 in wait (time=30000, this=0x27101c0) at thread/qwaitcondition_unix.cpp:84
#2  QWaitCondition::wait (this=<optimized out>, mutex=0x25ee1c8, time=30000) at thread/qwaitcondition_unix.cpp:158
#3  0x00007ff959fed09f in QThreadPoolThread::run (this=0x73651f0) at concurrent/qthreadpool.cpp:141
#4  0x00007ff959ff933c in QThreadPrivate::start (arg=0x73651f0) at thread/qthread_unix.cpp:338
#5  0x00007ff959d58eae in start_thread () from /lib64/libpthread.so.0
#6  0x00007ff958adffed in clone () from /lib64/libc.so.6

Thread 23 (Thread 0x7ff874c59700 (LWP 16350)):
#0  0x00007ff958fc8fe6 in ?? () from /usr/lib64/libgomp.so.1
#1  0x00007ff958fc787e in ?? () from /usr/lib64/libgomp.so.1
#2  0x00007ff959d58eae in start_thread () from /lib64/libpthread.so.0
#3  0x00007ff958adffed in clone () from /lib64/libc.so.6

Thread 22 (Thread 0x7ff86d238700 (LWP 16351)):
#0  0x00007ff958fc8fe6 in ?? () from /usr/lib64/libgomp.so.1
#1  0x00007ff958fc787e in ?? () from /usr/lib64/libgomp.so.1
#2  0x00007ff959d58eae in start_thread () from /lib64/libpthread.so.0
#3  0x00007ff958adffed in clone () from /lib64/libc.so.6

Thread 21 (Thread 0x7ff86ca37700 (LWP 16352)):
#0  0x00007ff958fc8fe6 in ?? () from /usr/lib64/libgomp.so.1
#1  0x00007ff958fc787e in ?? () from /usr/lib64/libgomp.so.1
#2  0x00007ff959d58eae in start_thread () from /lib64/libpthread.so.0
#3  0x00007ff958adffed in clone () from /lib64/libc.so.6

Thread 20 (Thread 0x7ff867fff700 (LWP 16353)):
#0  0x00007ff958fc8fe6 in ?? () from /usr/lib64/libgomp.so.1
#1  0x00007ff958fc787e in ?? () from /usr/lib64/libgomp.so.1
#2  0x00007ff959d58eae in start_thread () from /lib64/libpthread.so.0
#3  0x00007ff958adffed in clone () from /lib64/libc.so.6

Thread 19 (Thread 0x7ff8677fe700 (LWP 16354)):
#0  0x00007ff958fc8fe6 in ?? () from /usr/lib64/libgomp.so.1
#1  0x00007ff958fc787e in ?? () from /usr/lib64/libgomp.so.1
#2  0x00007ff959d58eae in start_thread () from /lib64/libpthread.so.0
#3  0x00007ff958adffed in clone () from /lib64/libc.so.6

Thread 18 (Thread 0x7ff866ffd700 (LWP 16355)):
#0  0x00007ff958fc8fe6 in ?? () from /usr/lib64/libgomp.so.1
#1  0x00007ff958fc787e in ?? () from /usr/lib64/libgomp.so.1
#2  0x00007ff959d58eae in start_thread () from /lib64/libpthread.so.0
#3  0x00007ff958adffed in clone () from /lib64/libc.so.6

Thread 17 (Thread 0x7ff8667fc700 (LWP 16356)):
#0  0x00007ff958fc8fe6 in ?? () from /usr/lib64/libgomp.so.1
#1  0x00007ff958fc787e in ?? () from /usr/lib64/libgomp.so.1
#2  0x00007ff959d58eae in start_thread () from /lib64/libpthread.so.0
#3  0x00007ff958adffed in clone () from /lib64/libc.so.6

Thread 16 (Thread 0x7ff865ffb700 (LWP 16357)):
#0  0x00007ff958fc8fe6 in ?? () from /usr/lib64/libgomp.so.1
#1  0x00007ff958fc787e in ?? () from /usr/lib64/libgomp.so.1
#2  0x00007ff959d58eae in start_thread () from /lib64/libpthread.so.0
#3  0x00007ff958adffed in clone () from /lib64/libc.so.6

Thread 15 (Thread 0x7ff8657fa700 (LWP 16358)):
#0  0x00007ff958fc8fe6 in ?? () from /usr/lib64/libgomp.so.1
#1  0x00007ff958fc787e in ?? () from /usr/lib64/libgomp.so.1
#2  0x00007ff959d58eae in start_thread () from /lib64/libpthread.so.0
#3  0x00007ff958adffed in clone () from /lib64/libc.so.6

Thread 14 (Thread 0x7ff864ff9700 (LWP 16359)):
#0  0x00007ff958fc8fe6 in ?? () from /usr/lib64/libgomp.so.1
#1  0x00007ff958fc787e in ?? () from /usr/lib64/libgomp.so.1
#2  0x00007ff959d58eae in start_thread () from /lib64/libpthread.so.0
#3  0x00007ff958adffed in clone () from /lib64/libc.so.6

Thread 13 (Thread 0x7ff857fff700 (LWP 16360)):
#0  0x00007ff958fc8fe6 in ?? () from /usr/lib64/libgomp.so.1
#1  0x00007ff958fc787e in ?? () from /usr/lib64/libgomp.so.1
#2  0x00007ff959d58eae in start_thread () from /lib64/libpthread.so.0
#3  0x00007ff958adffed in clone () from /lib64/libc.so.6

Thread 12 (Thread 0x7ff8577fe700 (LWP 16361)):
#0  0x00007ff958fc8fe6 in ?? () from /usr/lib64/libgomp.so.1
#1  0x00007ff958fc787e in ?? () from /usr/lib64/libgomp.so.1
#2  0x00007ff959d58eae in start_thread () from /lib64/libpthread.so.0
#3  0x00007ff958adffed in clone () from /lib64/libc.so.6

Thread 11 (Thread 0x7ff856ffd700 (LWP 16362)):
#0  0x00007ff958fc8fe6 in ?? () from /usr/lib64/libgomp.so.1
#1  0x00007ff958fc787e in ?? () from /usr/lib64/libgomp.so.1
#2  0x00007ff959d58eae in start_thread () from /lib64/libpthread.so.0
#3  0x00007ff958adffed in clone () from /lib64/libc.so.6

Thread 10 (Thread 0x7ff8567fc700 (LWP 16363)):
#0  0x00007ff958fc8fe6 in ?? () from /usr/lib64/libgomp.so.1
#1  0x00007ff958fc787e in ?? () from /usr/lib64/libgomp.so.1
#2  0x00007ff959d58eae in start_thread () from /lib64/libpthread.so.0
#3  0x00007ff958adffed in clone () from /lib64/libc.so.6

Thread 9 (Thread 0x7ff855ffb700 (LWP 16364)):
#0  0x00007ff958fc8fe6 in ?? () from /usr/lib64/libgomp.so.1
#1  0x00007ff958fc787e in ?? () from /usr/lib64/libgomp.so.1
#2  0x00007ff959d58eae in start_thread () from /lib64/libpthread.so.0
#3  0x00007ff958adffed in clone () from /lib64/libc.so.6

Thread 8 (Thread 0x7ff8557fa700 (LWP 16365)):
#0  0x00007ff958fc8fe6 in ?? () from /usr/lib64/libgomp.so.1
#1  0x00007ff958fc787e in ?? () from /usr/lib64/libgomp.so.1
#2  0x00007ff959d58eae in start_thread () from /lib64/libpthread.so.0
#3  0x00007ff958adffed in clone () from /lib64/libc.so.6

Thread 7 (Thread 0x7ff854ff9700 (LWP 16366)):
#0  0x00007ff958fc8fe6 in ?? () from /usr/lib64/libgomp.so.1
#1  0x00007ff958fc787e in ?? () from /usr/lib64/libgomp.so.1
#2  0x00007ff959d58eae in start_thread () from /lib64/libpthread.so.0
#3  0x00007ff958adffed in clone () from /lib64/libc.so.6

Thread 6 (Thread 0x7ff83ffff700 (LWP 16367)):
#0  0x00007ff958fc8fe6 in ?? () from /usr/lib64/libgomp.so.1
#1  0x00007ff958fc787e in ?? () from /usr/lib64/libgomp.so.1
#2  0x00007ff959d58eae in start_thread () from /lib64/libpthread.so.0
#3  0x00007ff958adffed in clone () from /lib64/libc.so.6

Thread 5 (Thread 0x7ff83f7fe700 (LWP 16368)):
#0  0x00007ff958fc8fe6 in ?? () from /usr/lib64/libgomp.so.1
#1  0x00007ff958fc787e in ?? () from /usr/lib64/libgomp.so.1
#2  0x00007ff959d58eae in start_thread () from /lib64/libpthread.so.0
#3  0x00007ff958adffed in clone () from /lib64/libc.so.6

Thread 4 (Thread 0x7ff83effd700 (LWP 16369)):
#0  0x00007ff958fc8fe6 in ?? () from /usr/lib64/libgomp.so.1
#1  0x00007ff958fc787e in ?? () from /usr/lib64/libgomp.so.1
#2  0x00007ff959d58eae in start_thread () from /lib64/libpthread.so.0
#3  0x00007ff958adffed in clone () from /lib64/libc.so.6

Thread 3 (Thread 0x7ff83e7fc700 (LWP 16370)):
#0  0x00007ff958fc8fe6 in ?? () from /usr/lib64/libgomp.so.1
#1  0x00007ff958fc787e in ?? () from /usr/lib64/libgomp.so.1
#2  0x00007ff959d58eae in start_thread () from /lib64/libpthread.so.0
#3  0x00007ff958adffed in clone () from /lib64/libc.so.6

Thread 2 (Thread 0x7ff83dffb700 (LWP 16372)):
[KCrash Handler]
#6  Digikam::ImageHistogram::calculate (this=0x6d19dc0) at /home/simon/build/kde4/digikam-3.1.0/core/libs/dimg/filters/levels/imagehistogram.cpp:232
#7  0x00007ff95ebae95e in Digikam::DynamicThread::DynamicThreadPriv::run (this=0x75862a0) at /home/simon/build/kde4/digikam-3.1.0/core/libs/threads/dynamicthread.cpp:186
#8  0x00007ff959fecfad in QThreadPoolThread::run (this=0x7235bd0) at concurrent/qthreadpool.cpp:107
#9  0x00007ff959ff933c in QThreadPrivate::start (arg=0x7235bd0) at thread/qthread_unix.cpp:338
#10 0x00007ff959d58eae in start_thread () from /lib64/libpthread.so.0
#11 0x00007ff958adffed in clone () from /lib64/libc.so.6

Thread 1 (Thread 0x7ff961e2f980 (LWP 16273)):
#0  0x00007ff959d5ca94 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007ff959ff989b in wait (time=18446744073709551615, this=0x26cfe50) at thread/qwaitcondition_unix.cpp:86
#2  QWaitCondition::wait (this=<optimized out>, mutex=0x25ee1c8, time=18446744073709551615) at thread/qwaitcondition_unix.cpp:158
#3  0x00007ff959fec77f in QThreadPoolPrivate::waitForDone (this=0x25ee140, msecs=msecs@entry=-1) at concurrent/qthreadpool.cpp:298
#4  0x00007ff959fee22d in QThreadPool::~QThreadPool (this=0x26d1250, __in_chrg=<optimized out>) at concurrent/qthreadpool.cpp:440
#5  0x00007ff959fee269 in QThreadPool::~QThreadPool (this=0x26d1250, __in_chrg=<optimized out>) at concurrent/qthreadpool.cpp:442
#6  0x00007ff95a107b32 in QObjectPrivate::deleteChildren (this=this@entry=0x26d0de0) at kernel/qobject.cpp:1907
#7  0x00007ff95a10b9b6 in QObject::~QObject (this=0x2679370, __in_chrg=<optimized out>) at kernel/qobject.cpp:926
#8  0x00007ff95ebab7a7 in ~ThreadManagerCreator (this=0x2679370, __in_chrg=<optimized out>) at /home/simon/build/kde4/digikam-3.1.0/core/libs/threads/threadmanager.cpp:236
#9  destroy () at /home/simon/build/kde4/digikam-3.1.0/core/libs/threads/threadmanager.cpp:241
#10 0x00007ff958a23c71 in __run_exit_handlers () from /lib64/libc.so.6
#11 0x00007ff958a23cf5 in exit () from /lib64/libc.so.6
#12 0x00007ff95adefe48 in qt_xio_errhandler () at kernel/qapplication_x11.cpp:772
#13 0x00007ff95bab4fd8 in KApplication::xioErrhandler (this=0x7fff63906a20, dpy=0x23d11d0) at /home/simon/build/kde4/kdelibs-4.10.2/kdeui/kernel/kapplication.cpp:419
#14 0x00007ff955edccee in _XIOError () from /usr/lib64/libX11.so.6
#15 0x00007ff955edad6c in _XReply () from /usr/lib64/libX11.so.6
#16 0x00007ff955ed656d in XSync () from /usr/lib64/libX11.so.6
#17 0x00007ff95af7da05 in syncX (this=0x2683e00) at painting/qwindowsurface_raster.cpp:134
#18 QRasterWindowSurface::syncX (this=0x2683e00) at painting/qwindowsurface_raster.cpp:130
#19 0x00007ff95af7df01 in QRasterWindowSurface::beginPaint (this=0x2683e00, rgn=...) at painting/qwindowsurface_raster.cpp:143
#20 0x00007ff95af9a8c2 in QWidgetBackingStore::sync (this=0x2683da0) at painting/qbackingstore.cpp:1304
#21 0x00007ff95adc6390 in QWidgetPrivate::syncBackingStore (this=this@entry=0x24f9080) at kernel/qwidget.cpp:1896
#22 0x00007ff95add5fd4 in QWidget::event (this=0x25d4250, event=0x62f0e50) at kernel/qwidget.cpp:8679
#23 0x00007ff95b198afb in QMainWindow::event (this=0x25d4250, event=0x62f0e50) at widgets/qmainwindow.cpp:1478
#24 0x00007ff95bba8158 in KXmlGuiWindow::event (this=0x25d4250, ev=0x62f0e50) at /home/simon/build/kde4/kdelibs-4.10.2/kdeui/xmlgui/kxmlguiwindow.cpp:126
#25 0x00007ff95ad8628c in QApplicationPrivate::notify_helper (this=this@entry=0x23a9000, receiver=receiver@entry=0x25d4250, e=e@entry=0x62f0e50) at kernel/qapplication.cpp:4562
#26 0x00007ff95ad8a70a in QApplication::notify (this=0x7fff63906a20, receiver=0x25d4250, e=0x62f0e50) at kernel/qapplication.cpp:4423
#27 0x00007ff95bab61c6 in KApplication::notify (this=0x7fff63906a20, receiver=0x25d4250, event=0x62f0e50) at /home/simon/build/kde4/kdelibs-4.10.2/kdeui/kernel/kapplication.cpp:311
#28 0x00007ff95a0f550e in QCoreApplication::notifyInternal (this=0x7fff63906a20, receiver=receiver@entry=0x25d4250, event=event@entry=0x62f0e50) at kernel/qcoreapplication.cpp:946
#29 0x00007ff95a0f8e71 in sendEvent (event=0x62f0e50, receiver=0x25d4250) at kernel/qcoreapplication.h:231
#30 QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x2334450) at kernel/qcoreapplication.cpp:1570
#31 0x00007ff95a123803 in sendPostedEvents () at kernel/qcoreapplication.h:236
#32 postEventSourceDispatch (s=0x23a9ad0) at kernel/qeventdispatcher_glib.cpp:279
#33 0x00007ff951002045 in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0
#34 0x00007ff951002378 in g_main_context_iterate.isra.24 () from /usr/lib64/libglib-2.0.so.0
#35 0x00007ff951002434 in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#36 0x00007ff95a123996 in QEventDispatcherGlib::processEvents (this=0x23a84e0, flags=...) at kernel/qeventdispatcher_glib.cpp:424
#37 0x00007ff95ae263ee in QGuiEventDispatcherGlib::processEvents (this=<optimized out>, flags=...) at kernel/qguieventdispatcher_glib.cpp:204
#38 0x00007ff95a0f425f in QEventLoop::processEvents (this=this@entry=0x7fff63906410, flags=...) at kernel/qeventloop.cpp:149
#39 0x00007ff95a0f44e8 in QEventLoop::exec (this=0x7fff63906410, flags=...) at kernel/qeventloop.cpp:204
#40 0x00007ff95a0f9188 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1218
#41 0x000000000049be82 in main (argc=1, argv=0x7fff63906c58) at /home/simon/build/kde4/digikam-3.1.0/core/digikam/main/main.cpp:235
Comment 1 Simon Munton 2013-04-25 21:07:15 UTC
Added a call to detach() just before all occurences of
delete [] m_priv->data;
in the DImg::rotate() function; so far I haven't been able to reproduce the crash.
Comment 2 caulier.gilles 2013-04-26 05:02:56 UTC
Simon,

Can you provide a patch please.

http://www.digikam.org/contrib

Thanks in advance

Gilles Caulier
Comment 3 Simon Munton 2013-04-26 06:25:05 UTC
Created attachment 79453 [details]
Patch to detach image data before replacing the image data in rotate function

Attached patch adds the call to detach just before the old data is deleted.

This is not the most efficient way, as the image data is copied (if necessary) in the detach function, and then immediately discarded after the return from detach.

There is also the chance that between the call to detach and the data being replaced that another thread could make a copy of the Dimg and have a pointer to the deleted data .
Comment 4 caulier.gilles 2013-04-26 06:55:04 UTC
Question : 

- When you clic on thumbnail, do you press rotation button as well ?
- Do you have any process in background which change image data (as from Batch Queue Manager) ?

Gilles Caulier
Comment 5 Simon Munton 2013-04-26 16:24:29 UTC
No, I'm not pressing the rotation button
No, there is no background process changing image data.

The images were imported from my camera a week ago, some were taken in portrait mode. I start digikam, scroll down the thumbnail page and click on the image. Digikam crashes.

What I have just noticed is that after clicking on the rotate left and then rotate right in the thumbnail page, the crash doesn't occur for that image, even after restarting digikam. It does still crash on other images though.
Comment 6 caulier.gilles 2013-04-26 16:42:07 UTC
If you don't press on Rotation action, why image is rotated in background ?

I would to identify the condition where concurrent threads appear using image data between rotation and histogram.

I would to reproduce the problem here. Currently i cannot.

Gilles Caulier
Comment 7 Marcel Wiesweg 2013-04-26 17:35:23 UTC
It is true the DImg is not implicitly but explicitly shared (=> does not automatically detach when calling a non-const method) so the scenario is indeed one we need to care for.

My question is: from where it rotate() called? For exif-rotation of previews, it is called from the loading thread before it is distributed (previewtask.cpp 117)
For the image editor, it is also called before being distributed (editorcore.cpp 292).
I would like to fully understand this bug.
Comment 8 Simon Munton 2013-04-26 18:00:41 UTC
I assumed it was rotating the image to display it in the preview image page.

The exif data for an image that crashes shows: 
Orientation                     : Rotate 270 CW

After clicking the rotate buttons it changes to:
Orientation                     : Horizontal (normal)
and all the width/heights are swapped, and it doesn't crash any more.

If I put the crashing image in a subdirectory of it's own, it doesn't crash when clicked. If I then add another image to that directory, it does crash on click.
Comment 9 caulier.gilles 2013-04-26 18:09:37 UTC
>I assumed it was rotating the image to display it in the preview image page.

If you is in preview mode, you cannot use icon-view to scroll down. I don't understand. by preview do you mean Image Editor openned in a separated window ?

>If I put the crashing image in a subdirectory of it's own, it doesn't crash when clicked. If I then >add another image to that directory, it does crash on click.

I'm confuse. This behavior is done with your patch or not ? You click on what ? Rotation button ?

Gilles Caulier
Comment 10 Simon Munton 2013-04-26 18:16:30 UTC
(In reply to comment #9)
> >I assumed it was rotating the image to display it in the preview image page.
> 
> If you is in preview mode, you cannot use icon-view to scroll down. I don't
> understand. by preview do you mean Image Editor openned in a separated
> window ?

Click on the image in thumbnail mode, which should result in the preview mode opening and displaying image, but it crashes

> >If I put the crashing image in a subdirectory of it's own, it doesn't crash when clicked. If I then >add another image to that directory, it does crash on click.
> 
> I'm confuse. This behavior is done with your patch or not ? You click on
> what ? Rotation button ?
> 

This is without the patch. Two images in a directory in thumbnail mode, click on the second image to show in preview mode, crash.
Comment 11 caulier.gilles 2013-04-26 18:20:32 UTC
>Click on the image in thumbnail mode, which should result in the preview mode opening and >displaying image, but it crashes

Ok, now it's clear... I remember few other entries in this context.

So your Histogram view is open on the right side of preview. right ?

>This is without the patch. Two images in a directory in thumbnail mode, click on the second >image to show in preview mode, crash.

ok. Can you share on the web file which crash, to reproduce the problem on my computer ?

Q : which computer you use ? Which distro ? how many CPU and memory ?

Gilles Caulier
Comment 12 Simon Munton 2013-04-26 18:38:31 UTC
(In reply to comment #11)
 
> So your Histogram view is open on the right side of preview. right ?

No, histogram view is closed

> >This is without the patch. Two images in a directory in thumbnail mode, click on the second >image to show in preview mode, crash.
> 
> ok. Can you share on the web file which crash, to reproduce the problem on
> my computer ?

The two images here are the ones I had in a folder on their own:
https://www.dropbox.com/sh/zm9m92mqyqj4n6f/7XYty4SrNf

> Q : which computer you use ? Which distro ? how many CPU and memory ?

Home built, Slackware 64, Core i7, 8 cpu, 16GB. KDE 4.10.2 built from source.
Comment 13 Simon Munton 2013-04-26 19:04:09 UTC
(In reply to comment #7)
> My question is: from where it rotate() called? For exif-rotation of
> previews, it is called from the loading thread before it is distributed
> (previewtask.cpp 117)

Seems to be called from previewtask.cpp 186:
#0  0x00007ffff4aecc98 in Digikam::DImg::rotate (this=0x5b34cd0, angle=<optimized out>)
    at /home/simon/build/kde4/digikam-3.1.0/core/libs/dimg/dimg.cpp:2419
#1  0x00007ffff4aecf1a in Digikam::DImg::rotateAndFlip (this=0x5b34cd0, orientation=-1580573)
    at /home/simon/build/kde4/digikam-3.1.0/core/libs/dimg/dimg.cpp:2635
#2  0x00007ffff4c9c116 in Digikam::LoadSaveThread::exifRotate (image=..., filePath=...)
    at /home/simon/build/kde4/digikam-3.1.0/core/libs/threadimageio/loadsavethread.cpp:329
#3  0x00007ffff4cac9ee in Digikam::PreviewLoadingTask::execute (this=0x5b34ad0)
    at /home/simon/build/kde4/digikam-3.1.0/core/libs/threadimageio/previewtask.cpp:186
#4  0x00007ffff4c9beae in Digikam::LoadSaveThread::run (this=0x120aca0)
    at /home/simon/build/kde4/digikam-3.1.0/core/libs/threadimageio/loadsavethread.cpp:136
#5  0x00007ffff4cd495e in Digikam::DynamicThread::DynamicThreadPriv::run (this=0x120ada0)
    at /home/simon/build/kde4/digikam-3.1.0/core/libs/threads/dynamicthread.cpp:186
#6  0x00007ffff0112fad in QThreadPoolThread::run (this=0x3964550) at concurrent/qthreadpool.cpp:107
#7  0x00007ffff011f33c in QThreadPrivate::start (arg=0x3964550) at thread/qthread_unix.cpp:338
#8  0x00007fffefe7eeae in start_thread () from /lib64/libpthread.so.0
#9  0x00007fffeec05fed in clone () from /lib64/libc.so.6
for this (rotate) thread: 
print m_priv.d->data
$20 = (unsigned char *) 
    0x7fff25dc3010 

While in another thread:
#0  Digikam::ImageHistogram::calculate (this=0x5a72ef0)
    at /home/simon/build/kde4/digikam-3.1.0/core/libs/dimg/filters/levels/imagehistogram.cpp:164
#1  0x00007ffff4cd495e in Digikam::DynamicThread::DynamicThreadPriv::run (this=0x4692bc0)
    at /home/simon/build/kde4/digikam-3.1.0/core/libs/threads/dynamicthread.cpp:186
#2  0x00007ffff0112fad in QThreadPoolThread::run (this=0x39460b0) at concurrent/qthreadpool.cpp:107
#3  0x00007ffff011f33c in QThreadPrivate::start (arg=0x39460b0) at thread/qthread_unix.cpp:338
#4  0x00007fffefe7eeae in start_thread () from /lib64/libpthread.so.0
#5  0x00007fffeec05fed in clone () from /lib64/libc.so.6
in this (histogram) thread:
print d.img.m_priv.d->data
$21 = (unsigned char *) 
    0x7fff25dc3010

So both threads are processing the same image data.

If I let the program continue, I end up with a total of four threads all calculating the histogram on the same image data.
Comment 14 caulier.gilles 2013-04-26 20:40:22 UTC
But typically, as i remember, histogram are only computed if right sidebar is open and histogram view is selected. Why ? To reduce CPU consumption... No need to compute an histogram is this one no need to be displayed...

Why histogram is computed here in this case ?

Of course the dysfunction still valid if all conditions are true...

Gilles Caulier
Comment 15 Simon Munton 2013-04-27 19:04:06 UTC
(In reply to comment #14)
> But typically, as i remember, histogram are only computed if right sidebar
> is open and histogram view is selected. Why ? To reduce CPU consumption...
> No need to compute an histogram is this one no need to be displayed...
> 
> Why histogram is computed here in this case ?

After clicking on the image in the thumbnail mode, Digikam::ImagePropertiesColorsTab::slotLoadImageFromUrlComplete is called which then recomputes the histogram (imagepropertiescolorstab.cpp:498) 4 times, once for each histogram widget.
Comment 16 caulier.gilles 2013-10-30 15:46:08 UTC
Marcel,

In all case, this patch is not too intrusive and easy to review.

What do you think about to apply against git /master if this one can reduce crashes ? It's acceptable or not ?

Best

Gilles Caulier
Comment 17 Marcel Wiesweg 2013-10-31 21:02:07 UTC
Simon, are you available for a small test (it is you who can reliably reproduce this crash)
i have an interesting idea: I believe the histogram loads the image, then the histogram is computed. During that time the preview task takes the data from the cache but may not copy it. The preview is rotated in the PreviewTask. That fits well with your backtraces.
This could be a subtle, difficult to spot bug explaining some of our crashes.

Can you test if this fixes your problem instead of your proposed patch?

diff --git a/libs/threadimageio/previewtask.cpp b/libs/threadimageio/previewtask.cpp
index 5bb39fa..9763a34 100644
--- a/libs/threadimageio/previewtask.cpp
+++ b/libs/threadimageio/previewtask.cpp
@@ -104,10 +104,10 @@ void PreviewLoadingTask::execute()
             // image is found in image cache, loading is successful
             m_img = *cachedImg;
 
-            if (accessMode() == LoadSaveThread::AccessModeReadWrite)
-            {
+            //if (accessMode() == LoadSaveThread::AccessModeReadWrite)
+            //{
                 m_img = m_img.copy();
-            }
+            //}
 
             // rotate if needed - images are unrotated in the cache,
             // except for RAW images, which are already rotated by dcraw.
Comment 18 Simon Munton 2013-11-03 10:41:58 UTC
Marcel,
I've tried to reproduce the failure, so far with no success. I tried latest git, 3.5.0 and 3.1.0 (which is where I first saw the problem). 
Since reporting the bug, I am now running later versions of KDE(4.11.2), Qt (4.8.5), Kernel (3.11.6) so perhaps there was some subtle interaction there.
Comment 19 Marcel Wiesweg 2013-11-04 18:48:04 UTC
Git commit 1872bd95d4d3d706b31b5039e679d6529923859d by Marcel Wiesweg.
Committed on 04/11/2013 at 18:37.
Pushed by mwiesweg into branch 'master'.

Ensure to use a copy of an image in a load thread if the thread only requests
read-only, but exif rotation / post processing require modification of data from the cache.
This is meant to fix all mysterious crashes in the ImageHistogram calculation.
(as I cannot reproduce the bug, I cannot prove it is a fix)

Thanks to Simon Munton for his investigations.

M  +8    -2    libs/threadimageio/loadsavethread.cpp
M  +1    -0    libs/threadimageio/loadsavethread.h
M  +9    -3    libs/threadimageio/previewtask.cpp

http://commits.kde.org/digikam/1872bd95d4d3d706b31b5039e679d6529923859d
Comment 20 caulier.gilles 2013-11-04 21:29:38 UTC
Simon,

Can you checkout code from git/master including last commit from Marcel (see comment #19) and check if crash still reproducible or not ?

Thanks in advance

Gilles Caulier
Comment 21 Simon Munton 2013-11-05 21:52:21 UTC
I've tried latest git, I'm unable to reproduce crash.