Page 1 of 1

SEG fault in tiff

Posted: 2009-01-21T03:21:03-07:00
by a68254
I get this in a specific tif file http://www.encode.dk/156974.tif

I've tried both IM ver mageMagick-6.3.8-11

and to be on the safe side, the newer ImageMagick-6.4.8-7

same problem, I'm aware that it is most likely a problem either in the libtiff or the tiff itself, is it possible someone could shed some more light on the issue.
Other tifs are working fine, which leads me to believe it's a tif error and not a library error

convert -debug -depth 8 -resize 200x200 -density 150 +profile iptc -compress None -colorspace RGB -strip ../Files/tmp/156974.tif ../Files/tmp/156974.tif.jpg

unknown field with tag 37724 (0x935c) encountered. `TIFFReadDirectory'
2009-01-21T11:07:41+01:00 0:01 0.040u 6.3.8 Coder convert[6266]: tiff.c/unknown/707/Coder
Geometry: 472x709
2009-01-21T11:07:41+01:00 0:01 0.040u 6.3.8 Coder convert[6266]: tiff.c/unknown/709/Coder
Interlace: 1
2009-01-21T11:07:41+01:00 0:01 0.040u 6.3.8 Coder convert[6266]: tiff.c/unknown/711/Coder
Bits per sample: 8
2009-01-21T11:07:41+01:00 0:01 0.040u 6.3.8 Coder convert[6266]: tiff.c/unknown/713/Coder
Min sample value: 0
2009-01-21T11:07:41+01:00 0:01 0.040u 6.3.8 Coder convert[6266]: tiff.c/unknown/715/Coder
Max sample value: 255
2009-01-21T11:07:41+01:00 0:01 0.040u 6.3.8 Coder convert[6266]: tiff.c/unknown/753/Coder
Photometric: SEPARATED
Segmentation Fault

Any help is very much appreciated

Regards

Re: SEG fault in tiff

Posted: 2009-01-21T06:55:00-07:00
by magick
We had to remove -debug for your command to work. Your command worked for us, we're using ImageMagick 6.4.8-7. Which version of libtiff are you using? The command identify -list format returns:
  • TIFF* TIFF rw+ Tagged Image File Format (LIBTIFF, Version 3.8.2)
for us. Otherwise we need a stack trace to see if the problem is in ImageMagick or libtiff. Use gdb, run, and bt to return the trace.

Re: SEG fault in tiff

Posted: 2009-01-21T07:09:59-07:00
by a68254
Hmm problem seems to be the architecture, it's an IBM system P server running RHEL 5. What I don't understand is why some tifs are working fine :(
If you have any input or workarounds at all it is very much appreciated. Thanks for your time.

Anyways here is the libtiff version and the output from gdb and backtrace

TIFF* TIFF rw+ Tagged Image File Format (LIBTIFF, Version 3.8.2)
TIFF64* TIFF --- Tagged Image File Format (64-bit) (LIBTIFF, Version 3.8.2)

(gdb) run -depth 8 -resize 200x200 -density 150 +profile iptc -compress None -colorspace RGB -strip ../Files/tmp/tmp5333156974.tif /tmp/test.jpg
Starting program: /home/testkunde/EncodeApp/1.0/bin/convert -depth 8 -resize 200x200 -density 150 +profile iptc -compress None -colorspace RGB -strip ../Files/tmp/tmp5333156974.tif /tmp/test.jpg
[Thread debugging using libthread_db enabled]
[New Thread 0xfff3860 (LWP 9197)]

Program received signal SIGSEGV, Segmentation fault.
0xf7d8a740 in strncasecmp () from /lib/power6x/libc.so.6
(gdb) bt
#0 0xf7d8a740 in strncasecmp () from /lib/power6x/libc.so.6
#1 0x0ff49bdc in LocaleNCompare (p=0xf7b90000 <Address 0xf7b90000 out of bounds>, q=0xfae7d44 "8BIM", length=4) at magick/string.c:1392
#2 0x0fae4a6c in ReadProfile (image=0x1003c520, name=0x1002af50 "\020\002¯¨\020\002¯¸\020\002¯Ø",
datum=0xf7a20008 "Adobe Photoshop Document Data Block", length=1945912066) at coders/tiff.c:280
#3 0x0fae5f50 in ReadTIFFImage (image_info=0x100256c8, exception=0x10020030) at coders/tiff.c:354
#4 0x0fe9d9d4 in ReadImage (image_info=0x100203f0, exception=0x10020030) at magick/constitute.c:386
#5 0x0fdb3098 in ConvertImageCommand (image_info=0x100203f0, argc=16, argv=0x10024570, metadata=0x0, exception=0x10020030) at wand/convert.c:554
#6 0x10001bdc in main (argc=16, argv=0xff89f714) at utilities/convert.c:122
(gdb)

Re: SEG fault in tiff

Posted: 2009-01-21T08:08:22-07:00
by magick
We tried the conversion on our 64-bit Fedora Core 10 system and it ran without complaint. Valgrind did not report any memory errors or corruption.

Re: SEG fault in tiff

Posted: 2009-01-21T08:20:02-07:00
by a68254
Alright, thanks for your time, I'll try to find a workaround

Kind regards