Summary: | digikam crashes when trying to decode Panasonic Raw (.rw2) | ||
---|---|---|---|
Product: | [Applications] digikam | Reporter: | Matthias Adrian Mendler <matthias.mendler> |
Component: | Plugin-DImg-RAW | Assignee: | Digikam Developers <digikam-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | crash | CC: | caulier.gilles, lexa |
Priority: | NOR | ||
Version: | 3.1.0 | ||
Target Milestone: | --- | ||
Platform: | Ubuntu | ||
OS: | Linux | ||
Latest Commit: | http://commits.kde.org/libkdcraw/661dab8704f1a8bd401b95107a34b4b13f8b671a | Version Fixed In: | 3.3.0 |
Sentry Crash Report: | |||
Attachments: |
P1040105.RW2 with exp_corr = 8.0 and exp_preser = 0.0
P1040105.RW2 with exp_corr = 8.0 and exp_preser = 1.0 |
Description
Matthias Adrian Mendler
2013-05-12 17:56:14 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 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 Stack trace shows crash in exposure correction code (exp_bef() ) What exposure correction settings do you use? 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? 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%). 0.0EV should convert to no exposure correction? Gilles, is this true? Just tried one more thing: The exposure correction settings don't seem to have any impact. Only whether it's activated or not. Yes, it looks like wrong values are passed to exposure correction code 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 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 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 Alex, I can reproduce the crash in digiKam with this image : http://digikam3rdparty.free.fr/TEST_IMAGES/RAW/HORIZONTAL/p1000039.rw2 Gilles Caulier 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) My tests shows that 0.14.8 is not affected. Can someone with (old) digiKam confirm that? Alex, i just tested and i can confirm... Gilles Caulier 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 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 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 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
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
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. 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 |