[Mesa-dev] [PATCH 3/3] xlib: use X error handler to catch XShmQueryVersion() failure

Adam Jackson ajax at redhat.com
Wed Jan 11 08:39:43 PST 2012


On Wed, 2012-01-11 at 08:43 -0700, Brian Paul wrote:
> On 01/11/2012 08:13 AM, Adam Jackson wrote:
> > On Tue, 2012-01-10 at 19:46 -0700, Brian Paul wrote:
> >> From: Brian Paul<brianp at vmware.com>
> >>
> >> This is a follow-on to the previous commits.  It seems that
> >> XShmQueryVersion() can trigger an X error after the first X
> >> connection is closed and we start using a new connection.
> >
> > I assume this is when you switch which Display you're talking to as
> > well.
> 
> Yes.  It's really weird.  I looked at the sources for the XShm 
> extension code and I didn't see anything obviously wrong there.

Bizarre.  Only thing I can guess is the close_display hook not getting
called, but I don't see how that'd happen.

> I guess another "solution" would be to simply remove the call to 
> XShmQueryVersion() and assume that if XQueryExtension("MIT-SHM") 
> passes then the version is acceptable (it's been 1.1 forever, AFAIK). 
>   What do you think about that?

Looks like 1.1 was X11R5.  From a quick check of the changes between R4
and R5, the only functional difference was that the support for shm
pixmaps was made contingent on all screens supporting the same format,
so there's a semantic "shm pixmaps definitely work on multiple screens
if available" change but no protocol change.

So yeah, that sounds fine, we're not using shm pixmaps regardless.

> I guess I'm not too concerned about that for the time being.  As you 
> said, there's other instances of multi-display and thread safety 
> issues already.

Yeah, not a showstopper by any means, just something I've wanted to
clean up for a while since I keep getting threading bugs.  But in the
xlib backend I don't really care, it's not something I ship and wouldn't
consider it a conformance path even if I did.

For the series:

Reviewed-by: Adam Jackson <ajax at redhat.com>

- ajax
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20120111/6c3e207a/attachment.pgp>


More information about the mesa-dev mailing list