Bug 182611 - segfault with Samsung S85 RAW images
Summary: segfault with Samsung S85 RAW images
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Plugin-DImg-RAW (show other bugs)
Version: unspecified
Platform: Debian testing Linux
: NOR crash
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-31 18:34 UTC by Edelhard Becker
Modified: 2019-12-23 17:22 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 7.0.0
Sentry Crash Report:


Attachments
screenshot of digiKam 0.10.0-rc2 Raw import tool try to decode S85 RAW file (293.61 KB, image/png)
2009-02-06 08:32 UTC, caulier.gilles
Details
Samsung S85 RAW can be decoded with libraw 0.6.0... (670.91 KB, image/png)
2009-02-06 08:47 UTC, caulier.gilles
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Edelhard Becker 2009-01-31 18:34:58 UTC
Version:           0.2.0~rc1 (using KDE 4.2.0)
Compiler:          gcc 4.3.2 from Debian experimental (i.e. the version is guessed)
OS:                Linux
Installed from:    Debian testing/unstable Packages

The S85 is relatively new supported in dcraw. It always stores
.RAW *and* .JPG files and the .RAW doesn't contain any
metadata. Therefore dcraw has to open both files (that *may*
be part of the problem..) Anyway, when importing a .RAW to
digikam with kipi raw importer enabled (and also when running
dngconverter on a .RAW file) the apps crash. The Kcrash
handler doesn't show anything useful (i run the app in a
virtual xen machine with Debian experimental via ssh) but the
last trace messages on the console are:

Reading metadata from /root/Pictures/Landscape/SN850510.JPG ...
*** glibc detected *** digikam: double free or corruption (!prev): 0x08b2f8b8 ***
======= Backtrace: =========
/lib/libc.so.6[0xb558b225]
/lib/libc.so.6(cfree+0x9c)[0xb558cafc]
/lib/libc.so.6(fclose+0x145)[0xb557b375]
/usr/lib/libkdcraw.so.7[0xb7772569]
/usr/lib/libkdcraw.so.7(_ZN11KDcrawIface6KDcraw15rawFileIdentifyERNS_18DcrawInfoContainerERK7QString+0x5f7)[0xb776d4f7]
/usr/lib/libdigikamcore.so.1(_ZNK7Digikam9DMetadata14loadUsingDcrawERK7QString+0x1d7)[0xb716d877]
/usr/lib/libdigikamcore.so.1(_ZNK7Digikam9DMetadata4loadERK7QString+0x54)[0xb716e024]
/usr/lib/libdigikamdatabase.so.1(_ZN7Digikam12ImageScanner12loadFromDiskEv+0x41)[0xb6fdccb1]
/usr/lib/libdigikamdatabase.so.1(_ZN7Digikam12ImageScanner7newFileEi+0x22)[0xb6fe4962]
/usr/lib/libdigikamdatabase.so.1(_ZN7Digikam17CollectionScanner11scanNewFileERK9QFileInfoi+0xe9)[0xb6fd64c9]
/usr/lib/libdigikamdatabase.so.1(_ZN7Digikam17CollectionScanner9scanAlbumERKNS_18CollectionLocationERK7QString+0xff7)[0xb6fd7d77]
/usr/lib/libdigikamdatabase.so.1(_ZN7Digikam17CollectionScanner9scanAlbumERKNS_18CollectionLocationERK7QString+0xd38)[0xb6fd7ab8]
/usr/lib/libdigikamdatabase.so.1(_ZN7Digikam17CollectionScanner13scanAlbumRootERKNS_18CollectionLocationE+0x87)[0xb6fd8727]
/usr/lib/libdigikamdatabase.so.1(_ZN7Digikam17CollectionScanner12completeScanEv+0x1fe)[0xb6fd89ce]
digikam[0x829220f]
/usr/lib/libQtCore.so.4[0xb57da52e]
/lib/libpthread.so.0[0xb5213f51]
/lib/libc.so.6(clone+0x5e)[0xb55ed61e]
=============== snip! ============= EOTrace =========

Plain dcraw from commandline and ufraw do work without
problems on these .RAW files.
Please contact me via PM if you need a sample image.

Greetings,
Edelhard
Comment 1 caulier.gilles 2009-01-31 18:48:44 UTC
It's a binary compatibility broken with libkdcraw installed on your computer.

Check your system...

Note : digiKam and kipi-plugins don't use dcraw program (thrue libkdcraw) but libraw now...

Gilles Caulier
Comment 2 caulier.gilles 2009-02-03 09:06:16 UTC
Edelhard,

Are you read me comment #1 ?

Gilles Caulier
Comment 3 Edelhard Becker 2009-02-03 10:55:02 UTC
(In reply to comment #2)
> Are you read me comment #1 ?

ahh, yes, sorry for the silence, but i'm still puzzled what exactly to do now.
As explained, im testing this in Debian experimental, with precompiled
binaries. I did not compile anything locally, so i can not "check my system"
apart from resolving all dependencies as they are requiered by the debian
packages. All packages currently are from the 4.2.0 KDE Release (Debian
revision -1) including libkdcraw7 and libkipi6. Only the kipi-plugins package
has version 0.2.0~rc1-1. See
    http://packages.debian.org/experimental/kipi-plugins
for all dependencies that i have installed.
So is this a bug i should report to the debian package maintainers of
kipi-plugins? Or libkdcraw? Or should i try to install libkdcraw debug
packages (with symbols) and run my test under gdb?

Edelhard - still puzzled (as the error message points to a free()ed pointer
in libkdcraw...
Comment 4 caulier.gilles 2009-02-03 11:05:57 UTC
Luka ?

Gilles
Comment 5 Luka Renko 2009-02-03 20:02:44 UTC
Installing appropriate -dbg packages would help. Not sure about Debian packages, but this may be actually related to specific RAW file.
Would it be possible to send this specific file over e-mail so that we can try on some other system?
Comment 6 caulier.gilles 2009-02-06 08:30:29 UTC
I can confirm that S85 RAW file cannot be decoded  with LibRaw 0.7.0. Of course S85 RAW file is supported officially. Look messages from the console:

digikam(13889) Digikam::DImg::load: "/mnt/data/photos/Albums/Test Pictures/RAW/Horizontal/SN850452.RAW"  : RAW file identified
digikam(13889) KExiv2Iface::KExiv2Priv::printExiv2ExceptionError: Cannot load metadata using Exiv2   (Error # 11 :  /mnt/data/photos/Albums/Test Pictures/RAW/Horizontal/SN850452.RAW: The file contains data of an unknown image type                     
Failed to read metadata from /mnt/data/photos/Albums/Test Pictures/RAW/Horizontal/SN850452.JPG                               
digikam(13889) KDcrawIface::KDcraw::loadFromDcraw: LibRaw: dcraw emulation:  ("-4", "-h", "-H 0", "-w", "-q 3", "-o 1", "/mnt/data/photos/Albums/Test Pictures/RAW/Horizontal/SN850452.RAW")                                                               
digikam(13889) KDcrawIface::KDcrawPriv::progressCallback: LibRaw progress:  Reading metadata  pass  0  of  2                 
Failed to read metadata from /mnt/data/photos/Albums/Test Pictures/RAW/Horizontal/SN850452.JPG                               
digikam(13889) KDcrawIface::KDcrawPriv::progressCallback: LibRaw progress:  Reading metadata  pass  1  of  2                 
digikam(13889) KDcrawIface::KDcrawPriv::progressCallback: LibRaw progress:  Reading RAW data  pass  0  of  2                 
Exception 4 caught                                                                                                           
digikam(13889) KDcrawIface::KDcraw::loadFromDcraw: LibRaw: failed to run unpack:  Input/output error                         
digikam(13889) Digikam::CollectionManager::locationForPath: Testing location  1 "/mnt/data/photos/Albums/Test Pictures/RAW/Horizontal" "/mnt/data/photos"

This problem come from LibRaw integrated from libkdcraw. Alex Tutubalin have been contacted for investiguations.

Gilles Caulier
Comment 7 caulier.gilles 2009-02-06 08:32:01 UTC
Created attachment 31015 [details]
screenshot of digiKam 0.10.0-rc2 Raw import tool try to decode S85 RAW file
Comment 8 caulier.gilles 2009-02-06 08:47:37 UTC
Created attachment 31016 [details]
Samsung S85 RAW can be decoded with libraw 0.6.0...
Comment 9 Alex Tutubalin 2009-02-06 17:31:24 UTC
I cannot reproduce this problem with LibRaw 0.7.0-Alpha5 samples.

Will try with digiKam 
Comment 10 Alex Tutubalin 2009-02-07 19:53:37 UTC
Fixed in LibRaw 0.7.0-Alpha6

Also, please note, that you need to place both .RAW and .JPG together (in same folder) to get right metadata extraction (i.e. exposure settings, lens settings).

On S85 .RAW file is just a sensor data dump, all metadata is placed into .JPG with same filename.
Comment 11 caulier.gilles 2009-02-23 22:03:00 UTC
Edelhard,

As Alex said in #13, It fixed in svn. Please checkout current code of libkdcraw, recompile all, and check if it's fixed for you.

Thanks in advance.

Gilles Caulier
Comment 12 Edelhard Becker 2009-02-24 12:20:13 UTC
Hi Gilles,

sorry for the delay[1]. Now i checked out SVN, let it compile over night and
it works! I close the bug and thank you all very much! The .dng looks a bit
"wrong", but i'll have to play with the metadata[2] to find the reason.

Thanks & Greetings,
Edelhard

[1] i had hoped that i get the next snapshot via debian/experimental, but
    compilation was surprisingly smooth!
[2] it's too dark and the colors are wrong, but i can correct it with the
    appropriate sliders in showfoto/digikam and also ufraw; from a quick look
    with exiftool the following values (at least) seem strange:
    White Level                     : 65535
    Reference Black White           : 0 255 128 255 128 255
Comment 13 caulier.gilles 2019-12-23 17:22:35 UTC
Not reproducible with digiKam 7.0.0-beta1.