Bug 354234 - Crash when changing Lens selection in Lens distortion correction dialog
Summary: Crash when changing Lens selection in Lens distortion correction dialog
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Plugin-Editor-LensCorrection (show other bugs)
Version: 4.10.0
Platform: Gentoo Packages Linux
: NOR crash
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords: drkonqi
Depends on:
Blocks:
 
Reported: 2015-10-22 22:30 UTC by Frank Steinmetzger
Modified: 2016-07-01 09:22 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.0.0


Attachments
Example image that makes the filter crash. First resized with digikam 4.10 and saved, then reopened to do the lens correction. (63.25 KB, image/jpeg)
2015-10-25 23:51 UTC, Frank Steinmetzger
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Frank Steinmetzger 2015-10-22 22:30:37 UTC
Application: showfoto (4.10.0)
KDE Platform Version: 4.14.8
Qt Version: 4.8.6
Operating System: Linux 4.2.2-kern x86_64
Distribution (Platform): Gentoo Packages

-- Information about the crash:
- What I was doing when the application crashed:
I was playing with controls in the Lens Correction dialog, selecting my camera and a lens and going back and forth between before/after view. Then I noticed that I selected the wrong lens. When I selected the correct one, the crash happened.

-- Backtrace:
Application: showFoto (showfoto), signal: Segmentation fault
Using host libthread_db library "/lib64/libthread_db.so.1".
pthread_cond_wait () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
[Current thread is 1 (Thread 0x7f8c6a9b3800 (LWP 2961))]

Thread 2 (Thread 0x7f8c4f936700 (LWP 2963)):
[KCrash Handler]
#6  apply_multiplier<unsigned char> (cr=<synthetic pointer>, c=<optimized out>, pixels=0x8936390 <error: Cannot access memory at address 0x8936390>) at /var/tmp/portage/media-libs/lensfun-0.3.0/work/lensfun-0.3.0/libs/lensfun/mod-color.cpp:210
#7  lfExtModifier::ModifyColor_DeVignetting_PA<unsigned char> (data=0x7f8c4802cad0, x=4.38034998e+27, y=<optimized out>, pixels=<optimized out>, comp_role=4, count=975) at /var/tmp/portage/media-libs/lensfun-0.3.0/work/lensfun-0.3.0/libs/lensfun/mod-color.cpp:318
#8  0x00007f8c6595c113 in lfModifier::ApplyColorModification (this=0x7f8c480312c0, pixels=pixels@entry=0x8936390, x=-0.999672174, x@entry=0, y=0.721131682, y@entry=1002, width=976, height=height@entry=1, comp_role=comp_role@entry=4, row_stride=row_stride@entry=0) at /var/tmp/portage/media-libs/lensfun-0.3.0/work/lensfun-0.3.0/libs/lensfun/mod-color.cpp:137
#9  0x00007f8c6a359ec2 in Digikam::LensFunFilter::filterImage (this=0x16be790) at /var/tmp/portage/media-gfx/digikam-4.10.0/work/digikam-4.10.0/core/libs/dimg/filters/lens/lensfunfilter.cpp:231
#10 0x00007f8c6a237179 in Digikam::DImgThreadedFilter::startFilterDirectly (this=0x16be790) at /var/tmp/portage/media-gfx/digikam-4.10.0/work/digikam-4.10.0/core/libs/dimg/filters/dimgthreadedfilter.cpp:197
#11 0x00007f8c6a3e9ade in Digikam::DynamicThread::DynamicThreadPriv::run (this=0x1ac2440) at /var/tmp/portage/media-gfx/digikam-4.10.0/work/digikam-4.10.0/core/libs/threads/dynamicthread.cpp:186
#12 0x00007f8c67d5658c in QThreadPoolThread::run (this=0x1836450) at /var/tmp/portage/dev-qt/qtcore-4.8.6-r2/work/qt-everywhere-opensource-src-4.8.6/src/corelib/concurrent/qthreadpool.cpp:108
#13 0x00007f8c67d6298f in QThreadPrivate::start (arg=0x1836450) at /var/tmp/portage/dev-qt/qtcore-4.8.6-r2/work/qt-everywhere-opensource-src-4.8.6/src/corelib/thread/qthread_unix.cpp:349
#14 0x00007f8c66105334 in start_thread (arg=0x7f8c4f936700) at pthread_create.c:333
#15 0x00007f8c672121bd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 1 (Thread 0x7f8c6a9b3800 (LWP 2961)):
#0  pthread_cond_wait () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x00007f8c67d62e86 in wait (time=18446744073709551615, this=0x12b1e60) at /var/tmp/portage/dev-qt/qtcore-4.8.6-r2/work/qt-everywhere-opensource-src-4.8.6/src/corelib/thread/qwaitcondition_unix.cpp:86
#2  QWaitCondition::wait (this=this@entry=0x12e03f0, mutex=mutex@entry=0x12e03c8, time=time@entry=18446744073709551615) at /var/tmp/portage/dev-qt/qtcore-4.8.6-r2/work/qt-everywhere-opensource-src-4.8.6/src/corelib/thread/qwaitcondition_unix.cpp:158
#3  0x00007f8c67d557e2 in QThreadPoolPrivate::waitForDone (this=0x12e0340, msecs=msecs@entry=-1) at /var/tmp/portage/dev-qt/qtcore-4.8.6-r2/work/qt-everywhere-opensource-src-4.8.6/src/corelib/concurrent/qthreadpool.cpp:295
#4  0x00007f8c67d56c65 in QThreadPool::~QThreadPool (this=0x12bfde0, __in_chrg=<optimized out>) at /var/tmp/portage/dev-qt/qtcore-4.8.6-r2/work/qt-everywhere-opensource-src-4.8.6/src/corelib/concurrent/qthreadpool.cpp:438
#5  0x00007f8c67d56ca9 in QThreadPool::~QThreadPool (this=0x12bfde0, __in_chrg=<optimized out>) at /var/tmp/portage/dev-qt/qtcore-4.8.6-r2/work/qt-everywhere-opensource-src-4.8.6/src/corelib/concurrent/qthreadpool.cpp:440
#6  0x00007f8c67e7cd94 in QObjectPrivate::deleteChildren (this=this@entry=0x12a4c90) at /var/tmp/portage/dev-qt/qtcore-4.8.6-r2/work/qt-everywhere-opensource-src-4.8.6/src/corelib/kernel/qobject.cpp:1935
#7  0x00007f8c67e7f3af in QObject::~QObject (this=0x12aa460, __in_chrg=<optimized out>) at /var/tmp/portage/dev-qt/qtcore-4.8.6-r2/work/qt-everywhere-opensource-src-4.8.6/src/corelib/kernel/qobject.cpp:954
#8  0x00007f8c6a3e6b27 in ~ThreadManagerCreator (this=0x12aa460, __in_chrg=<optimized out>) at /var/tmp/portage/media-gfx/digikam-4.10.0/work/digikam-4.10.0/core/libs/threads/threadmanager.cpp:236
#9  destroy () at /var/tmp/portage/media-gfx/digikam-4.10.0/work/digikam-4.10.0/core/libs/threads/threadmanager.cpp:241
#10 0x00007f8c6715fc68 in __run_exit_handlers (status=1, listp=0x7f8c674bf698 <__exit_funcs>, run_list_atexit=run_list_atexit@entry=true) at exit.c:82
#11 0x00007f8c6715fcb5 in __GI_exit (status=<optimized out>) at exit.c:104
#12 0x00007f8c688ccec8 in qt_xio_errhandler () at /var/tmp/portage/dev-qt/qtgui-4.8.6-r4/work/qt-everywhere-opensource-src-4.8.6/src/gui/kernel/qapplication_x11.cpp:773
#13 0x00007f8c6956c120 in KApplication::xioErrhandler (this=0x7fff3d8be530, dpy=0x1123670) at /var/tmp/portage/kde-base/kdelibs-4.14.8/work/kdelibs-4.14.8/kdeui/kernel/kapplication.cpp:419
#14 0x00007f8c65e074ce in _XIOError (dpy=dpy@entry=0x1123670) at /var/tmp/portage/x11-libs/libX11-1.6.2/work/libX11-1.6.2/src/XlibInt.c:1498
#15 0x00007f8c65e04ecd in _XEventsQueued (dpy=dpy@entry=0x1123670, mode=mode@entry=2) at /var/tmp/portage/x11-libs/libX11-1.6.2/work/libX11-1.6.2/src/xcb_io.c:366
#16 0x00007f8c65df76cb in XEventsQueued (dpy=0x1123670, mode=2) at /var/tmp/portage/x11-libs/libX11-1.6.2/work/libX11-1.6.2/src/Pending.c:43
#17 0x00007f8c6890343c in x11EventSourceCheck (s=0x1108aa0) at /var/tmp/portage/dev-qt/qtgui-4.8.6-r4/work/qt-everywhere-opensource-src-4.8.6/src/gui/kernel/qguieventdispatcher_glib.cpp:85
#18 0x00007f8c63141581 in g_main_context_check (context=context@entry=0x11089e0, max_priority=2147483647, fds=fds@entry=0x1280400, n_fds=n_fds@entry=4) at /var/tmp/portage/dev-libs/glib-2.44.1/work/glib-2.44.1/glib/gmain.c:3649
#19 0x00007f8c63141b20 in g_main_context_iterate (context=context@entry=0x11089e0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at /var/tmp/portage/dev-libs/glib-2.44.1/work/glib-2.44.1/glib/gmain.c:3805
#20 0x00007f8c63141c8c in g_main_context_iteration (context=0x11089e0, may_block=1) at /var/tmp/portage/dev-libs/glib-2.44.1/work/glib-2.44.1/glib/gmain.c:3869
#21 0x00007f8c67e9395e in QEventDispatcherGlib::processEvents (this=0x108dab0, flags=...) at /var/tmp/portage/dev-qt/qtcore-4.8.6-r2/work/qt-everywhere-opensource-src-4.8.6/src/corelib/kernel/qeventdispatcher_glib.cpp:450
#22 0x00007f8c689039e6 in QGuiEventDispatcherGlib::processEvents (this=<optimized out>, flags=...) at /var/tmp/portage/dev-qt/qtgui-4.8.6-r4/work/qt-everywhere-opensource-src-4.8.6/src/gui/kernel/qguieventdispatcher_glib.cpp:204
#23 0x00007f8c67e64dff in QEventLoop::processEvents (this=this@entry=0x7fff3d8be2d0, flags=...) at /var/tmp/portage/dev-qt/qtcore-4.8.6-r2/work/qt-everywhere-opensource-src-4.8.6/src/corelib/kernel/qeventloop.cpp:149
#24 0x00007f8c67e650f5 in QEventLoop::exec (this=this@entry=0x7fff3d8be2d0, flags=...) at /var/tmp/portage/dev-qt/qtcore-4.8.6-r2/work/qt-everywhere-opensource-src-4.8.6/src/corelib/kernel/qeventloop.cpp:204
#25 0x00007f8c67e6a559 in QCoreApplication::exec () at /var/tmp/portage/dev-qt/qtcore-4.8.6-r2/work/qt-everywhere-opensource-src-4.8.6/src/corelib/kernel/qcoreapplication.cpp:1225
#26 0x00007f8c68863bfc in QApplication::exec () at /var/tmp/portage/dev-qt/qtgui-4.8.6-r4/work/qt-everywhere-opensource-src-4.8.6/src/gui/kernel/qapplication.cpp:3823
#27 0x0000000000422f09 in main (argc=6, argv=0x7fff3d8be668) at /var/tmp/portage/media-gfx/digikam-4.10.0/work/digikam-4.10.0/core/showfoto/main/main.cpp:90

Reported using DrKonqi
Comment 1 caulier.gilles 2015-10-23 04:21:58 UTC
If i remember, it's fixed with more recent releases of digiKam as 4.13.0 or 4.14.0

Maik, can you confirm ?

Gilles Caulier
Comment 2 Maik Qualmann 2015-10-23 10:17:58 UTC
A part has already been resolved in digiKam 4.9.0, but another possible crash in the vignetting correction was only fixed in digiKam 4.11.0. Can you share a test image?

Maik
Comment 3 Frank Steinmetzger 2015-10-25 23:51:39 UTC
Created attachment 95126 [details]
Example image that makes the filter crash. First resized with digikam 4.10 and saved, then reopened to do the lens correction.

I was trying to reproduce again. I upgraded the laptop (same KDE setup as the PC that created the original crash report) to Digikam 4.14 and the crash is gone there. But I kept 4.10 on the PC in order to write this.

I can provoke a crash every time if I select a specific lens¹. Your hint with vignetting seems right: with a non-crashing lens, the progress bar goes up twice: the first time until about 40%, the second up to 100% and to completion. If I select an offending lens (I found a second by chance)², the first bar goes to around 40–50% again, but when the second bar should come, the crash happens. Interestingly, the crash only happens if the original metadata are there, probably for the filter to get initial date for the correction. It also does not happen when used on an image taken with another camera and lens.

Unfortunately, I can’t disable the vignetting option with another lens first. The checkbox is selected, but disabled. Speaking of UI quirks: I can’t use arrow keys or Enter when using the selection dropdowns for camera maker, model and lens. Any arrow key quits the lens correction dialog immediately, and pressing enter on an expanded dropdown starts the filter calculation immediately instead of just accepting the selection.

¹
Manufacturer: Olympus Imaging Corp.
Camera: E-M10
Lens: Olympus M.Zuiko Digital 17mm f/1.8

² The 17mm is the actual lens used to take the image, but the “Zuiko Digital 14-150mm f/4.0-5.6” is also afflicted by this bug, while other Zuikos are not.
Comment 4 caulier.gilles 2016-06-30 13:00:08 UTC
Problem still reproducible using last digiKam 5.0.0-beta7 ?

Gilles Caulier
Comment 5 Frank Steinmetzger 2016-06-30 16:08:33 UTC
I upgraded the PC from 4.10 to 4.14 a few days after I wrote comment #3. I downloaded the above picture to it and tried a few lenses with/without vignetting correction. As with the laptop, I am unable to reproduce the problem by following my description.

I'd say let it rest in peace.