Major/Minor Opcodes of failed requests

Adam Jackson ajax at nwnk.net
Wed Mar 30 18:19:45 UTC 2016


On Wed, 2016-03-30 at 10:03 -0600, Lloyd Brown wrote:
> Can anyone help me understand where the error messages, especially the
> major and minor opcodes, come from in an error like this one?  Are these
> defined by Xorg, by the driver (Nvidia, in this case), or somewhere else
> entirely?

The major opcode is split in two ranges.  Major opcodes from 0 to 127
are reserved for requests in the core protocol.  Major opcodes from 128
to 255 are assigned dynamically to each extension as it is registered;
the minor opcode then determines which extension request it is.

> > X Error of failed request:  BadAlloc (insufficient resources for
> > operation)
> >   Major opcode of failed request:  135 (GLX)

Xlib is polite enough to map the major opcode to the extension here.
You can also see the assignments for a particular server by running
xdpyinfo -queryExtensions.

> >   Minor opcode of failed request:  34 ()

GLX request 34 is X_GLXCreateContextAtrribsARB. The easiest way to look
this up in general is to grep for the request number in the appropriate
extension header file, usually in /usr/include/X11/extensions, but for
GLX it's in /usr/include/GL.

The question, then, is why you'd be getting BadAlloc back from
glXCreateContextAttribsARB().

- ajax


More information about the xorg mailing list