[Mesa-users] glxcurrent.c question

John Doe umebugmenot at gmail.com
Tue Mar 8 14:48:47 PST 2011


Hi all,

While working with a third party application I received a SEGFAULT.
Using backtrace I was able to home in the apparent (might not be the
main) source of the SEGFAULT. It is in glxcurrent.c.
More specifically, it is generated at line 201:

static void
__glXGenerateError(Display * dpy, struct glx_context *gc, XID resource,
                   BYTE errorCode, CARD16 minorCode)
{
   xError error;

   error.errorCode = errorCode;
   error.resourceID = resource;
   error.sequenceNumber = dpy->request;
   error.type = X_Error;
   error.majorCode = gc->majorOpcode;       <---- Line 201
   error.minorCode = minorCode;
   _XError(dpy, &error);
}

The previous stack call is in the same file at line 228:

if (gc == NULL && (draw != None || read != None)) {
      __glXGenerateError(dpy, gc, (draw != None) ? draw : read,   <-- Line 228
                         BadMatch, X_GLXMakeContextCurrent);
      return False;
}

Examining the trace I was able to see that all the conditions for the
if-test were satisfied. Hence the program counter enters the if-block
and calls the __glXGenerateError.
But, in __glXGenerateError since the gc is NULL the call:

error.majorCode = gc->majorOpcode

causes SEGFAULT.

Is this a bug? Or am I missing something?

I am on a 32-bit Ubuntu Maverick box. MESA version is 7.9.2.

Thank you,

UB


More information about the mesa-users mailing list