From: Brian P. <br...@va...> - 2001-07-05 18:14:58
|
Allen Barnett wrote: > > Brian Paul wrote: > > > > Allen Barnett wrote: > > > > > > Hi, > > > > > > I'm getting a segmentation fault in the Mesa function shade_rastpos() > > > when lighting is turned on and if no other drawing precedes a call to > > > RasterPos2i(). Attached is a sample program which demonstrates the > > > problem. I'm using Mesa 3.5.1 on RedHat 7.1/i386. > > > > Hmmm, your test program runs fine here. Can you get a stack trace > > with your debugger? > > Sorry, I pressed the send button before I reverted the attached code to > its failure mode in my original message. Did you test it with the quad > drawing commented out as below? > > > void display ( void ) > > { > > #if 0 > > glBegin( GL_QUADS ); > > glVertex2i( 0, 0 ); > > glVertex2i( 50, 0 ); > > glVertex2i( 50, 50 ); > > glVertex2i( 0, 50 ); > > glEnd(); > > #endif > > > > glRasterPos2i( 0, 0 ); > > } > > The output from the debugger is below. I've checked in a fix for this problem. Here's the diff: diff -r1.28 rastpos.c 133a134,136 > if (!ctx->_ShineTable[0] || !ctx->_ShineTable[1]) > _mesa_validate_all_lighting_tables( ctx ); > > And another question(s): How do you debug Mesa with GDB? I guess I don't > understand how to get it to compile without optimization (a ./configure > option?) and if I have to build and link with a static archive library > instead of a shared object? Any tips would be helpful. I always use the old-style Makefiles when debugging/developing. Try this: cd src make -f Makefile.X11 clean make -f Makefile.X11 linux-debug When running with gdb and using a shared libGL.so, you can't set breakpoints in the Mesa code until the program has begun executing. To work around that, first set a breakpoint in main(), then run. When gdb stops in main() you can then set breakpoints elsewhere in Mesa. -Brian |