Bug 92328 - massive memory leak when running piglit in indirect mode
Summary: massive memory leak when running piglit in indirect mode
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Server/Ext/GLX (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Xorg Project Team
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-07 08:22 UTC by Pierre Ossman
Modified: 2018-06-12 15:50 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
valgrind log (930.61 KB, text/plain)
2016-05-12 08:58 UTC, Pierre Ossman
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pierre Ossman 2015-10-07 08:22:56 UTC
You can easily get Xorg killed by the OOM handler by running:

  LIBGL_ALWAYS_INDIRECT=1 piglit run all results

I haven't debugged where it is leaking so I don't know if this is an Xorg or Mesa issue, but I'll start by filing a bug here. :)

Tested with xorg-x11-server-Xorg-1.18.0-0.4.20150907.fc23.x86_64 and mesa-libGL-11.0.0-2.20150913.fc23.x86_64 as well as TigerVNC based on Xorg 1.14 and Mesa 9.1.1.
Comment 1 Pierre Ossman 2016-05-12 08:58:17 UTC
Created attachment 123642 [details]
valgrind log

Here is a valgrind run from Xvnc built on Xorg 1.14.0 and Mesa 9.1.1 and just the "llvmpipe" tests of piglit.
Comment 2 Adam Jackson 2018-06-12 15:50:57 UTC
Pretty sure this was fixed by:

commit a134d1e7eada0ac90fb622f45833c87b72c9aa06
Author: Guilherme Quentel Melo <gqmelo@gmail.com>
Date:   Tue May 10 00:29:58 2016 +0000

    glx: avoid memory leak when using indirect rendering
    
    When multiple processes are using GL with indirect rendering a race
    condition can make drawables refcount never drop to zero.
    
    This situation could happen when there are many X clients using indirect
    GLX:
    
    1 - client1: calls glXMakeCurrent
    
    2 - client2: calls glXMakeCurrent
    This is the first context switch for this client. So old_context_tag=0
    
    3 - client1: calls glXRender
    For the client, its context is already current.
    For the server side lastGLContext points to client2's context.
    
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    Signed-off-by: Guilherme Quentel Melo <gqmelo@gmail.com>


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.