ImageMagick crashing randomly on Windows

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
djeyewater
Posts: 15
Joined: 2009-07-25T09:16:08-07:00
Authentication code: 8675309

ImageMagick crashing randomly on Windows

Post by djeyewater »

I'm on Windows 7 and have installed ImageMagick-6.7.4-8-Q16-windows-x64-dll.exe

I'm running a batch script that loops through a folder of images, and calls ImageMagick to crop them. However, sometimes ImageMagick crashes and I get an error message "ImageMagick Studio library and utility programs has stopped working" (a pop-up windows message, not a message in the command prompt). This can happen multiple times as the script loops through the images, or sometimes all the images are processed successfully.

You can download the script and files I am using here: http://www.iliveinabin.com/ImageSlicer.zip
Usage is test.cmd "C:\Path\to\test" (or you should be able to just drag the test folder onto the test.cmd file in Windows Explorer)

In the script I am checking the %errorcode% and it appears to always be 0, even when ImageMagick crashes. Presumably this is because if ImageMagick crashes then it can't set an exit code, and errorcode contains the value from before ImageMagick was called?

I have tried adding a 1s timeout in the loop, but this didn't make any difference, so it doesn't seem like the script is calling ImageMagick too quickly in repetition to cause the error.

Since the error is intermittent, I'm not sure what the problem is, and since ImageMagick crashes rather than exiting with an error, I don't know how I could get any debug information on what might be causing the error?

Dave
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: ImageMagick crashing randomly on Windows

Post by magick »

Grab http://www.imagemagick.org/download/bin ... ws-dll.exe. We'll have a 64-bit version within a day or two. This release has a patch that fixes the problem you reported.
LordOfTheStrings
Posts: 2
Joined: 2012-01-25T02:23:37-07:00
Authentication code: 8675308

Re: ImageMagick crashing randomly on Windows

Post by LordOfTheStrings »

I have the same problem on Windows 7 (64 Bit). Some image, most (but not only) TIFF, always cause a crash, while others cause it once but pass Image Magick without any problems in a second or third try. I call convert.exe from .NET via System.Diagnostics.Process.

Code: Select all

convert <in> -resize "640x480>" -profile "sRGB.icc" -colorspace "RGB" -quality 70 <out.jpg>
Profile is the one delivered with Image Magick.
Source files are tif, jpg, eps, png - where tif, eps and jpg are in cmyk colorspace most of the time.
Output is always jpg.

You can download an image that always causes a crash here: http://dl.dropbox.com/u/18526818/143656714_736.tif

The problem occurred with
ImageMagick-6.7.4-2-Q16-windows-dll.exe
ImageMagick-6.7.4-8-Q16-windows-dll.exe

Using version 6.7.4-9 is no solution for me, as this release tells me "no decode delegate for this image format" for all images i try to convert.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: ImageMagick crashing randomly on Windows

Post by magick »

Oops. The TIFF coder modules was not included in the distribution. We'll release an update this evening.
LordOfTheStrings
Posts: 2
Joined: 2012-01-25T02:23:37-07:00
Authentication code: 8675308

Re: ImageMagick crashing randomly on Windows

Post by LordOfTheStrings »

Cool! :lol: Thanks!
djeyewater
Posts: 15
Joined: 2009-07-25T09:16:08-07:00
Authentication code: 8675309

Re: ImageMagick crashing randomly on Windows

Post by djeyewater »

Just tried the latest version ImageMagick-6.7.5-0-Q16-windows-x64-dll.exe but it is still crashing randomly for me.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: ImageMagick crashing randomly on Windows

Post by magick »

The crash seems to come from the TIFF EXIF profile handler. Try -define tiff:exif-properties=false to ignore the EXIF profile. Does that resolve any crashes?
djeyewater
Posts: 15
Joined: 2009-07-25T09:16:08-07:00
Authentication code: 8675309

Re: ImageMagick crashing randomly on Windows

Post by djeyewater »

No, unfortunately it still crashes when adding -define tiff:exif-properties=false to the command. I tried with JPEGs and they work fine, just seems to be these TIFFs. Maybe some non-standard tag added to TIFFs by Photoshop.

I tried using ImageMagick to strip the exif from the TIFFs, but it crashes. I thought maybe exiftool might be able to strip the exif instead, but reading the exiftool FAQ it seems it's not possible to easily strip the exif from TIFFs.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: ImageMagick crashing randomly on Windows

Post by magick »

Do you have an image that reliably causes a crash? We need to reproduce the problem so we can debug and determine if the cause of failure is in ImageMagick or the TIFF delegate library.
djeyewater
Posts: 15
Joined: 2009-07-25T09:16:08-07:00
Authentication code: 8675309

Re: ImageMagick crashing randomly on Windows

Post by djeyewater »

No, I'm afraid not. Sometimes the batch script will loop through and process all the images successfully, while other times it will crash quite a few times. Hopefully LordOfTheStrings is still monitoring this thread since he/she said they had some images that always cause a crash.
macthinkdifferent
Posts: 1
Joined: 2014-01-07T07:34:21-07:00
Authentication code: 6789

Re: ImageMagick crashing randomly on Windows

Post by macthinkdifferent »

I appear to be having a similar issue. ImageMagick appears to be crashing whenever it is ran on Windows 7 or Windows 8 with certain TIFF files. I am currently running on ImageMagick 6.7.5-7 2012-02-23 If I run it on directly on the command line it will run, but if I run it through the .exe it will crash. This does not seem to occur on my Win 2012 install. I try running it in Verbose mode and it will just simply crash.

The TIFF files that are used to render this are created in Photoshop. However, it doesn't look like they have any radical information like layers or anything like that in them. They are simple TIFF files.

Any guidance would be much appreciated.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: ImageMagick crashing randomly on Windows

Post by snibgo »

I don't understand "If I run it on directly on the command line it will run, but if I run it through the .exe it will crash." What .exe?

If you have a command that consistently crashes with a particular image, please post both. You can put the image somewhere like dropbox.com and paste the link here.
snibgo's IM pages: im.snibgo.com
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: ImageMagick crashing randomly on Windows

Post by dlemstra »

We recently fixed a bug that only occurred with specific tiff images. This will be fixed in 6.8.8-2. If you can post a link to one of your images that crashes so I can test it with the latest beta.
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
Post Reply