Possibly a bug in RelinquishPixelCachePixels

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
horazon
Posts: 2
Joined: 2017-08-31T05:35:31-07:00
Authentication code: 1151

Possibly a bug in RelinquishPixelCachePixels

Post by horazon »

Hello, I'm currently investigating bug in my program that uses ImageMagick. I get 'MemoryAllocationFailed @ error/gif.c/ReadGIFImage/1285' error when I'm trying to consecutively open two large (2+mb) GIFs. I noticed that RelinquishPixelCachePixels lacks break in MapCache case. This leads to additional RelinquishMagickResource(DiskResource,cache_info->length) call for every RelinquishMagickResource(MapResource,cache_info->length), which, I believe, leads to negative resource_info.disk. So I wonder is it a bug or lack of break is intentional and my problem is elsewhere?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Possibly a bug in RelinquishPixelCachePixels

Post by magick »

RelinquishMagickResource() is behaving as intended. A memory-mapped pixel cache is always allocated on disk so we must account for any memory-mapped resources consumed by the pixel cache as well as any disk resources. That doesn't mean there might be some other bug. Are you seeing a negative disk resource? If so, provide a POC image and the command you use so we can reproduce the issue.

For large images, have you reviewed https://www.imagemagick.org/script/arch ... tera-pixel?
horazon
Posts: 2
Joined: 2017-08-31T05:35:31-07:00
Authentication code: 1151

Re: Possibly a bug in RelinquishPixelCachePixels

Post by horazon »

Thanks for help. Old version of imagemagick was the problem. It didn't have this changes
2013-08-07 6.8.6-9 Cristy <quetzlzacatenango@image...>
* Free disk resource if case resources are exhausted (reference viewtopic.php?f=3&t=23877).
Post Reply