[Pixman] [PATCH] Plug leak in the alphamap test.

Jon TURNEY jon.turney at dronecode.org.uk
Sun Oct 24 08:59:13 PDT 2010

On 08/10/2010 12:53, Soeren Sandmann wrote:
>>   static pixman_image_t *
>>   make_image (pixman_format_code_t format)
>>   {
>>       uint32_t *bits;
>>       uint8_t bpp = PIXMAN_FORMAT_BPP (format) / 8;
>> +    pixman_image_t *image;
>>       bits = (uint32_t *)make_random_bytes (WIDTH * HEIGHT * bpp);
>> -    return pixman_image_create_bits (format, WIDTH, HEIGHT, bits, WIDTH * bpp);
>> +    image = pixman_image_create_bits (format, WIDTH, HEIGHT, bits, WIDTH * bpp);
>> +
>> +    if (image&&  bits)
>> +	pixman_image_set_destroy_function (image, on_destroy, NULL);
>>   }
> I need a "return image" there, of course. Somehow this didn't actually
> cause the test to fail. Maybe image was in eax or something.

Even with this fix, the cygwin tinderbox is still failing (silently) [1]. The 
alphamap process grows to 2G in size and then mmap() starts failing.

It looks like this is because we are still leaking the alphamap pixmaps. 
Attached is a patch to fix this, although I am not very familiar with the 
pixman API, so this might not be the best way to do this :-)

It would be better if this failure wasn't silent, I only noticed it by accident.

[1] http://tinderbox.freedesktop.org/builds/2010-10-21-0012/logs/pixman/#check
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0001-Plug-another-leak-in-alphamap-test.patch
URL: <http://lists.freedesktop.org/archives/pixman/attachments/20101024/46beba66/attachment.ksh>

More information about the Pixman mailing list