Page 1 of 1

Possible leak when reading certain PS files

Posted: 2008-09-02T07:50:24-07:00
by dirving
Ok, this one is driving me nuts and it happens to be the last leak that I've found (or at least the last one my code triggers). Valgrind reports:

==8778== 940 (220 direct, 720 indirect) bytes in 5 blocks are definitely lost in loss record 14 of 20
==8778== at 0x4006AEE: malloc (vg_replace_malloc.c:207)
==8778== by 0x4206C25: AcquireMagickMemory (memory.c:337)
==8778== by 0x42557BE: NewSplayTree (splay-tree.c:1127)
==8778== by 0x421AF4B: SetImageProperty (property.c:3047)
==8778== by 0x4173FFB: ReadImage (constitute.c:624)
==8778== by 0x400D764: ???
==8778== by 0x4173C0F: ReadImage (constitute.c:441)
==8778== by 0x40BF03B: MagickReadImage (magick-image.c:7533)

when I perform certain operations on a level 3 EPS file. I've only been able to trace it so far to ps.c. The leak seems to occur when ImageMagick creates the temporary holder file and call ReadImage on that file. I'm totally lost on this one since I have no idea why the image->properties splay tree wouldn't be deallocated along with the rest of the image.

Re: Possible leak when reading certain PS files

Posted: 2008-09-02T09:06:21-07:00
by magick
Post a URL to one of your images and the command we are using. As always, we need to reproduce the problem before we can be of much help.

Re: Possible leak when reading certain PS files

Posted: 2008-09-02T09:50:51-07:00
by dirving
No problem... One of the images that produces this error is:

http://wbd.wbdtest.com/chicon-sm.eps

Re: Possible leak when reading certain PS files

Posted: 2008-09-02T11:14:21-07:00
by magick
We have a fix for the memory leak you reported. It will be available sometime tomorrow. Thanks.