glxcurrent.c question

John Doe <[email protected]>
Newsgroups gmane.comp.video.mesa3d.user
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.