Bug 254679

Summary: Crash when closign digikam while filter active
Product: [Applications] digikam Reporter: Johannes Wienke <languitar>
Component: Plugin-Editor-NoiseReductionAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: crash CC: caulier.gilles
Priority: NOR    
Version: 1.5.0   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In: 1.6.0
Sentry Crash Report:

Description Johannes Wienke 2010-10-19 20:36:17 UTC
Application: digikam (1.5.0 (rev.: 1169050))
KDE Platform Version: 4.5.2 (KDE 4.5.2)
Qt Version: 4.7.0
Operating System: Linux 2.6.35-ARCH x86_64
Distribution (Platform): Archlinux Packages

-- Information about the crash:
- What I was doing when the application crashed:

Closed digikam while a filter in the editor was active (Wavelet Denoise). It seems the filter is not cancelled if the main windows is closed.

-- Backtrace:
Application: digiKam (digikam), signal: Aborted
[Current thread is 1 (Thread 0x7f0a3930f7c0 (LWP 2573))]

Thread 17 (Thread 0x7f0a21d6a710 (LWP 2574)):
#0  0x00007f0a3222c40c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#1  0x00007f0a324b0b8b in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/libQtCore.so.4
#2  0x000000000061f1d4 in Digikam::ScanController::run (this=0x116fdb0) at /home/languitar/workspace/digiKam/digikam/scancontroller.cpp:515
#3  0x00007f0a324b049e in ?? () from /usr/lib/libQtCore.so.4
#4  0x00007f0a32227cb0 in start_thread () from /lib/libpthread.so.0
#5  0x00007f0a30cdd9fd in clone () from /lib/libc.so.6
#6  0x0000000000000000 in ?? ()

Thread 16 (Thread 0x7f0a21569710 (LWP 2576)):
#0  0x00007fffb1bff861 in clock_gettime ()
#1  0x00007f0a295dbdcb in clock_gettime () from /lib/librt.so.1
#2  0x00007f0a325014bf in ?? () from /usr/lib/libQtCore.so.4
#3  0x00007f0a325c495d in ?? () from /usr/lib/libQtCore.so.4
#4  0x00007f0a325c4ce5 in ?? () from /usr/lib/libQtCore.so.4
#5  0x00007f0a325c376c in ?? () from /usr/lib/libQtCore.so.4
#6  0x00007f0a325c3815 in ?? () from /usr/lib/libQtCore.so.4
#7  0x00007f0a2da0a0df in g_main_context_prepare () from /usr/lib/libglib-2.0.so.0
#8  0x00007f0a2da0afc9 in ?? () from /usr/lib/libglib-2.0.so.0
#9  0x00007f0a2da0b66d in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#10 0x00007f0a325c3f76 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#11 0x00007f0a32598242 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#12 0x00007f0a3259848c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#13 0x00007f0a324adcc4 in QThread::exec() () from /usr/lib/libQtCore.so.4
#14 0x00007f0a324b049e in ?? () from /usr/lib/libQtCore.so.4
#15 0x00007f0a32227cb0 in start_thread () from /lib/libpthread.so.0
#16 0x00007f0a30cdd9fd in clone () from /lib/libc.so.6
#17 0x0000000000000000 in ?? ()

Thread 15 (Thread 0x7f0a2094f710 (LWP 2577)):
#0  0x00007fffb1bff861 in clock_gettime ()
#1  0x00007f0a295dbdcb in clock_gettime () from /lib/librt.so.1
#2  0x00007f0a325014bf in ?? () from /usr/lib/libQtCore.so.4
#3  0x00007f0a325c495d in ?? () from /usr/lib/libQtCore.so.4
#4  0x00007f0a325c4ce5 in ?? () from /usr/lib/libQtCore.so.4
#5  0x00007f0a325c376c in ?? () from /usr/lib/libQtCore.so.4
#6  0x00007f0a325c3815 in ?? () from /usr/lib/libQtCore.so.4
#7  0x00007f0a2da0a0df in g_main_context_prepare () from /usr/lib/libglib-2.0.so.0
#8  0x00007f0a2da0afc9 in ?? () from /usr/lib/libglib-2.0.so.0
#9  0x00007f0a2da0b66d in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#10 0x00007f0a325c3f76 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#11 0x00007f0a32598242 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#12 0x00007f0a3259848c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#13 0x00007f0a324adcc4 in QThread::exec() () from /usr/lib/libQtCore.so.4
#14 0x00007f0a324b049e in ?? () from /usr/lib/libQtCore.so.4
#15 0x00007f0a32227cb0 in start_thread () from /lib/libpthread.so.0
#16 0x00007f0a30cdd9fd in clone () from /lib/libc.so.6
#17 0x0000000000000000 in ?? ()

Thread 14 (Thread 0x7f0a1bfff710 (LWP 2578)):
#0  0x00007f0a3222c40c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#1  0x00007f0a324b0b8b in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/libQtCore.so.4
#2  0x00007f0a363d9fb8 in Digikam::ParkingThread::run (this=0x1303ee0) at /home/languitar/workspace/digiKam/libs/threads/threadmanager.cpp:101
#3  0x00007f0a324b049e in ?? () from /usr/lib/libQtCore.so.4
#4  0x00007f0a32227cb0 in start_thread () from /lib/libpthread.so.0
#5  0x00007f0a30cdd9fd in clone () from /lib/libc.so.6
#6  0x0000000000000000 in ?? ()

Thread 13 (Thread 0x7f0a1b7fe710 (LWP 2579)):
#0  0x00007fffb1bff861 in clock_gettime ()
#1  0x00007f0a295dbdcb in clock_gettime () from /lib/librt.so.1
#2  0x00007f0a325014bf in ?? () from /usr/lib/libQtCore.so.4
#3  0x00007f0a325c495d in ?? () from /usr/lib/libQtCore.so.4
#4  0x00007f0a325c4ce5 in ?? () from /usr/lib/libQtCore.so.4
#5  0x00007f0a325c376c in ?? () from /usr/lib/libQtCore.so.4
#6  0x00007f0a325c3815 in ?? () from /usr/lib/libQtCore.so.4
#7  0x00007f0a2da0a0df in g_main_context_prepare () from /usr/lib/libglib-2.0.so.0
#8  0x00007f0a2da0afc9 in ?? () from /usr/lib/libglib-2.0.so.0
#9  0x00007f0a2da0b66d in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#10 0x00007f0a325c3f76 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#11 0x00007f0a32598242 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#12 0x00007f0a3259848c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#13 0x00007f0a324adcc4 in QThread::exec() () from /usr/lib/libQtCore.so.4
#14 0x00007f0a324b049e in ?? () from /usr/lib/libQtCore.so.4
#15 0x00007f0a32227cb0 in start_thread () from /lib/libpthread.so.0
#16 0x00007f0a30cdd9fd in clone () from /lib/libc.so.6
#17 0x0000000000000000 in ?? ()

Thread 12 (Thread 0x7f0a1affd710 (LWP 2580)):
#0  0x00007fffb1bff861 in clock_gettime ()
#1  0x00007f0a295dbdcb in clock_gettime () from /lib/librt.so.1
#2  0x00007f0a325014bf in ?? () from /usr/lib/libQtCore.so.4
#3  0x00007f0a325c495d in ?? () from /usr/lib/libQtCore.so.4
#4  0x00007f0a325c4ce5 in ?? () from /usr/lib/libQtCore.so.4
#5  0x00007f0a325c376c in ?? () from /usr/lib/libQtCore.so.4
#6  0x00007f0a325c3815 in ?? () from /usr/lib/libQtCore.so.4
#7  0x00007f0a2da0a0df in g_main_context_prepare () from /usr/lib/libglib-2.0.so.0
#8  0x00007f0a2da0afc9 in ?? () from /usr/lib/libglib-2.0.so.0
#9  0x00007f0a2da0b66d in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#10 0x00007f0a325c3f76 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#11 0x00007f0a32598242 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#12 0x00007f0a3259848c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#13 0x00007f0a324adcc4 in QThread::exec() () from /usr/lib/libQtCore.so.4
#14 0x00007f0a324b049e in ?? () from /usr/lib/libQtCore.so.4
#15 0x00007f0a32227cb0 in start_thread () from /lib/libpthread.so.0
#16 0x00007f0a30cdd9fd in clone () from /lib/libc.so.6
#17 0x0000000000000000 in ?? ()

Thread 11 (Thread 0x7f0a11925710 (LWP 2581)):
#0  0x00007f0a3222c779 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#1  0x00007f0a17f1ba21 in ?? () from /usr/lib/libxine.so.1
#2  0x00007f0a32227cb0 in start_thread () from /lib/libpthread.so.0
#3  0x00007f0a30cdd9fd in clone () from /lib/libc.so.6
#4  0x0000000000000000 in ?? ()

Thread 10 (Thread 0x7f0a0feb6710 (LWP 2582)):
#0  0x00007f0a30cd72f3 in select () from /lib/libc.so.6
#1  0x00007f0a17f44084 in xine_usec_sleep () from /usr/lib/libxine.so.1
#2  0x00007f0a17f29649 in ?? () from /usr/lib/libxine.so.1
#3  0x00007f0a32227cb0 in start_thread () from /lib/libpthread.so.0
#4  0x00007f0a30cdd9fd in clone () from /lib/libc.so.6
#5  0x0000000000000000 in ?? ()

Thread 9 (Thread 0x7f0a0f6b5710 (LWP 2583)):
#0  0x00007f0a325c44d0 in ?? () from /usr/lib/libQtCore.so.4
#1  0x00007f0a2da0a878 in g_main_context_check () from /usr/lib/libglib-2.0.so.0
#2  0x00007f0a2da0b152 in ?? () from /usr/lib/libglib-2.0.so.0
#3  0x00007f0a2da0b66d in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#4  0x00007f0a325c3f76 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#5  0x00007f0a32598242 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#6  0x00007f0a3259848c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#7  0x00007f0a324adcc4 in QThread::exec() () from /usr/lib/libQtCore.so.4
#8  0x00007f0a18176cd4 in ?? () from /usr/lib/kde4/plugins/phonon_backend/phonon_xine.so
#9  0x00007f0a324b049e in ?? () from /usr/lib/libQtCore.so.4
#10 0x00007f0a32227cb0 in start_thread () from /lib/libpthread.so.0
#11 0x00007f0a30cdd9fd in clone () from /lib/libc.so.6
#12 0x0000000000000000 in ?? ()

Thread 8 (Thread 0x7f0a0ecab710 (LWP 2586)):
#0  0x00007f0a30cd5173 in poll () from /lib/libc.so.6
#1  0x00007f0a0ecb0515 in ?? () from /usr/lib/xine/plugins/1.29/xineplug_ao_out_alsa.so
#2  0x00007f0a32227cb0 in start_thread () from /lib/libpthread.so.0
#3  0x00007f0a30cdd9fd in clone () from /lib/libc.so.6
#4  0x0000000000000000 in ?? ()

Thread 7 (Thread 0x7f0a0e4aa710 (LWP 2587)):
#0  0x00007f0a3222c40c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#1  0x00007f0a17f2d53b in ?? () from /usr/lib/libxine.so.1
#2  0x00007f0a32227cb0 in start_thread () from /lib/libpthread.so.0
#3  0x00007f0a30cdd9fd in clone () from /lib/libc.so.6
#4  0x0000000000000000 in ?? ()

Thread 6 (Thread 0x7f0a0dca9710 (LWP 2588)):
#0  0x00007f0a30cea91e in ?? () from /lib/libc.so.6
#1  0x00007f0a30c870a2 in ?? () from /lib/libc.so.6
#2  0x00007f0a30c85471 in free () from /lib/libc.so.6
#3  0x00007f0a325c3997 in ?? () from /usr/lib/libQtCore.so.4
#4  0x00007f0a2da0a878 in g_main_context_check () from /usr/lib/libglib-2.0.so.0
#5  0x00007f0a2da0b152 in ?? () from /usr/lib/libglib-2.0.so.0
#6  0x00007f0a2da0b66d in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#7  0x00007f0a325c3f1f in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#8  0x00007f0a32598242 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#9  0x00007f0a3259848c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#10 0x00007f0a324adcc4 in QThread::exec() () from /usr/lib/libQtCore.so.4
#11 0x00007f0a32579a48 in ?? () from /usr/lib/libQtCore.so.4
#12 0x00007f0a324b049e in ?? () from /usr/lib/libQtCore.so.4
#13 0x00007f0a32227cb0 in start_thread () from /lib/libpthread.so.0
#14 0x00007f0a30cdd9fd in clone () from /lib/libc.so.6
#15 0x0000000000000000 in ?? ()

Thread 5 (Thread 0x7f0a0afcb710 (LWP 2594)):
#0  0x00007f0a30cea91e in ?? () from /lib/libc.so.6
#1  0x00007f0a30c870a2 in ?? () from /lib/libc.so.6
#2  0x00007f0a30c85471 in free () from /lib/libc.so.6
#3  0x00007f0a325c3997 in ?? () from /usr/lib/libQtCore.so.4
#4  0x00007f0a2da0a878 in g_main_context_check () from /usr/lib/libglib-2.0.so.0
#5  0x00007f0a2da0b152 in ?? () from /usr/lib/libglib-2.0.so.0
#6  0x00007f0a2da0b66d in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#7  0x00007f0a325c3f1f in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#8  0x00007f0a32598242 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#9  0x00007f0a3259848c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#10 0x00007f0a324adcc4 in QThread::exec() () from /usr/lib/libQtCore.so.4
#11 0x00007f0a32579a48 in ?? () from /usr/lib/libQtCore.so.4
#12 0x00007f0a324b049e in ?? () from /usr/lib/libQtCore.so.4
#13 0x00007f0a32227cb0 in start_thread () from /lib/libpthread.so.0
#14 0x00007f0a30cdd9fd in clone () from /lib/libc.so.6
#15 0x0000000000000000 in ?? ()

Thread 4 (Thread 0x7f0a02ffd710 (LWP 11665)):
#0  0x00007f0a30cea91e in ?? () from /lib/libc.so.6
#1  0x00007f0a30c870a2 in ?? () from /lib/libc.so.6
#2  0x00007f0a30c85471 in free () from /lib/libc.so.6
#3  0x00007f0a325c3997 in ?? () from /usr/lib/libQtCore.so.4
#4  0x00007f0a2da0a878 in g_main_context_check () from /usr/lib/libglib-2.0.so.0
#5  0x00007f0a2da0b152 in ?? () from /usr/lib/libglib-2.0.so.0
#6  0x00007f0a2da0b66d in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#7  0x00007f0a325c3f1f in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#8  0x00007f0a32598242 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#9  0x00007f0a3259848c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#10 0x00007f0a324adcc4 in QThread::exec() () from /usr/lib/libQtCore.so.4
#11 0x00007f0a32579a48 in ?? () from /usr/lib/libQtCore.so.4
#12 0x00007f0a324b049e in ?? () from /usr/lib/libQtCore.so.4
#13 0x00007f0a32227cb0 in start_thread () from /lib/libpthread.so.0
#14 0x00007f0a30cdd9fd in clone () from /lib/libc.so.6
#15 0x0000000000000000 in ?? ()

Thread 3 (Thread 0x7f09eebb6710 (LWP 12238)):
#0  0x00007f0a3222c40c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#1  0x00007f0a324b0b8b in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/libQtCore.so.4
#2  0x0000000000541536 in Digikam::ActionThread::run (this=0x1e2bb9c0) at /home/languitar/workspace/digiKam/utilities/queuemanager/actionthread.cpp:155
#3  0x00007f0a324b049e in ?? () from /usr/lib/libQtCore.so.4
#4  0x00007f0a32227cb0 in start_thread () from /lib/libpthread.so.0
#5  0x00007f0a30cdd9fd in clone () from /lib/libc.so.6
#6  0x0000000000000000 in ?? ()

Thread 2 (Thread 0x7f09ec3b1710 (LWP 12831)):
[KCrash Handler]
#6  0x00007f0a30c41595 in raise () from /lib/libc.so.6
#7  0x00007f0a30c42a16 in abort () from /lib/libc.so.6
#8  0x00007f0a30c7b2cb in ?? () from /lib/libc.so.6
#9  0x00007f0a30c80676 in ?? () from /lib/libc.so.6
#10 0x00007f0a30c8547c in free () from /lib/libc.so.6
#11 0x00007f0a36322b29 in Digikam::NRFilter::filterImage (this=0x7f09ec3b0cf8) at /home/languitar/workspace/digiKam/libs/dimg/filters/nr/nrfilter.cpp:177
#12 0x00007f0a362e2082 in Digikam::DImgThreadedFilter::startFilterDirectly (this=0x18f441c0) at /home/languitar/workspace/digiKam/libs/dimg/filters/dimgthreadedfilter.cpp:140
#13 0x00007f0a363dac0f in Digikam::DynamicThreadPriv::run (this=0xe6b6040) at /home/languitar/workspace/digiKam/libs/threads/dynamicthread.cpp:237
#14 0x00007f0a324a6ae8 in ?? () from /usr/lib/libQtCore.so.4
#15 0x00007f0a324b049e in ?? () from /usr/lib/libQtCore.so.4
#16 0x00007f0a32227cb0 in start_thread () from /lib/libpthread.so.0
#17 0x00007f0a30cdd9fd in clone () from /lib/libc.so.6
#18 0x0000000000000000 in ?? ()

Thread 1 (Thread 0x7f0a3930f7c0 (LWP 2573)):
#0  0x00007f0a3222c40c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#1  0x00007f0a324b0b8b in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/libQtCore.so.4
#2  0x00007f0a363dac6c in Digikam::DynamicThread::wait (this=0x18f441c0, locker=...) at /home/languitar/workspace/digiKam/libs/threads/dynamicthread.cpp:247
#3  0x00007f0a363dacac in Digikam::DynamicThread::wait (this=0x18f441c0) at /home/languitar/workspace/digiKam/libs/threads/dynamicthread.cpp:150
#4  0x00007f0a362e1d7f in Digikam::DImgThreadedFilter::cancelFilter (this=0x18f441c0) at /home/languitar/workspace/digiKam/libs/dimg/filters/dimgthreadedfilter.cpp:175
#5  0x00007f0a362e2625 in Digikam::DImgThreadedFilter::~DImgThreadedFilter (this=0x18f441c0, __in_chrg=<value optimized out>) at /home/languitar/workspace/digiKam/libs/dimg/filters/dimgthreadedfilter.cpp:88
#6  0x00007f0a36321249 in Digikam::NRFilter::~NRFilter (this=0x18f441c0, __in_chrg=<value optimized out>) at /home/languitar/workspace/digiKam/libs/dimg/filters/nr/nrfilter.cpp:71
#7  0x00007f0a3647c22c in Digikam::EditorToolThreaded::~EditorToolThreaded (this=0x106e1020, __in_chrg=<value optimized out>) at /home/languitar/workspace/digiKam/utilities/imageeditor/editor/editortool.cpp:321
#8  0x00007f09f3e88029 in DigikamEnhanceImagePlugin::NoiseReductionTool::~NoiseReductionTool (this=0x106e1020, __in_chrg=<value optimized out>) at /home/languitar/workspace/digiKam/imageplugins/enhance/noisereductiontool.cpp:98
#9  0x00007f0a3647d473 in Digikam::EditorToolIface::unLoadTool (this=0x133cef0) at /home/languitar/workspace/digiKam/utilities/imageeditor/editor/editortooliface.cpp:149
#10 0x00007f0a3646e011 in Digikam::DImgInterface::resetImage (this=0xb2256d0) at /home/languitar/workspace/digiKam/utilities/imageeditor/canvas/dimginterface.cpp:290
#11 0x000000000047e854 in Digikam::ImageWindow::closeEvent (this=0xb1f38f0, e=0x7fffb1bc4060) at /home/languitar/workspace/digiKam/utilities/imageeditor/editor/imagewindow.cpp:274
#12 0x00007f0a331e1f7e in QWidget::event(QEvent*) () from /usr/lib/libQtGui.so.4
#13 0x00007f0a3359f0ab in QMainWindow::event(QEvent*) () from /usr/lib/libQtGui.so.4
#14 0x00007f0a33f87de3 in KXmlGuiWindow::event(QEvent*) () from /usr/lib/libkdeui.so.5
#15 0x00007f0a33190564 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#16 0x00007f0a33194fda in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#17 0x00007f0a33e851f6 in KApplication::notify(QObject*, QEvent*) () from /usr/lib/libkdeui.so.5
#18 0x00007f0a32598eac in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/libQtCore.so.4
#19 0x00007f0a331dc931 in QWidgetPrivate::close_helper(QWidgetPrivate::CloseMode) () from /usr/lib/libQtGui.so.4
#20 0x00007f0a3320f476 in QApplication::x11ClientMessage(QWidget*, _XEvent*, bool) () from /usr/lib/libQtGui.so.4
#21 0x00007f0a3320d8a0 in QApplication::x11ProcessEvent(_XEvent*) () from /usr/lib/libQtGui.so.4
#22 0x00007f0a332345f2 in ?? () from /usr/lib/libQtGui.so.4
#23 0x00007f0a2da0abf3 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#24 0x00007f0a2da0b3d0 in ?? () from /usr/lib/libglib-2.0.so.0
#25 0x00007f0a2da0b66d in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#26 0x00007f0a325c3f1f in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#27 0x00007f0a3323429e in ?? () from /usr/lib/libQtGui.so.4
#28 0x00007f0a32598242 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#29 0x00007f0a3259848c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#30 0x00007f0a3259c94b in QCoreApplication::exec() () from /usr/lib/libQtCore.so.4
#31 0x0000000000670657 in main (argc=0, argv=0x7fffb1bc5228) at /home/languitar/workspace/digiKam/digikam/main.cpp:195

Reported using DrKonqi
Comment 1 caulier.gilles 2010-10-19 23:01:09 UTC
If you look into nrfilter.cpp, you will see that runningFlag() is called at right places. Sound like the filter is not triggered to be stopped from editor when editor is closed. Something probably need to fixed there :

http://lxr.kde.org/source/extragear/graphics/digikam/utilities/imageeditor/editor/imagewindow.cpp#302

... to check if computation is under progress...

Note: can you check if it crash in a similar condition when QBM run with this filter ?

Gilles Caulier
Comment 2 caulier.gilles 2010-10-20 11:02:35 UTC
I can reproduce the crash only with NR filter. I see that free allocation of buffer is the problem. I will fix it

Gilles Caulier
Comment 3 caulier.gilles 2010-10-20 11:42:19 UTC
Marcel,

Look the trace. It crash when memory allocation is cleanned at end of NR filter.

If filter is canceled. memory allocation are there and must be cleaned. It the case if you cancel filter in editor using Cancel button on the bottom. Ther is no crash.

If filter is under process, and if digiKam is closed, filter recieve a cancel notification. but in this case, memory allocation crash. Perhaps it's due to a race condition or a cancelization event sent at the wrong moment from thread manager class ?

Gilles Caulier
Comment 4 caulier.gilles 2010-10-20 11:45:59 UTC
MArcel,

I tried this patch :

    for (int c = 0; c < 3; c++)
    {
        if (d->fimg[c])
            delete [] d->fimg[c];
    }

    if (d->buffer[1])
        delete [] d->buffer[1];

    if (d->buffer[2])
        delete [] d->buffer[2];

...set at end of filterImage() NRFilter::method. It crash

I moved this memory allocation code to destructor, just before to delete internal container : it crash.

Gilles Caulier
Comment 5 caulier.gilles 2010-10-20 11:48:33 UTC
Marcel,

Interresting. If memory cleanup is don in destructor, crash appear in another place :

Thread 3 (Thread 0xa50dcb70 (LWP 23038)):
[KCrash Handler]
#6  0xb67a9182 in Digikam::NRFilter::waveletDenoise (this=0xc975450, fimg=0xcf1d9fc, width=3016, height=2008, threshold=2.1500001, softness=0.099999999999999978)
    at /mnt/data/Devel/SVN/trunk/graphics/digikam/libs/dimg/filters/nr/nrfilter.cpp:234
#7  0xb67a8aee in Digikam::NRFilter::filterImage (this=0xc975450) at /mnt/data/Devel/SVN/trunk/graphics/digikam/libs/dimg/filters/nr/nrfilter.cpp:137
#8  0xb6741abc in Digikam::DImgThreadedFilter::startFilterDirectly (this=0xc975450) at /mnt/data/Devel/SVN/trunk/graphics/digikam/libs/dimg/filters/dimgthreadedfilter.cpp:140
#9  0xb6741c98 in Digikam::DImgThreadedFilter::run (this=0xc975450) at /mnt/data/Devel/SVN/trunk/graphics/digikam/libs/dimg/filters/dimgthreadedfilter.cpp:161
#10 0xb68f6fed in Digikam::DynamicThread::DynamicThreadPriv::run (this=0xc944060) at /mnt/data/Devel/SVN/trunk/graphics/digikam/libs/threads/dynamicthread.cpp:240
#11 0xb497d762 in ?? () from /usr/lib/libQtCore.so.4
#12 0xb4987fcf in ?? () from /usr/lib/libQtCore.so.4
#13 0xb48f5ae5 in start_thread () from /lib/i686/libpthread.so.0
#14 0xb46c603e in clone () from /lib/i686/libc.so.6

Gilles Caulier
Comment 6 Marcel Wiesweg 2010-10-21 12:21:59 UTC
I've had a similar crash recently. The reason is that one must remember that the derived class destructor is executed before the parent class destructor.
So the crash happens like this:

Thread is running, accessing NRFilterPriv data.
Deleting the filter
1) ~NRFilter deletes NRFilterPriv
2) ~DImgThreadedFilter calls cancelFilter
3) cancelFilter wait()s for the thread to finish

Between 1) and 2) the thread is still running and accessed the deleted data.
Solution: Call cancelFilter in ~NRFilter before any data is deleted.
Comment 7 caulier.gilles 2010-10-21 12:41:06 UTC
Marcel, 

This problem occur only with NR filter which has a d private internal container, or also another filter, as BCG or LensFun tool ? I tried to reproduce this problem with these filters, and all work fine.

This is relevant of part of image data stored in NR filter d private container ?

Gilles
Comment 8 caulier.gilles 2010-10-21 12:46:21 UTC
SVN commit 1188075 by cgilles:

I confirm. Calling cancelFilter() in NR filter destructor fix crash.
CCBUGS: 254679


 M  +3 -0      nrfilter.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1188075
Comment 9 caulier.gilles 2010-10-21 12:49:48 UTC
Marcel,

I can reproduce the crash with Restoration tool, in same conditions :

Thread 4 (Thread 0x9d733b70 (LWP 11689)):
[KCrash Handler]
#6  0xb68005fb in cimg_library::CImg<float>::_atXYZV(int, int, int, int) const () from /usr/lib/libdigikamcore.so.1
#7  0xb680c419 in cimg_library::CImg<float>::get_crop(int, int, int, int, int, int, int, int, bool) const () from /usr/lib/libdigikamcore.so.1
#8  0xb67fd9ce in cimg_library::CImg<float>::get_crop(int, int, int, int, bool) const () from /usr/lib/libdigikamcore.so.1
#9  0xb67c36c8 in cimg_library::CImg<float>::greycstoration_thread(void*) () from /usr/lib/libdigikamcore.so.1
#10 0xb48c9ae5 in start_thread () from /lib/i686/libpthread.so.0
#11 0xb469a03e in clone () from /lib/i686/libc.so.6

Probably a general fix must be done in all filter to prevent this problem...

Gilles
Comment 10 Marcel Wiesweg 2010-10-21 13:24:26 UTC
This cannot be generally solved in the parent class because the derived class destructor is called first, and virtual methods cannot be called from a destructor.
To be safe, any filter which has private data accessed from the thread should call cancelFilter in its destructor first. I dont see a better solution that is safe everywhere.
Comment 11 caulier.gilles 2010-10-21 13:32:30 UTC
Ok, i will fix it...

Another problem now, depending only of CImg based tools, as Restoration.

If i patch descructor to call cancelFilter(), it do not crash, but thread still to run in memory.

If i don't patch, digiKam crash.

Note : if destructor is not patched but if i press cancel button during Cimg computations all is fine.

I cannot see where is the difference. Can you reproduce the problem ?

CImg threads are a little bit complicated to manage. 

Gilles
Comment 12 caulier.gilles 2010-10-25 16:59:30 UTC
SVN commit 1189681 by cgilles:

CImg filter : call cancelFilter() in destructor
CCBUGS: 254679


 M  +1 -0      greycstorationfilter.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1189681
Comment 13 caulier.gilles 2010-10-26 13:39:50 UTC
SVN commit 1189909 by cgilles:

call cancelFilter in filter destructors.
BUGS: 254679


 M  +1 -0      imageplugins/enhance/hotpixels/hotpixelfixer.cpp  
 M  +4 -1      imageplugins/transform/resizetool.cpp  
 M  +1 -0      libs/dimg/filters/auto/autolevelsfilter.cpp  
 M  +1 -0      libs/dimg/filters/auto/normalizefilter.cpp  
 M  +1 -0      libs/dimg/filters/auto/stretchfilter.cpp  
 M  +1 -0      libs/dimg/filters/bcg/bcgfilter.cpp  
 M  +1 -0      libs/dimg/filters/bw/bwsepiafilter.cpp  
 M  +5 -0      libs/dimg/filters/bw/infraredfilter.cpp  
 M  +1 -1      libs/dimg/filters/bw/infraredfilter.h  
 M  +1 -0      libs/dimg/filters/bw/mixerfilter.cpp  
 M  +1 -0      libs/dimg/filters/bw/tonalityfilter.cpp  
 M  +1 -0      libs/dimg/filters/cb/cbfilter.cpp  
 M  +1 -0      libs/dimg/filters/curves/curvesfilter.cpp  
 M  +1 -0      libs/dimg/filters/decorate/borderfilter.cpp  
 M  +10 -3     libs/dimg/filters/decorate/texturefilter.cpp  
 M  +1 -2      libs/dimg/filters/decorate/texturefilter.h  
 M  +5 -0      libs/dimg/filters/fx/blurfilter.cpp  
 M  +1 -1      libs/dimg/filters/fx/blurfilter.h  
 M  +5 -0      libs/dimg/filters/fx/charcoalfilter.cpp  
 M  +1 -1      libs/dimg/filters/fx/charcoalfilter.h  
 M  +5 -0      libs/dimg/filters/fx/distortionfxfilter.cpp  
 M  +1 -1      libs/dimg/filters/fx/distortionfxfilter.h  
 M  +5 -0      libs/dimg/filters/fx/embossfilter.cpp  
 M  +1 -1      libs/dimg/filters/fx/embossfilter.h  
 M  +1 -0      libs/dimg/filters/fx/filmgrainfilter.cpp  
 M  +5 -0      libs/dimg/filters/fx/invertfilter.cpp  
 M  +1 -1      libs/dimg/filters/fx/invertfilter.h  
 M  +5 -0      libs/dimg/filters/fx/oilpaintfilter.cpp  
 M  +1 -1      libs/dimg/filters/fx/oilpaintfilter.h  
 M  +5 -0      libs/dimg/filters/fx/raindropfilter.cpp  
 M  +1 -1      libs/dimg/filters/fx/raindropfilter.h  
 M  +1 -0      libs/dimg/filters/hsl/hslfilter.cpp  
 M  +6 -1      libs/dimg/filters/icc/icctransformfilter.cpp  
 M  +2 -1      libs/dimg/filters/icc/icctransformfilter.h  
 M  +1 -0      libs/dimg/filters/lc/localcontrastfilter.cpp  
 M  +4 -2      libs/dimg/filters/lens/antivignettingfilter.cpp  
 M  +1 -1      libs/dimg/filters/lens/antivignettingfilter.h  
 M  +5 -0      libs/dimg/filters/lens/lensdistortionfilter.cpp  
 M  +1 -1      libs/dimg/filters/lens/lensdistortionfilter.h  
 M  +1 -0      libs/dimg/filters/lens/lensfunfilter.cpp  
 M  +1 -0      libs/dimg/filters/levels/levelsfilter.cpp  
 M  +0 -2      libs/dimg/filters/nr/nrfilter.cpp  
 M  +5 -0      libs/dimg/filters/sharp/sharpenfilter.cpp  
 M  +1 -1      libs/dimg/filters/sharp/sharpenfilter.h  
 M  +5 -0      libs/dimg/filters/sharp/unsharpmaskfilter.cpp  
 M  +1 -1      libs/dimg/filters/sharp/unsharpmaskfilter.h  
 M  +2 -1      libs/dimg/filters/transform/contentawarefilter.cpp  
 M  +1 -0      libs/dimg/filters/transform/freerotationfilter.cpp  
 M  +5 -0      libs/dimg/filters/transform/shearfilter.cpp  
 M  +1 -1      libs/dimg/filters/transform/shearfilter.h  
 M  +1 -0      libs/dimg/filters/wb/wbfilter.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1189909