[Mesa-dev] [Bug 30457] New: [7.9] DRI drawables prematurely destroyed on context switch

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Wed Sep 29 04:14:54 PDT 2010


https://bugs.freedesktop.org/show_bug.cgi?id=30457

           Summary: [7.9] DRI drawables prematurely destroyed on context
                    switch
           Product: Mesa
           Version: git
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: medium
         Component: Mesa core
        AssignedTo: mesa-dev at lists.freedesktop.org
        ReportedBy: chalserogers at gmail.com


Created an attachment (id=39044)
 View: https://bugs.freedesktop.org/attachment.cgi?id=39044
 Review: https://bugs.freedesktop.org/review?bug=30457&attachment=39044

Simpleminded patch which fixes Clutter apps.

It seems that with the new GLX drawable garbage collection that mesa
incorrectly destroys drawables when switching a single context between
drawables.

This manifests in some clutter applications crashing with a BadDrawable error:
(quadrapassel:4883): ClutterGLX-CRITICAL **: Unable to make the stage window
0x4800005 the current GLX drawable

(quadrapassel:4883): ClutterGLX-CRITICAL **: Unable to make the stage window
0x4800006 the current GLX drawable

(quadrapassel:4883): ClutterGLX-CRITICAL **: Unable to make the stage window
0x4800006 the current GLX drawable
The program 'quadrapassel' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadDrawable (invalid Pixmap or Window parameter)'.
  (Details: serial 70 error_code 9 request_code 137 minor_code 12)
  (Note to programmers: normally, X errors are reported asynchronously;
   that is, you will receive the error a while after causing it.
   To debug your program, run it with the --sync command line
   option to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error() function.)

The cause is that when dri2_unbind_context is called with new context == old
context it calls driReleaseDrawable.  Clutter will switch a single context
between different drawables with glXMakeCurrent, so it hits this codepath. 
When it switches back to the original drawable, mesa only has the GLXDrawable
id which doesn't match the X drawable ID, and hence calls using it result in
BadDrawable in clutter.

I've sent a piglit testcase to the piglit list exhibiting this bug.

The attached patch fixes this, but probably leaks drawables.

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the mesa-dev mailing list