[Mesa-dev] Is it a memory leak?

Zhenbo Xu zhenbo1987 at gmail.com
Tue Jul 12 07:40:50 PDT 2011


I found the following bugs in mesa(v100) for SPEC CPU2000 v1.3

leak bug 1:
//in file textimage.c  at line 345
gl_text_image* image_to_texture(...) {
  ...
  textImage = gl_alloc_texttrue_image(...);
  if (!textImage)
    return NULL;
  ...
  switch (image->Type) {
    case ...
    ...
    default:
        gl_problem(...)
         return NULL;   //here without releasing textImage
  }
}

leak bug 2:
//in file osmesa.c at line 263
osmesa = (OSMesaContext) calloc( 1, sizeof(struct osmesa_context) ); 262 if
(osmesa) {
osmesa->gl_visual = gl_create_visual( rgbmode, 264 swalpha,

DEPTH_BITS16,

STENCIL_BITS8,

 ACCUM_BITS16,

 index_bits,

 rscale, gscale, bscale, ascale,
                                                                       8, 8,
8, 0 );
          if (!osmesa->gl_visual) {

                           return NULL((void*)0);//without releasing osmesa
          }

leak bug 3:
//in file drawpix.c at line 1010
void gl_DrawPixels(...) {
     ...
     if (ctx->CallDepth == 0) {
        image = gl_unpack_pixels( ctx, width, height, format, type, pixels
);
        ...
     }
     ...
     if (ctx->ExecuteFlag) { //Taking false branch
          gl_save_DrawPixels( ctx, width, height, format, type, image );
     }
     if (ctx->ExecuteFlag) { //Taking false branch
          ....
     }//Without releasing image
}

Is it suitable to report these bugs here?
I also sent it to support at spec2000, but didn't have any response.
I'll be glad if you can check these bugs,
Or do I have another way to report them?
Thank you!
2011/7/12 Brian Paul <brianp at vmware.com>

> On 07/12/2011 06:38 AM, Zhenbo Xu wrote:
>
>> Hi all,
>> I have been detecting memory leaks in mesa for SPEC2000,
>> and I found a kind of memory leaks shown in the following code
>>
>> gl_text_image* image_to_texture(...) {
>>   ...
>>   textImage = gl_alloc_texttrue_image(...);
>>   if (!textImage)
>>     return NULL;
>>   ...
>> switch (image->Type) {
>>     case ...
>>     ...
>>     default:
>>         gl_problem(...)
>>          return NULL; //here without releasing textImage
>>   }
>> }
>>
>> Is it a memory leak ?
>>
>
> Possibly.  Where is this code exactly?
>
> -Brian
>
>


-- 
                                               致
礼!

----------------------------------------------------

许振波
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20110712/db1927df/attachment.html>


More information about the mesa-dev mailing list