please help - MIT-SHM extension > XShmCreatePixmap issue

Aaron Plattner aplattner at
Fri Jan 15 11:10:33 PST 2010

On Fri, Jan 15, 2010 at 11:02:13AM -0800, mark wrote:
> Hello all,
> I've got a question regarding an error that I'm getting trying to
> communicate with the X server.  It seems my XShmCreatePixmap call is
> returning:
> X Error of failed request:  BadImplementation (server does not implement operation)
> I'm using a piece of software written to display a JPEG in a xwindow. The
> software basically just decodes a jpeg then puts it into shared memory
> and displays it on the screen every X seconds without ripping/flashing
> (some double buffering done).The software has been written to use the
> MIT-SHM extension.  The software runs fine compiled and executed on a
> different device running the 1.6.0 version of the Xorg server.  I'm
> running it on version 1.7.3 (I've tried 1.60, and 1.6.2 and get the same
> results);  xdpyinfo returns info stating that the server supports pixmaps
> (see below) and that MIT-SHM support is an available extension.  The X
> log file is attached below. My error handling routines are returning the
> below attached info.  I suspect that when syncing after the
> XShmCreatePixmap call was made the server rejects the call.  As a result,
> the pixmap drawable isn't created so when XShmPutImage is called this
> error occurs:
> X Error of failed request:  BadDrawable (invalid Pixmap or Window
> parameter)
> I've attached a snippet of the code where the error seems to occur. This
> software has worked perfect fine for years on 6.8.0 and Xfree 4.3.0
> versions of X.  Not sure what to do or try here or where to continue
> looking.  Any help would be greatly appreciated.  Thank you very much for
> your time so far.

SHM pixmaps are an optional part of the MIT-SHM extension, and are disabled
in most recent drivers / acceleration architectures because they cause
major performance headaches.  You need to query the extension with
XShmQueryVersion and look at the returned 'sharedPixmaps' boolean:

       XShmQueryVersion returns the version numbers of the extension
       implementation. Shared memory  pixmaps  are  supported if the
       pixmaps argument returns true.

You can do a similar query with 'xdpyinfo -ext MIT-SHM'.  Look at the botom
of the output:

       MIT-SHM version 1.1 opcode: 142, base event: 98, base error: 159
         shared pixmaps: no

If SHM pixmaps are not supported, your application needs to use something
else, such as XShmPutImage.

> Do any of you know where I would get a list of all the Major and Minor
> opcodes for X requests?

For the major opcodes, xdpyinfo -queryExtensions.  For the minor ones, look
at the protocol headers installed in /usr/include/X11/extensions/* by the
*proto packages.

Hope that helps!


More information about the xorg mailing list