John,
I'd say the problem is with these lines in savagetris.c:
if (index & (_TNL_BIT_COLOR1|_TNL_BIT_FOG)) { EMIT_ATTR( _TNL_ATTRIB_COLOR1, EMIT_3UB_3F_BGR, SAVAGE_HW_NO_CS ); EMIT_ATTR( _TNL_ATTRIB_FOG, EMIT_1UB_1F, SAVAGE_HW_NO_CS ); }
This is a cut and paste of old code from another driver. Have a look at how other drivers handle this now to avoid trying to emit FOG when only COLOR1 is enabled, and vice versa.
Keith
John Lightsey wrote:
On Friday 01 October 2004 04:03, Keith Whitwell wrote:
John Lightsey wrote:
A while back I mentioned on dri-devel that Savage cards will segfault RTCW while loading the Checkpoint demo. ( http://www.nixnuts.net/benchmarks/current/ ) The problem is in Mesa/src/mesa/tnl/t_tertex.c around lines 741 and 913.
for (j = 0; j < count; j++) { GLvector4f *vptr = VB->AttribPtr[a[j].attrib]; a[j].inputstride = vptr->stride; ... }
vptr is null in the middle of the for loop ( j=2 is null j=0, 1, and 3 is valid.) I have no idea why this is the case, but I've attached a simple fix which eliminates the problem.
Does anyone see this in other hardware? If it's only the savage driver causing this, I would say there's probably a bug in the driver somewhere.
What are the values of j, count and a[j] at the time of the crash?
I didn't see the problem with any other hardware, but RTCW refused to run with r128 and sis 305, the last time I tried.
GDB's output seems a bit confused. After the segfault j=3 VB->AttribPtr[a[j].attrib] is a valid pointer, but vptr is null. It looks like j is being incremented after the segfault since VB->AttribPtr[a[2].attrib] is the same bad pointer as vptr.
...snip... LOADING... graphics LOADING... maps/mp_destruction.bsp stitched 0 LoD cracks ...loaded 15194 faces, 48 meshes, 275 trisurfs, 31 flares
Program received signal SIGSEGV, Segmentation fault.
do_emit (ctx=0xa4fa078, start=0, end=4, dest=0x4) at t_vertex.c:916
916 t_vertex.c: No such file or directory.
in t_vertex.c
(gdb) print j
$1 = 3
(gdb) print a[j]
$2 = {attrib = 5, format = 8, vertoffset = 23, vertattrsize = 1, inputptr = 0x0,
inputstride = 0, insert = 0x4653ce48, emit = 0, extract = 0x464dfa70 <extract_1ub_1f>,
vp = 0xa4f9ef8}
(gdb) print a[j].attrib
$3 = 5
(gdb) print VB->AttribPtr[a[j].attrib]
$4 = (GLvector4f *) 0xb2d3718
(gdb) print a[2]
$5 = {attrib = 4, format = 10, vertoffset = 20, vertattrsize = 3, inputptr = 0x87bfb00 "",
inputstride = 8, insert = 0x4653ce80, emit = 0x464deb20 <insert_2f_2>,
extract = 0x464dfa30 <extract_3ub_3f_bgr>, vp = 0xa4f9ef8}
(gdb) print a[2].attrib
$6 = 4
(gdb) print VB->AttribPtr[a[2].attrib]
$7 = (GLvector4f *) 0x0
(gdb) print vptr
$8 = (GLvector4f *) 0x0
(gdb) print vptr->stride
Cannot access memory at address 0xc
(gdb) bt
#0 do_emit (ctx=0xa4fa078, start=0, end=4, dest=0x4) at t_vertex.c:916
#1 0x464d8fb6 in run_render (ctx=0xa4fa078, stage=0x4) at t_vb_render.c:296
#2 0x464c6575 in _tnl_run_pipeline (ctx=0xa4fa078) at t_pipeline.c:159
#3 0x464c4d40 in _tnl_draw_range_elements (ctx=0xa4fa078, mode=1, max_index=4,
index_count=4, indices=0x4) at t_array_api.c:108
#4 0x464c53be in _tnl_DrawElements (mode=4, count=6, type=5125, indices=0x4)
at t_array_api.c:383
#5 0x080746e0 in ?? ()
(gdb)
Hope that helps.
John
------------------------------------------------------- This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more http://productguide.itmanagersjournal.com/guidepromo.tmpl -- _______________________________________________ Dri-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/dri-devel
------------------------------------------------------- This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more http://productguide.itmanagersjournal.com/guidepromo.tmpl -- _______________________________________________ Dri-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/dri-devel