Page 1 of 1

Segfault when reading tif file

Posted: 2010-04-08T15:57:20-07:00
by Hadmut
Hi,

when reading tif files (generated from raw files with ufraw) imagemagick dies.

Fetch http://www.danisch.de/tmp/segfault.tif and run

convert segfault.tif segfault.png

(Using Ubuntu 9.10)

regards

Re: Segfault when reading tif file

Posted: 2010-04-08T16:01:36-07:00
by fmw42
Works for me (with warnings about unknown tiff fields) on IM 6.6.1-1 Q16 Mac OSX Tiger

convert segfault.tif segfault.png
convert: segfault.tif: invalid TIFF directory; tags are not sorted in ascending order. `TIFFReadDirectory' @ warning/tiff.c/TIFFWarnings/703.
convert: segfault.tif: unknown field with tag 11 (0xb) encountered. `TIFFReadDirectory' @ warning/tiff.c/TIFFWarnings/703.
convert: segfault.tif: unknown field with tag 50341 (0xc4a5) encountered. `TIFFReadDirectory' @ warning/tiff.c/TIFFWarnings/703.
convert: segfault.tif: unknown field with tag 513 (0x201) encountered. `TIFFReadDirectory' @ warning/tiff.c/TIFFWarnings/703.
convert: segfault.tif: unknown field with tag 514 (0x202) encountered. `TIFFReadDirectory' @ warning/tiff.c/TIFFWarnings/703.
convert: segfault.tif: TIFF directory is missing required "ImageLength" field. `MissingRequired' @ warning/tiff.c/TIFFErrors/493.


Just warnings. The png file looks fine.

What version of IM are you using? If old, probably should upgrade

Re: Segfault when reading tif file

Posted: 2011-12-02T17:33:48-07:00
by DrLou
Am seeing exactly this error - and under a newly built ImageMagick 6.7.2-7 2011-09-22. Below is output both without - and with- the -quiet option:

Code: Select all

$ convert source.tif destination.pdf       
MissingRequired: /var/tmp/magick-ukSEaqlF: TIFF directory is missing required "ImageLength" field.
Memory fault(coredump)

Code: Select all

$ convert -quiet source.tif destination.pdf
MissingRequired: /var/tmp/magick-lzejaOgF: TIFF directory is missing required "ImageLength" field.
Memory fault(coredump)

Then, on the same machine, tried this with the prepackaged (older) install of ImageMagick 6.3.4 07/16/11:

Code: Select all

$ convert source.tif destination.pdf               
convert: 1000335.tif: unknown field with tag 33000 (0x80e8) encountered. `TIFFReadDirectory'.
(produces a 4K nonsense destination.pdf file, then says:) 
convert: unable to open file `destination.pdf': No such file or directory.

Code: Select all

$ convert -quiet source.tif destination.pdf
(produces a 4K nonsense destination.pdf file, then says:)          
convert: unable to open file `destination.pdf': No such file or directory.
Yes, some of these are files coming from probably old fax machines. This is clearly something many have seen before; am I uncovering a new twist on an old bug, or is there some build option I should be aware of?

Many thanks. Lou

Re: Segfault when reading tif file

Posted: 2011-12-25T12:30:35-07:00
by netslov
Hello,
The same file segfault.tif from bug https://bugs.launchpad.net/ubuntu/+sour ... bug/559021
is converted with warnings by ImageMagick 6.6.0-4 2011-06-15 Q16 using convert.

But fails to do the same from PERL ( 8:6.6.0.4-3ubuntu1 ) with error:
Exception 350: segfault.tif: TIFF directory is missing required "ImageLength" field. `MissingRequired' @ warning/tiff.c TIFFErrors/493

Also cannot read with perl any tiff file, created by ufraw-batch.

Please fix.

Re: Segfault when reading tif file

Posted: 2011-12-25T19:04:32-07:00
by magick
Done. We had to relax when PerlMagick tosses an image when an exception is thrown.

Re: Segfault when reading tif file

Posted: 2012-01-03T17:16:56-07:00
by netslov
Thank you for the software and for the all job done!

Thanks