From: Allen B. <ba...@lo...> - 2001-07-03 17:37:51
Attachments:
try7.c
|
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. BTW, GL_RASTER_POSITION_UNCLIPPED_IBM works great! Thank you. Thanks, Allen |
From: Allen B. <ba...@lo...> - 2001-07-03 17:43:07
Attachments:
try7.c
|
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. Thanks, Allen |
From: Brian P. <br...@va...> - 2001-07-03 21:31:22
|
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? > BTW, GL_RASTER_POSITION_UNCLIPPED_IBM works great! Thank you. You're welcome! -Brain |
From: Allen B. <ba...@lo...> - 2001-07-05 18:58:06
|
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. 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. Thanks, Allen GNU gdb 5.0rh-5 Red Hat Linux 7.1 Copyright 2001 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i386-redhat-linux"... (gdb) r Starting program: /home/allen/lignumCAD/OGLFT/try7 [New Thread 1024 (LWP 25135)] Program received signal SIGFPE, Arithmetic exception. [Switching to Thread 1024 (LWP 25135)] 0x4023916b in _mesa_test_os_sse_exception_support () from /usr/local/lib/libGL.so.1 (gdb) c Continuing. Brian Paul Mesa X11 1.2 Mesa 3.5 Program received signal SIGSEGV, Segmentation fault. 0x40119526 in shade_rastpos (ctx=0xbffff928, vertex=0x403b3177, normal=0x1, Rcolor=0xbffff954, Rspec=0xbffff95c, Rindex=0x804869e) at rastpos.c:228 228 GET_SHINE_TAB_ENTRY( ctx->_ShineTable[0], n_dot_h, spec_coef ); (gdb) where #0 0x40119526 in shade_rastpos (ctx=0xbffff928, vertex=0x403b3177, normal=0x1, Rcolor=0xbffff954, Rspec=0xbffff95c, Rindex=0x804869e) at rastpos.c:228 #1 0x00000007 in ?? () #2 0x4002b763 in processWindowWorkList (window=0xbfffff27) at glut_event.c:1297 #3 0x403b3177 in __libc_start_main (main=0x8048998 <main>, argc=1, ubp_av=0xbffff954, init=0x8048688 <_init>, fini=0x8048ab0 <_fini>, rtld_fini=0x4000e184 <_dl_fini>, stack_end=0xbffff94c) at ../sysdeps/generic/libc-start.c:129 (gdb) l 223 n_dot_h *= n_dot_h; 224 n_dot_h /= LEN_SQUARED_3FV( h ); 225 shininess *= .5; 226 } 227 228 GET_SHINE_TAB_ENTRY( ctx->_ShineTable[0], n_dot_h, spec_coef ); 229 230 if (spec_coef > 1.0e-10) { 231 if (ctx->Light.Model.ColorControl==GL_SEPARATE_SPECULAR_COLOR) { 232 ACC_SCALE_SCALAR_3V( specularContrib, spec_coef, |
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 |
From: Sven M. H. <pe...@gm...> - 2001-07-06 09:28:51
|
On Thu, Jul 05, 2001 at 09:43:52AM -0600, Brian Paul wrote: > Allen Barnett wrote: > > > > 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 Try: $ configure --enable-debug That should add -O0 to CFLAGS if you're using GCC. If you're using a different compiler, tell me which flag you need for debugging code, and I'll add it. -Sven -- "Would the All-Seeing Eye please look in my direction?" [ KeyID........: 0xC297FEAB ] [ Fingerprint..: FEA5 0F93 7320 3F39 66A5 AED3 073F 2D5F C297 FEAB ] |