Segfault when reading tif file

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
Hadmut

Segfault when reading tif file

Post 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
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Segfault when reading tif file

Post 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
DrLou
Posts: 2
Joined: 2011-12-02T17:10:22-07:00
Authentication code: 8675308

Re: Segfault when reading tif file

Post 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
netslov
Posts: 2
Joined: 2011-12-25T12:23:07-07:00
Authentication code: 8675308

Re: Segfault when reading tif file

Post 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.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Segfault when reading tif file

Post by magick »

Done. We had to relax when PerlMagick tosses an image when an exception is thrown.
netslov
Posts: 2
Joined: 2011-12-25T12:23:07-07:00
Authentication code: 8675308

Re: Segfault when reading tif file

Post by netslov »

Thank you for the software and for the all job done!

Thanks
Post Reply