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, |