Bug 162132 - crash while saving tiff (possibly caused by present alpha channel)
Summary: crash while saving tiff (possibly caused by present alpha channel)
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Plugin-DImg-TIFF (show other bugs)
Version: unspecified
Platform: Gentoo Packages Linux
: NOR crash
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-05-15 20:31 UTC by DrSlony
Modified: 2017-08-01 20:21 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.0.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description DrSlony 2008-05-15 20:31:28 UTC
Version:           0.8.0 (using KDE 3.5.9)
Installed from:    Gentoo Packages
Compiler:          gcc-4.2.3 
OS:                Linux

ShowFoto crashes when saving certain images as tiff. So far it seems that it crashes when the image has an alpha channel.

GNU gdb 6.7.1
Copyright (C) 2007 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu"...
(no debugging symbols found)
Using host libthread_db library "/lib/libthread_db.so.1".
(gdb) run
Starting program: /usr/bin/showfoto 
(no debugging symbols found)
---Type <return> to continue, or q <return> to quit---
(no debugging symbols found)
---Type <return> to continue, or q <return> to quit---
(no debugging symbols found)
[Thread debugging using libthread_db enabled]
[New Thread 0x2b3aba3a28e0 (LWP 2956)]
(no debugging symbols found)
Found dcraw version: 8.83
[New Thread 0x40800950 (LWP 2960)]
(no debugging symbols found)
(no debugging symbols found)
---Type <return> to continue, or q <return> to quit---
(no debugging symbols found)
showfoto: ImagePlugin_Core plugin loaded
showfoto: ImagePluginLoader: Loaded plugin ImagePlugin_Core
(no debugging symbols found)
showfoto: ImagePlugin_RainDrop plugin loaded
showfoto: ImagePluginLoader: Loaded plugin ImagePlugin_RainDrop
(no debugging symbols found)
showfoto: ImagePlugin_InPainting plugin loaded
showfoto: ImagePluginLoader: Loaded plugin ImagePlugin_InPainting
(no debugging symbols found)
showfoto: ImagePlugin_Infrared plugin loaded
showfoto: ImagePluginLoader: Loaded plugin ImagePlugin_Infrared
(no debugging symbols found)
showfoto: ImagePlugin_Texture plugin loaded
showfoto: ImagePluginLoader: Loaded plugin ImagePlugin_Texture
(no debugging symbols found)
showfoto: ImagePlugin_Border plugin loaded
showfoto: ImagePluginLoader: Loaded plugin ImagePlugin_Border
---Type <return> to continue, or q <return> to quit---
(no debugging symbols found)
showfoto: ImagePlugin_OilPaint plugin loaded
showfoto: ImagePluginLoader: Loaded plugin ImagePlugin_OilPaint
(no debugging symbols found)
showfoto: ImagePlugin_InsertText plugin loaded
showfoto: ImagePluginLoader: Loaded plugin ImagePlugin_InsertText
(no debugging symbols found)
showfoto: ImagePlugin_Emboss plugin loaded
showfoto: ImagePluginLoader: Loaded plugin ImagePlugin_Emboss
(no debugging symbols found)
showfoto: ImagePlugin_NoiseReduction plugin loaded
showfoto: ImagePluginLoader: Loaded plugin ImagePlugin_NoiseReduction
(no debugging symbols found)
showfoto: ImagePlugin_HotPixels plugin loaded
showfoto: ImagePluginLoader: Loaded plugin ImagePlugin_HotPixels
(no debugging symbols found)
showfoto: ImagePlugin_AdjustLevels plugin loaded
showfoto: ImagePluginLoader: Loaded plugin ImagePlugin_AdjustLevels
(no debugging symbols found)
showfoto: ImagePlugin_ShearTool plugin loaded
showfoto: ImagePluginLoader: Loaded plugin ImagePlugin_ShearTool
(no debugging symbols found)
showfoto: ImagePlugin_DistortionFX plugin loaded
showfoto: ImagePluginLoader: Loaded plugin ImagePlugin_DistortionFX
(no debugging symbols found)
showfoto: ImagePlugin_LensDistortion plugin loaded
showfoto: ImagePluginLoader: Loaded plugin ImagePlugin_LensDistortion
(no debugging symbols found)
showfoto: ImagePlugin_FilmGrain plugin loaded
showfoto: ImagePluginLoader: Loaded plugin ImagePlugin_FilmGrain
(no debugging symbols found)
showfoto: ImagePlugin_ColorFX plugin loaded
showfoto: ImagePluginLoader: Loaded plugin ImagePlugin_ColorFx
(no debugging symbols found)
showfoto: ImagePlugin_Restoration plugin loaded
showfoto: ImagePluginLoader: Loaded plugin ImagePlugin_Restoration
(no debugging symbols found)
showfoto: ImagePlugin_SuperImpose plugin loaded
showfoto: ImagePluginLoader: Loaded plugin ImagePlugin_SuperImpose
(no debugging symbols found)
showfoto: ImagePlugin_WhiteBalance plugin loaded
showfoto: ImagePluginLoader: Loaded plugin ImagePlugin_WhiteBalance
(no debugging symbols found)
showfoto: ImagePlugin_BlurFX plugin loaded
showfoto: ImagePluginLoader: Loaded plugin ImagePlugin_BlurFX
(no debugging symbols found)
showfoto: ImagePlugin_AntiVignetting plugin loaded
showfoto: ImagePluginLoader: Loaded plugin ImagePlugin_AntiVignetting
(no debugging symbols found)
showfoto: ImagePlugin_AdjustCurves plugin loaded
showfoto: ImagePluginLoader: Loaded plugin ImagePlugin_AdjustCurves
(no debugging symbols found)
showfoto: ImagePlugin_FreeRotation plugin loaded
showfoto: ImagePluginLoader: Loaded plugin ImagePlugin_FreeRotation
(no debugging symbols found)
showfoto: ImagePlugin_Perspective plugin loaded
showfoto: ImagePluginLoader: Loaded plugin ImagePlugin_Perspective
---Type <return> to continue, or q <return> to quit---
(no debugging symbols found)
showfoto: ImagePlugin_ChannelMixer plugin loaded
showfoto: ImagePluginLoader: Loaded plugin ImagePlugin_ChannelMixer
(no debugging symbols found)
showfoto: ImagePlugin_Charcoal plugin loaded
showfoto: ImagePluginLoader: Loaded plugin ImagePlugin_Charcoal
QFile::open: No file name specified
QFile::open: No file name specified
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
showfoto: fileformats=*.dds *.DDS *..hdr *..HDR *..pic *..PIC *.pbm *.PBM *.pbmraw *.PBMRAW *.pcx *.PCX *.pgm *.PGM *.pgmraw *.PGMRAW *.xbm *.XBM *.xcf *.XCF *.tga *.TGA *.ico *.ICO *.png *.PNG *.ppm *.PPM *.pnm *.PNM *.ppmraw *.PPMRAW *.psd *.PSD *.jpg *.JPG *.jpeg *.JPEG *.xpm *.XPM *.eps *.EPS *.epsi *.EPSI *.epsf *.EPSF *.tiff *.TIFF *.tif *.TIF *.mng *.MNG *.bmp *.BMP *.jp2 *.JP2 *.rgb *.RGB *.rgba *.RGBA *.bw *.BW *.sgi *.SGI *.gif *.GIF*.bay *.bmq *.cr2 *.crw *.cs1 *.dc2 *.dcr *.dng *.erf *.fff *.hdr *.k25 *.kdc *.mdc *.mos *.mrw *.nef *.orf *.pef *.pxn *.raf *.raw *.rdc *.sr2 *.srf *.x3f *.arw *.JPE *.TIF|All Pictures
*..hdr *..HDR *..pic *..PIC|High Dynamic Range Image
*.bmp *.BMP|BMP Image
*.dds *.DDS|Direct Draw Surface
*.eps *.EPS *.epsi *.EPSI *.epsf *.EPSF|Encapsulated PostScript Image
*.gif *.GIF|GIF Image
*.ico *.ICO|Windows Icon
*.jp2 *.JP2|JPEG 2000 Image
*.jpg *.JPG *.jpeg *.JPEG|JPEG Image
*.mng *.MNG|MNG Image
*.pbm *.PBM *.pbmraw *.PBMRAW|Portable Bitmap Image
*.pcx *.PCX|PCX Image
*.pgm *.PGM *.pgmraw *.PGMRAW|Portable Graymap Image
*.png *.PNG|PNG Image
*.ppm *.PPM *.pnm *.PNM *.ppmraw *.PPMRAW|Portable Pixmap Image
*.psd *.PSD|Adobe Photoshop Image
*.rgb *.RGB *.rgba *.RGBA *.bw *.BW *.sgi *.SGI|SGI Image (RGB)
*.tga *.TGA|Truevision Targa Image
*.tiff *.TIFF *.tif *.TIF|TIFF Image
*.xbm *.XBM|X BitMap Image
*.xcf *.XCF|GIMP Image
*.xpm *.XPM|X PixMap Image

*.bay *.bmq *.cr2 *.crw *.cs1 *.dc2 *.dcr *.dng *.erf *.fff *.hdr *.k25 *.kdc *.mdc *.mos *.mrw *.nef *.orf *.pef *.pxn *.raf *.raw *.rdc *.sr2 *.srf *.x3f *.arw|Camera RAW files
Cannot load metadata using Exiv2  (/home/drslony/temp: The file contains data of an unknown image type)
showfoto: /home/drslony/temp/20080513_zg_roof_5_47_rh4_tonemapped.png : PNG file identified
Exif Orientation: 1
(no debugging symbols found)
showfoto: mimetypes=image/x-portable-bitmap image/x-pcx image/x-portable-greymap image/x-xbm image/x-targa image/png image/x-portable-pixmap image/jpeg image/x-xpm image/x-eps image/x-bmp image/jp2 image/x-rgb image/tiff
QFile::open: No file name specified
QFile::open: No file name specified
showfoto: Saving to :/home/drslony/temp/FiO0rc.digikamtempfile.tmp (tiff)
(800 x 474) JPEG image preview size: 45525 bytes

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x40800950 (LWP 2960)]
0x0000003e6900be2a in ?? () from /usr/lib64/libtiff.so.3
(gdb) bt
#0  0x0000003e6900be2a in ?? () from /usr/lib64/libtiff.so.3
#1  0x0000003e6900b5a3 in TIFFSetField () from /usr/lib64/libtiff.so.3
#2  0x0000000000487a23 in ?? ()
#3  0x0000000000479b27 in ?? ()
#4  0x0000000000497fb8 in ?? ()
#5  0x000000000048ca95 in ?? ()
#6  0x0000003e6310cfdb in QThreadInstance::start () from /usr/qt/3/lib64/libqt-mt.so.3
#7  0x0000003e5b805fe7 in start_thread () from /lib/libpthread.so.0
#8  0x0000003e5acc1b9d in clone () from /lib/libc.so.6
#9  0x0000000000000000 in ?? ()
Comment 1 caulier.gilles 2008-05-15 20:51:09 UTC
DrSlony,

You backtrace is not suitable. Mine is better :

/bin/sh -c libtool gdb /home/gilles/Documents/devel/SVN/branch/kde3/graphics/digikam/showfoto/showfoto --interpreter=mi2 -quiet
Using host libthread_db library "/lib/i686/libthread_db.so.1".
(gdb) bt
bt
#0  0xb7cf926d in QWidget::setUpdatesEnabled () from /usr/lib/libtiff.so.3
#1  0xb430c0b0 in ?? ()
#2  0x00000152 in ?? ()
#3  0xb7cf7cea in TIFFVSetField () from /usr/lib/libtiff.so.3
#4  0xb7cf877e in TIFFSetField () from /usr/lib/libtiff.so.3
#5  0x080d81c3 in Digikam::TIFFLoader::save (this=0xb5cc32c8, filePath=@0x8564920, observer=0x8564918) at tiffloader.cpp:502
#6  0x080d10da in Digikam::DImg::save (this=0x856491c, filePath=@0x8564920, format=@0x8564924, observer=0x8564918) at dimg.cpp:459
#7  0x080e0231 in Digikam::SavingTask::execute (this=0x8564910) at loadsavetask.cpp:398
#8  0x080decda in Digikam::LoadSaveThread::run (this=0x82e7aa8) at loadsavethread.cpp:122
#9  0xb6bc43ea in QThreadInstance::start () from /usr/lib/qt3/lib/libqt-mt.so.3
#10 0xb66974e2 in start_thread () from /lib/i686/libpthread.so.0
#11 0xb613c47e in clone () from /lib/i686/libc.so.6
Current language:  auto; currently c++
^done(gdb) quitquit
The program is running.  Exit anyway? (y or n) [answered Y; input not from terminal]
(gdb) Process exited
/bin/sh -c libtool gdb /home/gilles/Documents/devel/SVN/branch/kde3/graphics/digikam/showfoto/showfoto --interpreter=mi2 -quiet
Using host libthread_db library "/lib/i686/libthread_db.so.1".
(gdb) bt
bt
#0  0xb7d0426d in QWidget::setUpdatesEnabled () from /usr/lib/libtiff.so.3
#1  0xb4308cd0 in ?? ()
#2  0x00000152 in ?? ()
#3  0xb7d02cea in TIFFVSetField () from /usr/lib/libtiff.so.3
#4  0xb7d0377e in TIFFSetField () from /usr/lib/libtiff.so.3
#5  0x080d81c3 in Digikam::TIFFLoader::save (this=0xb5cce2c8, filePath=@0x83762e8, observer=0x83762e0) at tiffloader.cpp:502
#6  0x080d10da in Digikam::DImg::save (this=0x83762e4, filePath=@0x83762e8, format=@0x83762ec, observer=0x83762e0) at dimg.cpp:459
#7  0x080e0231 in Digikam::SavingTask::execute (this=0x83762d8) at loadsavetask.cpp:398
#8  0x080decda in Digikam::LoadSaveThread::run (this=0x82e7a68) at loadsavethread.cpp:122
#9  0xb6bcf3ea in QThreadInstance::start () from /usr/lib/qt3/lib/libqt-mt.so.3
#10 0xb66a24e2 in start_thread () from /lib/i686/libpthread.so.0
#11 0xb614747e in clone () from /lib/i686/libc.so.6
^done

Marcel,

Look like the crash appear when digiKam set alpha channel with libtiff. There is no reason for that

The PNG file to test has Alpha channel. It can be converted to TIFF file without any problem using ImageMagick. So something is wrong in digiKam tiffloader.

If you want to test, the PNG image is here: 

http://www.panopixel.org/drslony/20080513_zg_roof_5_47_rh4_tonemapped.png

Arnd, 

Are you able to reproduce the crash on your computer ?

Gilles Caulier
Comment 2 caulier.gilles 2008-05-15 21:33:19 UTC
SVN commit 808143 by cgilles:

fix crash with libtiff when we set alpha channel to new tiff file
BUGS: 162132


 M  +3 -2      tiffloader.cpp  
 M  +1 -1      tiffloader.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=808143
Comment 3 caulier.gilles 2008-05-15 21:35:14 UTC
SVN commit 808145 by cgilles:

backport commit #808143 from KDE3 branch
CCBUGS: 162132


 M  +3 -2      tiffloader.cpp  
 M  +1 -1      tiffloader.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=808145
Comment 4 DrSlony 2016-07-03 11:08:58 UTC
I received an email about this issue today, so I tried to reproduce just in case.

Cannot reproduce in digikam-5.0.0 http://commits.kde.org/digikam/09b876a13385981c39053cb8562167817204b58c