Catastrophic Failure

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
bachuba

Catastrophic Failure

Post by bachuba »

I've written a Delphi utility that uses the version 6.6.6 ImageMagickObject.dll to perform a bunch of Convert calls on each page of a multi-page tiff (resizing, cropping, etc.). Everything has been working great until recently when I've tried it on tiffs with greater numbers of pages. Running on a tiff with 20 pages, about 10 MB total in size, causes the DLL to fall over reporting "Catastrophic Failure" sometimes. The page being processed when the error occurs varies from attempt to attempt, but the specific Convert call seems to be consistent. I'm hoping someone will understand the stack trace from the DLL or the debug information from ImageMagick better than I. Thanks in advance for any help.

Convert Call:

Code: Select all

Convert -debug All ( -size 347x223 xc:black ) Scan0_out_Page_7_1_DSK_2.tif -composite -depth 1 Scan0_out_Page_7_1_DSK_3.tif
Stack Trace from AQTime:

Code: Select all

First chance exception 0xC0000005 ACCESS_VIOLATION occurred at 0x78AA1FB4, read of address 0x0216E000 at 0x78AA1FB4 (in C:\Program Files\ImageMagick-6.6.6-Q16\msvcr100.dll)
0x78AA1FB4 memcpy + 0x134 in msvcr100.dll
0x01D4AF5F CloneString + 0x16F in CORE_RL_magick_.dll
0x02000C10 MogrifyImageInfo + 0x1340 in CORE_RL_wand_.dll
0x01D0785D ParseMagickOption + 0x10D in CORE_RL_magick_.dll
0x01D079DA ParseMagickOption + 0x28A in CORE_RL_magick_.dll
0x01CF613B LogMagickEventList + 0xAB in CORE_RL_magick_.dll
0x01CF613B LogMagickEventList + 0xAB in CORE_RL_magick_.dll
0x7C91084C wcsncpy + 0x2CD in ntdll.dll
0x7C910981 wcsncpy + 0x402 in ntdll.dll
0x7C91005D RtlFreeHeap + 0x130 in ntdll.dll
ImageMagick Debug information surrounding issue (Note that Scan0_out_Page_7_1_DSK_2.tif is just a single page tiff that has been extracted from the multi-page tiff at this point):

Code: Select all

2010-12-03T11:24:31-05:00 0:17.424 17.703u 6.6.6 Resource Magick[2896]: ImageMagickObject.cpp/MagickImage::AddArgs/1542/Resource
  arg: -convert
2010-12-03T11:24:31-05:00 0:17.424 17.703u 6.6.6 Resource Magick[2896]: ImageMagickObject.cpp/MagickImage::Perform/682/Resource
  ImageMagickObject - Perform enter
2010-12-03T11:24:31-05:00 0:17.424 17.703u 6.6.6 Resource Magick[2896]: ImageMagickObject.cpp/MagickImage::AddArgs/1542/Resource
  arg: -debug
2010-12-03T11:24:31-05:00 0:17.424 17.703u 6.6.6 Resource Magick[2896]: ImageMagickObject.cpp/MagickImage::AddArgs/1572/Resource
  arg: All
2010-12-03T11:24:31-05:00 0:17.424 17.703u 6.6.6 Resource Magick[2896]: ImageMagickObject.cpp/MagickImage::AddArgs/1572/Resource
  arg: (
2010-12-03T11:24:31-05:00 0:17.424 17.703u 6.6.6 Resource Magick[2896]: ImageMagickObject.cpp/MagickImage::AddArgs/1542/Resource
  arg: -size
2010-12-03T11:24:31-05:00 0:17.424 17.703u 6.6.6 Resource Magick[2896]: ImageMagickObject.cpp/MagickImage::AddArgs/1572/Resource
  arg: 347x223
2010-12-03T11:24:31-05:00 0:17.424 17.703u 6.6.6 Resource Magick[2896]: ImageMagickObject.cpp/MagickImage::AddArgs/1572/Resource
  arg: xc:black
2010-12-03T11:24:31-05:00 0:17.424 17.703u 6.6.6 Resource Magick[2896]: ImageMagickObject.cpp/MagickImage::AddArgs/1572/Resource
  arg: )
2010-12-03T11:24:31-05:00 0:17.424 17.703u 6.6.6 Resource Magick[2896]: ImageMagickObject.cpp/MagickImage::AddArgs/1572/Resource
  arg: Scan0_out_Page_7_1_DSK_2.tif
2010-12-03T11:24:31-05:00 0:17.424 17.703u 6.6.6 Resource Magick[2896]: ImageMagickObject.cpp/MagickImage::AddArgs/1542/Resource
  arg: -composite
2010-12-03T11:24:31-05:00 0:17.424 17.703u 6.6.6 Resource Magick[2896]: ImageMagickObject.cpp/MagickImage::AddArgs/1542/Resource
  arg: -depth
2010-12-03T11:24:31-05:00 0:17.424 17.703u 6.6.6 Resource Magick[2896]: ImageMagickObject.cpp/MagickImage::AddArgs/1572/Resource
  arg: 1
2010-12-03T11:24:31-05:00 0:17.424 17.703u 6.6.6 Resource Magick[2896]: ImageMagickObject.cpp/MagickImage::AddArgs/1572/Resource
  arg: Scan0_out_Page_7_1_DSK_3.tif
2010-12-03T11:24:31-05:00 0:17.424 17.703u 6.6.6 Resource Magick[2896]: ImageMagickObject.cpp/MagickImage::Perform/1036/Resource
  ImageMagickObject - Perform before execute
2010-12-03T11:24:31-05:00 0:17.424 17.703u 6.6.6 Configure Magick[2896]: utility.c/ExpandFilenames/906/Configure
  Command line: -convert {-debug} {All} {(} {-size} {347x223} {xc:black} {)} {Scan0_out_Page_7_1_DSK_2.tif} {-composite} {-depth} {1} {Scan0_out_Page_7_1_DSK_3.tif}
2010-12-03T11:24:31-05:00 0:17.424 17.703u 6.6.6 Policy Magick[2896]: policy.c/IsRightsAuthorized/485/Policy
  Domain: Coder; rights=Read; pattern="XC" ...
2010-12-03T11:24:31-05:00 0:17.424 17.703u 6.6.6 Resource Magick[2896]: resource.c/AcquireMagickResource/262/Resource
  Area: 619KB/619KB/3.4871GB
2010-12-03T11:24:31-05:00 0:17.424 17.703u 6.6.6 Resource Magick[2896]: resource.c/AcquireMagickResource/262/Resource
  Memory: 619KB/605KiB/12.99GiB
2010-12-03T11:24:31-05:00 0:17.424 17.703u 6.6.6 Cache Magick[2896]: cache.c/OpenPixelCache/4056/Cache
  open black[0] (heap memory, 347x223 605KiBB)
2010-12-03T11:24:31-05:00 0:17.471 17.750u 6.6.6 Resource Magick[2896]: ImageMagickObject.cpp/MagickImage::FinalRelease/332/Resource
  FinalRelease
ERROR: Catastrophic failure
2010-12-03T11:24:31-05:00 0:17.487 17.766u 6.6.6 Resource Magick[2896]: ImageMagickObject.cpp/CModuelOverrideClass::DllMain/92/Resource
  DLL Detach -  path: C:\Program Files\ImageMagick-6.6.6-Q16\ImageMagickObject.dll
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Catastrophic Failure

Post by magick »

Add '-limit area 0' to your convert command line. Does that fix the problem?
bachuba

Re: Catastrophic Failure

Post by bachuba »

Thanks for the reply. No, I added that option and it failed in the same spot.
bachuba

Re: Catastrophic Failure

Post by bachuba »

Any other ideas on this? Is there any other information I can gather that might be useful?
Post Reply