<html>
    <head>
      <base href="https://bugs.freedesktop.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Chromium - Memory leak"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=100741">100741</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Chromium - Memory leak
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>Mesa
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>git
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>x86-64 (AMD64)
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux (All)
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Mesa core
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>mesa-dev@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>bartosz.tomczyk86@gmail.com
          </td>
        </tr>

        <tr>
          <th>QA Contact</th>
          <td>mesa-dev@lists.freedesktop.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Hi,

I observe huge memory leak in chromium browser:

Memory allocation:
==19259== 593,808 (590,328 direct, 3,480 indirect) bytes in 2,733 blocks are
definitely lost in loss record 5,325 of 5,331
==19259==    at 0x4C2CF35: calloc (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==19259==    by 0x9BAC22F: r600_create_surface_custom (r600_texture.c:1935)
==19259==    by 0x9BACA94: r600_create_surface (r600_texture.c:1989)
==19259==    by 0x97CE93F: st_framebuffer_validate (st_manager.c:222)
==19259==    by 0x97CFBEE: st_api_make_current (st_manager.c:808)
==19259==    by 0x9931097: dri_make_current (dri_context.c:258)
==19259==    by 0x992FD64: driBindContext (dri_util.c:555)
==19259==    by 0x7E5A19E: dri3_bind_context (dri3_glx.c:235)
==19259==    by 0x7E27AB3: MakeContextCurrent (glxcurrent.c:228)

Memory not freed in:
st_renderbuffer_delete+0x243b58: state_tracker/st_cb_fbo.c:246
_mesa_reference_renderbuffer_+0x1997d0: main/renderbuffer.c:212
_mesa_reference_renderbuffer+0x1259d1: main/renderbuffer.h:72
_mesa_free_framebuffer_data+0x1259d1: main/framebuffer.c:223
_mesa_destroy_framebuffer+0x125ad0: main/framebuffer.c:199
_mesa_reference_framebuffer_+0x125b78: main/framebuffer.c:256
_mesa_reference_framebuffer+0x8b5b7: main/framebuffer.h:63
_mesa_make_current+0x8b5b7: main/context.c:1674
st_api_make_current+0x294cba: state_tracker/st_manager.c:827
dri_unbind_context+0x3f5f7d: src/gallium/state_trackers/dri/dri_context.c:217
driUnbindContext+0x3f57ec: src/mesa/drivers/dri/common/dri_util.c:591
MakeContextCurrent+0x164: src/glx/glxcurrent.c:214

Memory is not freed in st_renderbuffer_delete because ctx is NULL.
    if (ctx) {
       struct st_context *st = st_context(ctx);
       pipe_surface_release(st->pipe, &strb->surface);
    }

Changing above part of code to :
    pipe_surface_reference(&strb->surface, NULL);
or
    pipe_surface_release(strb->surface->context, &strb->surface);

fixes problem for me, but I'm not sure if it is correct way of doing it.
Could someone comment on this?</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
          <li>You are the QA Contact for the bug.</li>
      </ul>
    </body>
</html>