memory leak when using the identify command

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
ThomasP8
Posts: 1
Joined: 2014-09-21T04:45:49-07:00
Authentication code: 6789

memory leak when using the identify command

Post by ThomasP8 »


Steps to reproduce:

Code: Select all

wget http://godandguru.com/favicon.ico
identify -format '%w|%h|%m\n' favicon.ico
This command eats up to 4 GB Memory for a file of 28K.

I'm using the ImageMagick 6.8.9-7 on Mac OS 10.9.4.

Code: Select all

$ identify -version
Version: ImageMagick 6.8.9-7 Q16 x86_64 2014-08-31 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2014 ImageMagick Studio LLC
Features: DPC Modules
Delegates: bzlib freetype jng jpeg ltdl lzma png xml zlib
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: memory leak when using the identify command

Post by snibgo »

Confirmed. On IM v6.8.9-5, Windows 8.1 ...

Code: Select all

identify -debug all favicon.ico
... very quickly eats my laptop's 12 GB RAM. And 100% of one CPU. It soons fails with:

Code: Select all

Loading locale configure file "english.xml" ...
2014-09-21T19:03:41+01:00 1:04.048 61.375u 6.8.9 Exception identify.exe[2720]: i
con.c/ReadICONImage/443/Exception
  Memory allocation failed `favicon.ico'
2014-09-21T19:03:42+01:00 1:05.064 62.391u 6.8.9 Cache identify.exe[2720]: cache
.c/DestroyPixelCache/965/Cache
  destroy
identify.exe: Memory allocation failed `favicon.ico' @ error/icon.c/ReadICONImage/44
3.
snibgo's IM pages: im.snibgo.com
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: memory leak when using the identify command

Post by magick »

Try
  • identify -format '%w|%h|%m\n' 'favicon.ico[0]'
ImageMagick 6.8.9-8, the current release, reports "memory allocation failed" if the [0] is not appended. Firefox reports the image file has errors. Other program complain too. We'll add a patch to detect these errors.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: memory leak when using the identify command

Post by snibgo »

[0] works for me. I can convert favicon[0], and that creates a possible image, though it looks corrupt.
snibgo's IM pages: im.snibgo.com
Post Reply