Segmentation fault when converting .tif to .jpg
Posted: 2009-08-10T07:47:34-07:00
We got 23.000 pictures from a customer. For most of them it worked fine to convert them to .jpg from any format. But some .tif pictures (about 500) showed segmentation faults or filled up the disk with files > 1 GB. The identify command crashes with the same fault for these pictures, which seem to have their origin in some Minolta camera. Color profiles are left out for testing. All images seem to have EXIF-Infos that are not recognized by ImageMagick and instead of giving only a warning, which can be "quietened", cause that real trouble. Here the debug session of such an image (image paths shortened by hand):
[hpb@pandora media]$ convert -debug All test1.tif -geometry "2048x2048>" test1.jpg
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Configure convert[17822]: utility.c/ExpandFilenames/865/Configure
Command line: convert {-debug} {All} {test1.tif} {-geometry} {2048x2048>} {test1.jpg}
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Configure convert[17822]: configure.c/GetConfigureOptions/528/Configure
Searching for configure file: "/usr/share/ImageMagick-6.5.2/config/coder.xml"
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Configure convert[17822]: configure.c/GetConfigureOptions/528/Configure
Searching for configure file: "/usr/lib64/ImageMagick-6.5.2/config/coder.xml"
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Configure convert[17822]: configure.c/GetConfigureOptions/528/Configure
Searching for configure file: "/usr/share/doc/ImageMagick-6.5.2/coder.xml"
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Configure convert[17822]: configure.c/GetConfigureOptions/528/Configure
Searching for configure file: "/usr/share/ImageMagick-6.5.2/coder.xml"
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Configure convert[17822]: configure.c/GetConfigureOptions/528/Configure
Searching for configure file: "/home/hpb/.magick/coder.xml"
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Configure convert[17822]: configure.c/GetConfigureOptions/528/Configure
Searching for configure file: "coder.xml"
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Configure convert[17822]: coder.c/LoadCoderList/639/Configure
Loading coder configuration file "/usr/share/ImageMagick-6.5.2/config/coder.xml" ...
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Module convert[17822]: module.c/OpenModule/1154/Module
Searching for module "TIFF" using filename "tiff.la"
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Module convert[17822]: module.c/GetMagickModulePath/549/Module
Searching for coder module file "tiff.la" ...
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Module convert[17822]: module.c/OpenModule/1163/Module
Opening module at path "/usr/lib64/ImageMagick-6.5.2/modules-Q16/coders/tiff.la"
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Module convert[17822]: module.c/OpenModule/1190/Module
Method "RegisterTIFFImage" in module "TIFF" at address 0x2ae14e49cfe0
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Module convert[17822]: module.c/OpenModule/1204/Module
Method "UnregisterTIFFImage" in module "TIFF" at address 0x2ae14e49cfa0
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Policy convert[17822]: policy.c/IsRightsAuthorized/520/Policy
Domain: Path; rights=Read; pattern="test1.tif" ...
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Blob convert[17822]: blob.c/OpenBlob/2416/Blob
read 3 magic header bytes
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Cache convert[17822]: cache.c/DestroyPixelCacheInfo/1513/Cache
destroy
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Configure convert[17822]: configure.c/GetConfigureOptions/528/Configure
Searching for configure file: "/usr/share/ImageMagick-6.5.2/config/magic.xml"
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Configure convert[17822]: configure.c/GetConfigureOptions/528/Configure
Searching for configure file: "/usr/lib64/ImageMagick-6.5.2/config/magic.xml"
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Configure convert[17822]: configure.c/GetConfigureOptions/528/Configure
Searching for configure file: "/usr/share/doc/ImageMagick-6.5.2/magic.xml"
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Configure convert[17822]: configure.c/GetConfigureOptions/528/Configure
Searching for configure file: "/usr/share/ImageMagick-6.5.2/magic.xml"
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Configure convert[17822]: configure.c/GetConfigureOptions/528/Configure
Searching for configure file: "/home/hpb/.magick/magic.xml"
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Configure convert[17822]: configure.c/GetConfigureOptions/528/Configure
Searching for configure file: "magic.xml"
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Configure convert[17822]: magic.c/LoadMagicList/682/Configure
Loading magic configure file "/usr/share/ImageMagick-6.5.2/config/magic.xml" ...
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Policy convert[17822]: policy.c/IsRightsAuthorized/520/Policy
Domain: Coder; rights=Read; pattern="TIFF" ...
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Policy convert[17822]: policy.c/IsRightsAuthorized/520/Policy
Domain: Path; rights=Read; pattern="test1.tif" ...
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Blob convert[17822]: blob.c/OpenBlob/2416/Blob
read 3 magic header bytes
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Cache convert[17822]: cache.c/DestroyPixelCacheInfo/1513/Cache
destroy
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Policy convert[17822]: policy.c/IsRightsAuthorized/520/Policy
Domain: Path; rights=Read; pattern="test1.tif" ...
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Blob convert[17822]: blob.c/OpenBlob/2416/Blob
read 3 magic header bytes
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Coder convert[17822]: tiff.c/ReadTIFFImage/696/Coder
Geometry: 448x617
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Coder convert[17822]: tiff.c/ReadTIFFImage/698/Coder
Interlace: 1
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Coder convert[17822]: tiff.c/ReadTIFFImage/700/Coder
Bits per sample: 8
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Coder convert[17822]: tiff.c/ReadTIFFImage/702/Coder
Min sample value: 0
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Coder convert[17822]: tiff.c/ReadTIFFImage/704/Coder
Max sample value: 255
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Coder convert[17822]: tiff.c/ReadTIFFImage/740/Coder
Photometric: SEPARATED
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Coder convert[17822]: tiff.c/ReadTIFFImage/756/Coder
Image depth: 8
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Locale convert[17822]: locale.c/GetLocaleOptions/498/Locale
Searching for locale file: "/usr/share/ImageMagick-6.5.2/config/locale.xml"
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Locale convert[17822]: locale.c/GetL
Searching for locale file: "/usr/lib64/ImageMagick-6.5.2/config/locale.xml"
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Locale convert[17822]: locale.c/GetL
Searching for locale file: "/usr/share/doc/ImageMagick-6.5.2/locale.xml"
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Locale convert[17822]: locale.c/GetL
Searching for locale file: "/usr/share/ImageMagick-6.5.2/locale.xml"
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Locale convert[17822]: locale.c/GetL
Searching for locale file: "/home/hpb/.magick/locale.xml"
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Locale convert[17822]: locale.c/GetL
Searching for locale file: "locale.xml"
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Configure convert[17822]: locale.c/L
Loading locale configure file "/usr/lib64/ImageMagick-6.5.2/config/locale.xml"
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Configure convert[17822]: locale.c/L
Loading locale configure file "/usr/lib64/ImageMagick-6.5.2/config/english.xml
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Exception convert[17822]: tiff.c/TIF
test1.tif: unknown field with tag 40961 (
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Exception convert[17822]: tiff.c/TIF
test1.tif: wrong data type 3 for "GainCon
Speicherzugriffsfehler
Last line means "segmentation fault" in German.
Here the URL of one of the pictures which show this behavior:
http://www.onlinekauf.de/test.tif
[hpb@pandora media]$ convert -debug All test1.tif -geometry "2048x2048>" test1.jpg
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Configure convert[17822]: utility.c/ExpandFilenames/865/Configure
Command line: convert {-debug} {All} {test1.tif} {-geometry} {2048x2048>} {test1.jpg}
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Configure convert[17822]: configure.c/GetConfigureOptions/528/Configure
Searching for configure file: "/usr/share/ImageMagick-6.5.2/config/coder.xml"
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Configure convert[17822]: configure.c/GetConfigureOptions/528/Configure
Searching for configure file: "/usr/lib64/ImageMagick-6.5.2/config/coder.xml"
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Configure convert[17822]: configure.c/GetConfigureOptions/528/Configure
Searching for configure file: "/usr/share/doc/ImageMagick-6.5.2/coder.xml"
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Configure convert[17822]: configure.c/GetConfigureOptions/528/Configure
Searching for configure file: "/usr/share/ImageMagick-6.5.2/coder.xml"
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Configure convert[17822]: configure.c/GetConfigureOptions/528/Configure
Searching for configure file: "/home/hpb/.magick/coder.xml"
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Configure convert[17822]: configure.c/GetConfigureOptions/528/Configure
Searching for configure file: "coder.xml"
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Configure convert[17822]: coder.c/LoadCoderList/639/Configure
Loading coder configuration file "/usr/share/ImageMagick-6.5.2/config/coder.xml" ...
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Module convert[17822]: module.c/OpenModule/1154/Module
Searching for module "TIFF" using filename "tiff.la"
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Module convert[17822]: module.c/GetMagickModulePath/549/Module
Searching for coder module file "tiff.la" ...
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Module convert[17822]: module.c/OpenModule/1163/Module
Opening module at path "/usr/lib64/ImageMagick-6.5.2/modules-Q16/coders/tiff.la"
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Module convert[17822]: module.c/OpenModule/1190/Module
Method "RegisterTIFFImage" in module "TIFF" at address 0x2ae14e49cfe0
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Module convert[17822]: module.c/OpenModule/1204/Module
Method "UnregisterTIFFImage" in module "TIFF" at address 0x2ae14e49cfa0
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Policy convert[17822]: policy.c/IsRightsAuthorized/520/Policy
Domain: Path; rights=Read; pattern="test1.tif" ...
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Blob convert[17822]: blob.c/OpenBlob/2416/Blob
read 3 magic header bytes
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Cache convert[17822]: cache.c/DestroyPixelCacheInfo/1513/Cache
destroy
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Configure convert[17822]: configure.c/GetConfigureOptions/528/Configure
Searching for configure file: "/usr/share/ImageMagick-6.5.2/config/magic.xml"
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Configure convert[17822]: configure.c/GetConfigureOptions/528/Configure
Searching for configure file: "/usr/lib64/ImageMagick-6.5.2/config/magic.xml"
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Configure convert[17822]: configure.c/GetConfigureOptions/528/Configure
Searching for configure file: "/usr/share/doc/ImageMagick-6.5.2/magic.xml"
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Configure convert[17822]: configure.c/GetConfigureOptions/528/Configure
Searching for configure file: "/usr/share/ImageMagick-6.5.2/magic.xml"
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Configure convert[17822]: configure.c/GetConfigureOptions/528/Configure
Searching for configure file: "/home/hpb/.magick/magic.xml"
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Configure convert[17822]: configure.c/GetConfigureOptions/528/Configure
Searching for configure file: "magic.xml"
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Configure convert[17822]: magic.c/LoadMagicList/682/Configure
Loading magic configure file "/usr/share/ImageMagick-6.5.2/config/magic.xml" ...
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Policy convert[17822]: policy.c/IsRightsAuthorized/520/Policy
Domain: Coder; rights=Read; pattern="TIFF" ...
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Policy convert[17822]: policy.c/IsRightsAuthorized/520/Policy
Domain: Path; rights=Read; pattern="test1.tif" ...
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Blob convert[17822]: blob.c/OpenBlob/2416/Blob
read 3 magic header bytes
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Cache convert[17822]: cache.c/DestroyPixelCacheInfo/1513/Cache
destroy
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Policy convert[17822]: policy.c/IsRightsAuthorized/520/Policy
Domain: Path; rights=Read; pattern="test1.tif" ...
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Blob convert[17822]: blob.c/OpenBlob/2416/Blob
read 3 magic header bytes
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Coder convert[17822]: tiff.c/ReadTIFFImage/696/Coder
Geometry: 448x617
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Coder convert[17822]: tiff.c/ReadTIFFImage/698/Coder
Interlace: 1
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Coder convert[17822]: tiff.c/ReadTIFFImage/700/Coder
Bits per sample: 8
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Coder convert[17822]: tiff.c/ReadTIFFImage/702/Coder
Min sample value: 0
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Coder convert[17822]: tiff.c/ReadTIFFImage/704/Coder
Max sample value: 255
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Coder convert[17822]: tiff.c/ReadTIFFImage/740/Coder
Photometric: SEPARATED
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Coder convert[17822]: tiff.c/ReadTIFFImage/756/Coder
Image depth: 8
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Locale convert[17822]: locale.c/GetLocaleOptions/498/Locale
Searching for locale file: "/usr/share/ImageMagick-6.5.2/config/locale.xml"
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Locale convert[17822]: locale.c/GetL
Searching for locale file: "/usr/lib64/ImageMagick-6.5.2/config/locale.xml"
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Locale convert[17822]: locale.c/GetL
Searching for locale file: "/usr/share/doc/ImageMagick-6.5.2/locale.xml"
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Locale convert[17822]: locale.c/GetL
Searching for locale file: "/usr/share/ImageMagick-6.5.2/locale.xml"
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Locale convert[17822]: locale.c/GetL
Searching for locale file: "/home/hpb/.magick/locale.xml"
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Locale convert[17822]: locale.c/GetL
Searching for locale file: "locale.xml"
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Configure convert[17822]: locale.c/L
Loading locale configure file "/usr/lib64/ImageMagick-6.5.2/config/locale.xml"
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Configure convert[17822]: locale.c/L
Loading locale configure file "/usr/lib64/ImageMagick-6.5.2/config/english.xml
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Exception convert[17822]: tiff.c/TIF
test1.tif: unknown field with tag 40961 (
2009-08-10T11:58:54+02:00 0:01 0.000u 6.5.2 Exception convert[17822]: tiff.c/TIF
test1.tif: wrong data type 3 for "GainCon
Speicherzugriffsfehler
Last line means "segmentation fault" in German.
Here the URL of one of the pictures which show this behavior:
http://www.onlinekauf.de/test.tif