Bug 29646 - baddrawable when resizing a window in gnome-shell/mutter
Summary: baddrawable when resizing a window in gnome-shell/mutter
Status: RESOLVED INVALID
Alias: None
Product: Mesa
Classification: Unclassified
Component: GLX (show other bugs)
Version: git
Hardware: Other All
: medium normal
Assignee: mesa-dev
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-18 07:31 UTC by Alban Browaeys
Modified: 2019-09-18 17:14 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments
check if the xDrawable is still registered before freeing it (1.11 KB, patch)
2010-08-18 07:31 UTC, Alban Browaeys
Details | Splinter Review
backtrace of mutter (32.29 KB, text/plain)
2010-08-18 07:35 UTC, Alban Browaeys
Details
ignore bad drawable error from dri2 destroy drawable. (625 bytes, patch)
2010-08-19 07:34 UTC, Kristian Høgsberg
Details | Splinter Review

Description Alban Browaeys 2010-08-18 07:31:12 UTC
Created attachment 37951 [details] [review]
check if the xDrawable is still registered before freeing it

mutter produces :
Unexpected X error: BadDrawable (invalid Pixmap or Window parameter) serial 14367 error_code 9 request_code 137 minor_code 4)
and abort when resizing a window.

My clue for this patch was that Xserver freed the xDrawable before the client does. DRI2DrawableGone is indeed called with the same id for the drawable.

Attached patch fix that though it needs review. I am too new to x11 lowlevel and glx stuff to be confident it is the proper fix. At least it works.
Comment 1 Alban Browaeys 2010-08-18 07:35:22 UTC
Created attachment 37952 [details]
backtrace of mutter

Also reported in gnome bugzilla : https://bugzilla.gnome.org/show_bug.cgi?id=626556
Comment 2 Alban Browaeys 2010-08-18 07:54:17 UTC
(In reply to comment #1)
> Created an attachment (id=37952) [details]
> backtrace of mutter
> 
> Also reported in gnome bugzilla :
> https://bugzilla.gnome.org/show_bug.cgi?id=626556

(In reply to comment #0)
> Created an attachment (id=37951) [details]
> check if the xDrawable is still registered before freeing it
> 
> mutter produces :
> Unexpected X error: BadDrawable (invalid Pixmap or Window parameter) serial
> 14367 error_code 9 request_code 137 minor_code 4)
> and abort when resizing a window.
> 
> My clue for this patch was that Xserver freed the xDrawable before the client
> does. DRI2DrawableGone is indeed called with the same id for the drawable.
> 
> Attached patch fix that though it needs review. I am too new to x11 lowlevel
> and glx stuff to be confident it is the proper fix. At least it works.

I inverted the condition in the patch. Putting it back the way it should and the issue is back. Any clue welcomed.
Comment 3 Kristian Høgsberg 2010-08-19 07:34:26 UTC
Created attachment 37983 [details] [review]
ignore bad drawable error from dri2 destroy drawable.

Please give this patch a try.
Comment 4 Owen Taylor 2010-09-23 13:18:10 UTC
(In reply to comment #3)
> Created an attachment (id=37983) [details]
> ignore bad drawable error from dri2 destroy drawable.
> 
> Please give this patch a try.

I'm wondering if a client side approach like this can possibly be right. If the sequence:

 XDestroyPixmap()
 glxDestroyPixmap()

Then the sequence:

 XDestroyPixmap()
 [ arbitrary time passes ]
 [ GLX pixmap ID is recycled via client/server negotiation ]
 glxDestroyPixmap()

is also valid. So, I'd think that if glxDestroyPixmap() can follow XDestroyPixmap() the GLX pixmap X ID has to be kept around and not deallocated in the server until glXDestroyPixmp is called (or the client exits)
Comment 5 Michel Dänzer 2010-09-24 00:29:00 UTC
(In reply to comment #4)
> So, I'd think that if glxDestroyPixmap() can follow XDestroyPixmap() the GLX
> pixmap X ID has to be kept around and not deallocated in the server until
> glXDestroyPixmp is called (or the client exits)

That is the case: Pixmaps are reference counted in the X server, and GLXPixmaps take a reference on the backing X pixmaps.
Comment 6 Adam Jackson 2019-09-18 17:14:42 UTC
Ancient bug that bztogl doesn't want to import correctly for whatever reason, closing.


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.