Bug 319731 - digikam crashes when trying to decode Panasonic Raw (.rw2)
Summary: digikam crashes when trying to decode Panasonic Raw (.rw2)
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Plugin-DImg-RAW (show other bugs)
Version: 3.1.0
Platform: Ubuntu Linux
: NOR crash
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-12 17:56 UTC by Matthias Adrian Mendler
Modified: 2013-05-25 09:46 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 3.3.0


Attachments
P1040105.RW2 with exp_corr = 8.0 and exp_preser = 0.0 (3.50 MB, image/jpeg)
2013-05-25 07:44 UTC, Alex Tutubalin
Details
P1040105.RW2 with exp_corr = 8.0 and exp_preser = 1.0 (3.17 MB, image/jpeg)
2013-05-25 07:44 UTC, Alex Tutubalin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Adrian Mendler 2013-05-12 17:56:14 UTC
Application: digikam (3.1.0)
KDE Platform Version: 4.10.2
Qt Version: 4.8.4
Operating System: Linux 3.8.0-19-generic x86_64
Distribution: Ubuntu 13.04

-- Information about the crash:
- What I was doing when the application crashed:
Opening a .rw2 file which was made with a panasonic camera. Raw importer crashes digikam.

The crash can be reproduced every time.

-- Backtrace:
Application: digiKam (digikam), signal: Segmentation fault
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
[Current thread is 1 (Thread 0x7f1ad09e1a80 (LWP 9100))]

Thread 11 (Thread 0x7f1aa82f7700 (LWP 9103)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x00007f1acb23c14b in wait (time=18446744073709551615, this=0x2568480) at thread/qwaitcondition_unix.cpp:86
#2  QWaitCondition::wait (this=this@entry=0x2569350, mutex=mutex@entry=0x2569348, time=time@entry=18446744073709551615) at thread/qwaitcondition_unix.cpp:158
#3  0x00000000005ccce8 in Digikam::ScanController::run (this=0x256a810) at /build/buildd/digikam-3.1.0/core/digikam/database/scancontroller.cpp:705
#4  0x00007f1acb23bbec in QThreadPrivate::start (arg=0x256a810) at thread/qthread_unix.cpp:338
#5  0x00007f1ab363f3b4 in ?? () from /usr/lib/nvidia-310/libGL.so.1
#6  0x00007f1ac5768f8e in start_thread (arg=0x7f1aa82f7700) at pthread_create.c:311
#7  0x00007f1aca458e1d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113

Thread 10 (Thread 0x7f1aa7af6700 (LWP 9104)):
#0  0x00007f1aca44c3cd in poll () at ../sysdeps/unix/syscall-template.S:81
#1  0x00007f1ac2fc81dc in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007f1ac2fc8304 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007f1acb367036 in QEventDispatcherGlib::processEvents (this=0x7f1a980008f0, flags=...) at kernel/qeventdispatcher_glib.cpp:426
#4  0x00007f1acb33738f in QEventLoop::processEvents (this=this@entry=0x7f1aa7af5a10, flags=...) at kernel/qeventloop.cpp:149
#5  0x00007f1acb337618 in QEventLoop::exec (this=this@entry=0x7f1aa7af5a10, flags=...) at kernel/qeventloop.cpp:204
#6  0x00007f1acb239410 in QThread::exec (this=this@entry=0x26981a0) at thread/qthread.cpp:542
#7  0x00007f1acb318edf in QInotifyFileSystemWatcherEngine::run (this=0x26981a0) at io/qfilesystemwatcher_inotify.cpp:256
#8  0x00007f1acb23bbec in QThreadPrivate::start (arg=0x26981a0) at thread/qthread_unix.cpp:338
#9  0x00007f1ab363f3b4 in ?? () from /usr/lib/nvidia-310/libGL.so.1
#10 0x00007f1ac5768f8e in start_thread (arg=0x7f1aa7af6700) at pthread_create.c:311
#11 0x00007f1aca458e1d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113

Thread 9 (Thread 0x7f1a912aa700 (LWP 9764)):
[KCrash Handler]
#6  0x00007f1ace6d8500 in ?? () from /usr/lib/libkdcraw.so.22
#7  0x00007f1ace6d8a19 in ?? () from /usr/lib/libkdcraw.so.22
#8  0x00007f1ace6c04a0 in KDcrawIface::KDcraw::Private::loadFromLibraw(QString const&, QByteArray&, int&, int&, int&) () from /usr/lib/libkdcraw.so.22
#9  0x00007f1ace0d96c5 in Digikam::RAWLoader::load (this=this@entry=0x7f1a912a98d0, filePath=..., observer=observer@entry=0x2a013c0) at /build/buildd/digikam-3.1.0/core/libs/dimg/loaders/rawloader.cpp:125
#10 0x00007f1ace0af5c7 in Digikam::DImg::load (this=this@entry=0x7f1a912a9a70, filePath=..., loadFlagsInt=loadFlagsInt@entry=63, observer=observer@entry=0x2a013c0, rawDecodingSettings=...) at /build/buildd/digikam-3.1.0/core/libs/dimg/dimg.cpp:503
#11 0x00007f1ace0b0370 in Digikam::DImg::load (this=this@entry=0x7f1a912a9a70, filePath=..., observer=observer@entry=0x2a013c0, rawDecodingSettings=...) at /build/buildd/digikam-3.1.0/core/libs/dimg/dimg.cpp:375
#12 0x00007f1ace0b0438 in Digikam::DImg::DImg (this=0x7f1a912a9a70, filePath=..., observer=0x2a013c0, rawDecodingSettings=...) at /build/buildd/digikam-3.1.0/core/libs/dimg/dimg.cpp:113
#13 0x00007f1ace269921 in Digikam::LoadingTask::execute (this=0x2a013b0) at /build/buildd/digikam-3.1.0/core/libs/threadimageio/loadsavetask.cpp:54
#14 0x00007f1ace25c5ae in Digikam::LoadSaveThread::run (this=0x5bcb270) at /build/buildd/digikam-3.1.0/core/libs/threadimageio/loadsavethread.cpp:136
#15 0x00007f1ace2890de in Digikam::DynamicThread::DynamicThreadPriv::run (this=0x40ad2e0) at /build/buildd/digikam-3.1.0/core/libs/threads/dynamicthread.cpp:186
#16 0x00007f1acb22f55d in QThreadPoolThread::run (this=0x3f61500) at concurrent/qthreadpool.cpp:107
#17 0x00007f1acb23bbec in QThreadPrivate::start (arg=0x3f61500) at thread/qthread_unix.cpp:338
#18 0x00007f1ac5768f8e in start_thread (arg=0x7f1a912aa700) at pthread_create.c:311
#19 0x00007f1aca458e1d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113

Thread 8 (Thread 0x7f1a93ffe700 (LWP 9765)):
#0  0x00007f1ac65c7016 in ?? () from /usr/lib/x86_64-linux-gnu/libgomp.so.1
#1  0x00007f1ac65c587e in ?? () from /usr/lib/x86_64-linux-gnu/libgomp.so.1
#2  0x00007f1ac5768f8e in start_thread (arg=0x7f1a93ffe700) at pthread_create.c:311
#3  0x00007f1aca458e1d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113

Thread 7 (Thread 0x7f1a91aab700 (LWP 9766)):
#0  0x00007f1ac65c7016 in ?? () from /usr/lib/x86_64-linux-gnu/libgomp.so.1
#1  0x00007f1ac65c587e in ?? () from /usr/lib/x86_64-linux-gnu/libgomp.so.1
#2  0x00007f1ac5768f8e in start_thread (arg=0x7f1a91aab700) at pthread_create.c:311
#3  0x00007f1aca458e1d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113

Thread 6 (Thread 0x7f1a90aa9700 (LWP 9767)):
#0  0x00007f1ac65c7016 in ?? () from /usr/lib/x86_64-linux-gnu/libgomp.so.1
#1  0x00007f1ac65c587e in ?? () from /usr/lib/x86_64-linux-gnu/libgomp.so.1
#2  0x00007f1ac5768f8e in start_thread (arg=0x7f1a90aa9700) at pthread_create.c:311
#3  0x00007f1aca458e1d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113

Thread 5 (Thread 0x7f1a89ffb700 (LWP 9768)):
#0  0x00007f1ac65c7016 in ?? () from /usr/lib/x86_64-linux-gnu/libgomp.so.1
#1  0x00007f1ac65c587e in ?? () from /usr/lib/x86_64-linux-gnu/libgomp.so.1
#2  0x00007f1ac5768f8e in start_thread (arg=0x7f1a89ffb700) at pthread_create.c:311
#3  0x00007f1aca458e1d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113

Thread 4 (Thread 0x7f1a897fa700 (LWP 9769)):
#0  0x00007f1ac65c7016 in ?? () from /usr/lib/x86_64-linux-gnu/libgomp.so.1
#1  0x00007f1ac65c587e in ?? () from /usr/lib/x86_64-linux-gnu/libgomp.so.1
#2  0x00007f1ac5768f8e in start_thread (arg=0x7f1a897fa700) at pthread_create.c:311
#3  0x00007f1aca458e1d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113

Thread 3 (Thread 0x7f1a88ff9700 (LWP 9770)):
#0  0x00007f1ac65c7016 in ?? () from /usr/lib/x86_64-linux-gnu/libgomp.so.1
#1  0x00007f1ac65c587e in ?? () from /usr/lib/x86_64-linux-gnu/libgomp.so.1
#2  0x00007f1ac5768f8e in start_thread (arg=0x7f1a88ff9700) at pthread_create.c:311
#3  0x00007f1aca458e1d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113

Thread 2 (Thread 0x7f1a5bfff700 (LWP 9771)):
#0  0x00007f1ac65c7016 in ?? () from /usr/lib/x86_64-linux-gnu/libgomp.so.1
#1  0x00007f1ac65c587e in ?? () from /usr/lib/x86_64-linux-gnu/libgomp.so.1
#2  0x00007f1ac5768f8e in start_thread (arg=0x7f1a5bfff700) at pthread_create.c:311
#3  0x00007f1aca458e1d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113

Thread 1 (Thread 0x7f1ad09e1a80 (LWP 9100)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x00007f1acb23c14b in wait (time=18446744073709551615, this=0x2a20f00) at thread/qwaitcondition_unix.cpp:86
#2  QWaitCondition::wait (this=this@entry=0x2a20ea0, mutex=0x2a20e78, time=time@entry=18446744073709551615) at thread/qwaitcondition_unix.cpp:158
#3  0x00007f1acb22ed2f in QThreadPoolPrivate::waitForDone (this=0x2a20df0, msecs=msecs@entry=-1) at concurrent/qthreadpool.cpp:298
#4  0x00007f1acb2307dd in QThreadPool::~QThreadPool (this=0x2a44b80, __in_chrg=<optimized out>) at concurrent/qthreadpool.cpp:440
#5  0x00007f1acb230819 in QThreadPool::~QThreadPool (this=0x2a44b80, __in_chrg=<optimized out>) at concurrent/qthreadpool.cpp:442
#6  0x00007f1acb34b232 in QObjectPrivate::deleteChildren (this=this@entry=0x2a49750) at kernel/qobject.cpp:1907
#7  0x00007f1acb351f66 in QObject::~QObject (this=0x2a41e00, __in_chrg=<optimized out>) at kernel/qobject.cpp:926
#8  0x00007f1ace285f27 in ~ThreadManagerCreator (this=0x2a41e00, __in_chrg=<optimized out>) at /build/buildd/digikam-3.1.0/core/libs/threads/threadmanager.cpp:236
#9  destroy () at /build/buildd/digikam-3.1.0/core/libs/threads/threadmanager.cpp:241
#10 0x00007f1aca39b121 in __run_exit_handlers (status=1, listp=0x7f1aca7206a8 <__exit_funcs>, run_list_atexit=run_list_atexit@entry=true) at exit.c:77
#11 0x00007f1aca39b1a5 in __GI_exit (status=<optimized out>) at exit.c:99
#12 0x00007f1acbd8b348 in qt_xio_errhandler () at kernel/qapplication_x11.cpp:782
#13 0x00007f1acca2a888 in KApplication::xioErrhandler (this=0x7ffff37ed830, dpy=0x24ab5e0) at ../../kdeui/kernel/kapplication.cpp:419
#14 0x00007f1ac896c6de in _XIOError () from /usr/lib/x86_64-linux-gnu/libX11.so.6
#15 0x00007f1ac896a16d in _XEventsQueued () from /usr/lib/x86_64-linux-gnu/libX11.so.6
#16 0x00007f1ac895b75b in XEventsQueued () from /usr/lib/x86_64-linux-gnu/libX11.so.6
#17 0x00007f1acbdc6bdc in x11EventSourceCheck (s=0x249d8e0) at kernel/qguieventdispatcher_glib.cpp:85
#18 0x00007f1ac2fc7c69 in g_main_context_check () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#19 0x00007f1ac2fc8175 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#20 0x00007f1ac2fc8304 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#21 0x00007f1acb367016 in QEventDispatcherGlib::processEvents (this=0x2424c90, flags=...) at kernel/qeventdispatcher_glib.cpp:424
#22 0x00007f1acbdc71ae in QGuiEventDispatcherGlib::processEvents (this=<optimized out>, flags=...) at kernel/qguieventdispatcher_glib.cpp:204
#23 0x00007f1acb33738f in QEventLoop::processEvents (this=this@entry=0x7ffff37ed220, flags=...) at kernel/qeventloop.cpp:149
#24 0x00007f1acb337618 in QEventLoop::exec (this=this@entry=0x7ffff37ed220, flags=...) at kernel/qeventloop.cpp:204
#25 0x00007f1acb33ccf6 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1218
#26 0x00007f1acbd1fffc in QApplication::exec () at kernel/qapplication.cpp:3828
#27 0x000000000048f9ab in main (argc=5, argv=0x7ffff37eda68) at /build/buildd/digikam-3.1.0/core/digikam/main/main.cpp:235

Reported using DrKonqi
Comment 1 caulier.gilles 2013-05-12 18:02:24 UTC
It crash in libkdcraw, probably into libraw.

Which version you use ? Go to Help/components Info for details.

We need a complete GDB backtrace including libkdcraw symbols. Install libkdcraw debug package and try to reproduce the crash into GDB 

http://www.digikam.org/contrib

We need a RAW sample image to reproduce the problem here... Please use an internet sharing service.

Gilles Caulier
Comment 2 Matthias Adrian Mendler 2013-05-12 18:19:33 UTC
Libraw's version is 0.15.0-Beta1
LibKdcraw's version is 2.2.0

I was uploading an example image, here you go:
https://dl.dropboxusercontent.com/u/386222/P1040105.RW2

I hope I made everything right with the gdb backtrace:

#0  0x00007ffff5c85500 in LibRaw::exp_bef (this=0x7fff6a7ae390, shift=<optimized out>, smooth=<optimized out>) at ../../libraw/src/libraw_cxx.cpp:2280
#1  0x00007ffff5c85a19 in LibRaw::dcraw_process (this=this@entry=0x7fff6a7ae390) at ../../libraw/src/libraw_cxx.cpp:2467
#2  0x00007ffff5c6d4a0 in KDcrawIface::KDcraw::Private::loadFromLibraw (this=0x7fff4c012d60, filePath=..., imageData=..., width=@0x7fff6a7fb314: 0, height=@0x7fff6a7fb318: 1275344928, 
    rgbmax=@0x7fff6a7fb31c: 32767) at ../../libkdcraw/kdcraw_p.cpp:506
#3  0x00007ffff5c6a4ef in KDcrawIface::KDcraw::decodeRAWImage (this=this@entry=0x7fff6a7fb8d0, filePath=..., rawDecodingSettings=..., imageData=..., width=@0x7fff6a7fb314: 0, 
    height=@0x7fff6a7fb318: 1275344928, rgbmax=@0x7fff6a7fb31c: 32767) at ../../libkdcraw/kdcraw.cpp:440
#4  0x00007ffff56866c5 in Digikam::RAWLoader::load (this=this@entry=0x7fff6a7fb8d0, filePath=..., observer=observer@entry=0x47d82d0) at /build/buildd/digikam-3.1.0/core/libs/dimg/loaders/rawloader.cpp:125
#5  0x00007ffff565c5c7 in Digikam::DImg::load (this=this@entry=0x7fff6a7fba70, filePath=..., loadFlagsInt=loadFlagsInt@entry=63, observer=observer@entry=0x47d82d0, rawDecodingSettings=...)
    at /build/buildd/digikam-3.1.0/core/libs/dimg/dimg.cpp:503
#6  0x00007ffff565d370 in Digikam::DImg::load (this=this@entry=0x7fff6a7fba70, filePath=..., observer=observer@entry=0x47d82d0, rawDecodingSettings=...)
    at /build/buildd/digikam-3.1.0/core/libs/dimg/dimg.cpp:375
#7  0x00007ffff565d438 in Digikam::DImg::DImg (this=0x7fff6a7fba70, filePath=..., observer=0x47d82d0, rawDecodingSettings=...) at /build/buildd/digikam-3.1.0/core/libs/dimg/dimg.cpp:113
#8  0x00007ffff5816921 in Digikam::LoadingTask::execute (this=0x47d82c0) at /build/buildd/digikam-3.1.0/core/libs/threadimageio/loadsavetask.cpp:54
#9  0x00007ffff58095ae in Digikam::LoadSaveThread::run (this=0x4367be0) at /build/buildd/digikam-3.1.0/core/libs/threadimageio/loadsavethread.cpp:136
#10 0x00007ffff58360de in Digikam::DynamicThread::DynamicThreadPriv::run (this=0x12f2470) at /build/buildd/digikam-3.1.0/core/libs/threads/dynamicthread.cpp:186
#11 0x00007ffff27dc55d in QThreadPoolThread::run (this=0x25ac770) at concurrent/qthreadpool.cpp:107
#12 0x00007ffff27e8bec in QThreadPrivate::start (arg=0x25ac770) at thread/qthread_unix.cpp:338
#13 0x00007fffecd15f8e in start_thread (arg=0x7fff6a7fc700) at pthread_create.c:311
#14 0x00007ffff1a05e1d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113
Comment 3 Alex Tutubalin 2013-05-12 18:32:57 UTC
Stack trace shows crash in exposure correction code (exp_bef() )

What exposure correction settings do you use?
Comment 4 Matthias Adrian Mendler 2013-05-12 18:39:34 UTC
As far as I remember, I imported RW2 files before. (The Panasonic is my girlfriend's camera, not mine).
I have no trouble opening the CR2 raw's from a Canon 60D.

Exposure correction is activated, values 1,85 (linear) 0,00 EV - is this what you mean?
Comment 5 Matthias Adrian Mendler 2013-05-12 18:42:48 UTC
Exposure settings seem to cause the crash.

I opened a CR2 raw file, deactivated exposure correction. Now I could open the RW2 with deactived exposure correction. Now the import worked fine. 

As soon as I activate it again it crashes again (it always crashes after 29%).
Comment 6 Alex Tutubalin 2013-05-12 18:52:55 UTC
0.0EV should convert to no exposure correction?

Gilles, is this true?
Comment 7 Matthias Adrian Mendler 2013-05-12 18:56:24 UTC
Just tried one more thing: The exposure correction settings don't seem to have any impact. Only whether it's activated or not.
Comment 8 Alex Tutubalin 2013-05-12 19:05:21 UTC
Yes, it looks like wrong values are passed to exposure correction code
Comment 9 caulier.gilles 2013-05-24 16:23:15 UTC
Alex,

Crash is fully reproducible here with a RW2 file in same conditions and settings :

digikam(12615)/KDCRAW KDcrawIface::KDcraw::Private::progressCallback: LibRaw progress:  Clearing zero values  pass  0  of  2
digikam(12615)/KDCRAW KDcrawIface::KDcraw::Private::progressCallback: LibRaw progress:  Clearing zero values  pass  1  of  2
digikam(12615)/KDCRAW KDcrawIface::KDcraw::Private::progressCallback: LibRaw progress:  Scaling colors  pass  0  of  2
Scaling with darkness 0, saturation 4080, and
multipliers 1,832700 1,000000 1,760456 1,000000
digikam(12615)/KDCRAW KDcrawIface::KDcraw::Private::progressCallback: LibRaw progress:  Scaling colors  pass  1  of  2
digikam(12615)/KDCRAW KDcrawIface::KDcraw::Private::progressCallback: LibRaw progress:  Pre-interpolating  pass  0  of  2
digikam(12615)/KDCRAW KDcrawIface::KDcraw::Private::progressCallback: LibRaw progress:  Pre-interpolating  pass  1  of  2
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fff63fff700 (LWP 12645)]
LibRaw::exp_bef (this=0x7fff63fb0fc0, shift=<optimized out>, smooth=<optimized out>) at /mnt/devel/GIT/3.x/extra/libkdcraw/libraw/src/libraw_cxx.cpp:2424
2424        C.data_maximum = lut[C.data_maximum];
(gdb) bt
#0  LibRaw::exp_bef (this=0x7fff63fb0fc0, shift=<optimized out>, smooth=<optimized out>) at /mnt/devel/GIT/3.x/extra/libkdcraw/libraw/src/libraw_cxx.cpp:2424
#1  0x00007ffff508336e in LibRaw::dcraw_process (this=0x7fff63fb0fc0) at /mnt/devel/GIT/3.x/extra/libkdcraw/libraw/src/libraw_cxx.cpp:2611
#2  0x00007ffff50676d5 in KDcrawIface::KDcraw::Private::loadFromLibraw (this=0x7fff5c0bcd80, filePath=..., imageData=..., width=@0x7fff63ffe3cc: 1072693248, height=@0x7fff63ffe3c8: 0, rgbmax=
    @0x7fff63ffe3c4: 1085891584) at /mnt/devel/GIT/3.x/extra/libkdcraw/libkdcraw/kdcraw_p.cpp:508
#3  0x00007ffff5064a71 in KDcrawIface::KDcraw::decodeRAWImage (this=0x7fff63ffe540, filePath=..., rawDecodingSettings=..., imageData=..., width=@0x7fff63ffe3cc: 1072693248, height=@0x7fff63ffe3c8: 0, rgbmax=
    @0x7fff63ffe3c4: 1085891584) at /mnt/devel/GIT/3.x/extra/libkdcraw/libkdcraw/kdcraw.cpp:442
#4  0x00007ffff46f98ea in Digikam::RAWLoader::load (this=0x7fff63ffe540, filePath=..., observer=0x37a6620) at /mnt/devel/GIT/3.x/core/libs/dimg/loaders/rawloader.cpp:125
#5  0x00007ffff46ba9e4 in Digikam::DImg::load (this=0x7fff63ffeb60, filePath=..., loadFlagsInt=63, observer=0x37a6620, rawDecodingSettings=...) at /mnt/devel/GIT/3.x/core/libs/dimg/dimg.cpp:503
#6  0x00007ffff46b9cf7 in Digikam::DImg::load (this=0x7fff63ffeb60, filePath=..., observer=0x37a6620, rawDecodingSettings=...) at /mnt/devel/GIT/3.x/core/libs/dimg/dimg.cpp:375
#7  0x00007ffff46b8f93 in Digikam::DImg::DImg (this=0x7fff63ffeb60, filePath=..., observer=0x37a6620, rawDecodingSettings=...) at /mnt/devel/GIT/3.x/core/libs/dimg/dimg.cpp:113
#8  0x00007ffff48b9350 in Digikam::LoadingTask::execute (this=0x37a6610) at /mnt/devel/GIT/3.x/core/libs/threadimageio/loadsavetask.cpp:54
#9  0x00007ffff48a9fcd in Digikam::LoadSaveThread::run (this=0x5a89850) at /mnt/devel/GIT/3.x/core/libs/threadimageio/loadsavethread.cpp:136
#10 0x00007ffff48e76d6 in Digikam::DynamicThread::DynamicThreadPriv::run (this=0x5aa6160) at /mnt/devel/GIT/3.x/core/libs/threads/dynamicthread.cpp:186
#11 0x00007fffece7423d in QThreadPoolThread::run() () from /lib64/libQtCore.so.4
#12 0x00007fffece805ec in QThreadPrivate::start(void*) () from /lib64/libQtCore.so.4
#13 0x00007fffecbf0d18 in start_thread () from /lib64/libpthread.so.0
#14 0x00007fffeb9737cd in clone () from /lib64/libc.so.6
#15 0x0000000000000000 in ?? ()
(gdb) 

Libraw is last 0.15.0.

In Exposure settings, yes
Comment 10 Alex Tutubalin 2013-05-24 16:38:25 UTC
Thanks for dump with source code line.

This is because C.data_maximum is -1 for this camera (so does not set by metadata parser).

I'll release 0.15.1 and 0.14.9 with fix later this week
Comment 11 caulier.gilles 2013-05-24 16:40:09 UTC
Alex,

Exposure correction settings taken from digiKam GUI are just passed to libraw decoder as well. I don't play with is before.

* GUI settings is here :

https://projects.kde.org/projects/kde/kdegraphics/libs/libkdcraw/repository/revisions/master/entry/libkdcraw/dcrawsettingswidget.cpp#L431

* settings from GUI is passed to a simple data container here :

https://projects.kde.org/projects/kde/kdegraphics/libs/libkdcraw/repository/revisions/master/entry/libkdcraw/dcrawsettingswidget.cpp#L1247

* Data container is defined here :

https://projects.kde.org/projects/kde/kdegraphics/libs/libkdcraw/repository/revisions/master/entry/libkdcraw/rawdecodingsettings.h#L342

* Data cointainer is passed to libraw decoder here just before demosaicing :

https://projects.kde.org/projects/kde/kdegraphics/libs/libkdcraw/repository/revisions/master/entry/libkdcraw/kdcraw_p.cpp#L402

To conclude : crash must be reproducible as well to libraw with command line test tools.

Gilles Caulier
Comment 12 caulier.gilles 2013-05-24 16:42:40 UTC
Alex,

I can reproduce the crash in digiKam with this image :

http://digikam3rdparty.free.fr/TEST_IMAGES/RAW/HORIZONTAL/p1000039.rw2

Gilles Caulier
Comment 13 Alex Tutubalin 2013-05-24 17:32:44 UTC
Yes, this is problem with color.data_maximum calculation in 0.15.x (and, possible, with color.channel_maximum[] in 0.14).

Already have a fix for 0.15, checking for backport 	necessity to 0.14 now.

This problem is only for panasonic files (zero-pixel-removal path)
Comment 14 Alex Tutubalin 2013-05-24 17:36:25 UTC
My tests shows that 0.14.8 is not affected. Can someone with (old) digiKam confirm that?
Comment 15 caulier.gilles 2013-05-24 18:25:10 UTC
Alex, i just tested and i can confirm...

Gilles Caulier
Comment 16 Alex Tutubalin 2013-05-24 18:46:31 UTC
LibRaw 0.15.1 released:
  * fixed wrong data maximum calculation for Panasonic files
  * check for possible buffer overrun in exposure correction code

Available from http://www.libraw.org/download
Comment 17 caulier.gilles 2013-05-24 21:07:20 UTC
Git commit 661dab8704f1a8bd401b95107a34b4b13f8b671a by Gilles Caulier.
Committed on 24/05/2013 at 23:06.
Pushed by cgilles into branch 'master'.

update internal libraw to 0.15.1
FIXED-IN: 3.3.0

M  +8    -2    libraw/Changelog.txt
M  +1    -1    libraw/libraw/libraw_version.h
M  +11   -7    libraw/src/libraw_cxx.cpp

http://commits.kde.org/libkdcraw/661dab8704f1a8bd401b95107a34b4b13f8b671a
Comment 18 caulier.gilles 2013-05-25 07:26:51 UTC
Alex,

Comment #7 is true for one Exposure Correction settings : 

- Shift (linear) work as expected
==> raw.imgdata.params.exp_shift
==> Range : [0.5 - 3.0]
==> Default : 1.0 

- Highlight (E.V) : do nothing 
==> raw.imgdata.params.exp_preser
==> Range : [0.0 - 1.0]
==> Default : 0.0

Both settings in GUI can be adjusted at the same time. This is right ? It's not an exclusive settings as shift OR highlight, not both at the same time ?

I can reproduce the dysfunction for CR2 and RW2

Gilles
Comment 19 Alex Tutubalin 2013-05-25 07:44:16 UTC
Created attachment 80062 [details]
P1040105.RW2 with exp_corr = 8.0 and exp_preser = 0.0

P1040105.RW2 with exp_corr = 8.0 and exp_preser = 0.0
Comment 20 Alex Tutubalin 2013-05-25 07:44:36 UTC
Created attachment 80063 [details]
P1040105.RW2 with exp_corr = 8.0 and exp_preser = 1.0

P1040105.RW2 with exp_corr = 8.0 and exp_preser = 1.0
Comment 21 Alex Tutubalin 2013-05-25 07:46:46 UTC
exp_shift is in range 0.25 (-2EV) .. 8.0 (+3EV).

exp_preser sets highlights compression level for exp_shift > 1.0 (it do nothing with negative correction).

See attachments above.  The first one is +3EV (exp_shift=8.0) without highlights compression, the second one is same +3EV but with full highlights preservation.
Comment 22 caulier.gilles 2013-05-25 09:46:16 UTC
Git commit fe048577c7032378ae797ae3ac682b6965e6739d by Gilles Caulier.
Committed on 25/05/2013 at 11:45.
Pushed by cgilles into branch 'master'.

fix exposure correction range. Check if shift adjustement id >= 1.0 to enable highlight compression or not

M  +4    -3    CMakeLists.txt
M  +19   -7    libkdcraw/dcrawsettingswidget.cpp
M  +1    -0    libkdcraw/dcrawsettingswidget.h
M  +2    -1    libkdcraw/rawdecodingsettings.h

http://commits.kde.org/libkdcraw/fe048577c7032378ae797ae3ac682b6965e6739d