Summary: | parallel indirect GLX causes server crash (context switch bug) | ||||||
---|---|---|---|---|---|---|---|
Product: | xorg | Reporter: | Pierre Ossman <pierre-bugzilla> | ||||
Component: | Server/Ext/GLX | Assignee: | Adam Jackson <ajax> | ||||
Status: | RESOLVED FIXED | QA Contact: | Xorg Project Team <xorg-team> | ||||
Severity: | normal | ||||||
Priority: | medium | ||||||
Version: | unspecified | ||||||
Hardware: | Other | ||||||
OS: | All | ||||||
Whiteboard: | |||||||
i915 platform: | i915 features: | ||||||
Attachments: |
|
Description
Pierre Ossman
2013-05-27 09:26:11 UTC
Created attachment 79898 [details]
simple test case
I've managed to figure out the sequence of events that trigger this, and made a simple test case that will reliably crash the server.
The problem is in DrawableGone() in glx/glxext.c. When it clears out a drawable that is attached to an indirect context, it makes sure that context isn't current. It also clears out the X servers current context, if it happens to be the one we're dealing with.
The problem is that Mesa has no distinction between "current for this process/thread" and "current for some X11 client" like the X server does. So it calls back through glapi and clears the dispatch table, believing it is clearing the context for the current thread. That might be true in many cases, but it could also be clearing the context for an X client we were servicing some time ago.
So the fix is probably to always call __glXFlushContextCache() when clearing any context as the underlying DRI driver will most likely mess around in various ways with the active context.
Nothing? I'd figure a bug where a client can easily crash the X server would get more attention. :/ diff --git a/glx/glapi.c b/glx/glapi.c index ad7329e..29cfb9b 100644 --- a/glx/glapi.c +++ b/glx/glapi.c @@ -171,8 +171,11 @@ _glapi_set_dispatch(struct _glapi_table *dispatch) _glthread_SetTSD(&_gl_DispatchTSD, (void *) dispatch); _glapi_Dispatch = dispatch; #else /*THREADS*/ - _glapi_Dispatch = dispatch; + _glapi_Dispatch = dispatch; #endif /*THREADS*/ + + if (dispatch == 0) + __glXFlushContextCache(); } Patch series posted: http://lists.freedesktop.org/archives/xorg-devel/2013-September/037957.html A different version of that series was eventually applied, this is fixed in at least 1,15 and later. |
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.