Bug 6656 - arbvptest3 segfaults because of bad index to tnl->vtx.tabfv
Summary: arbvptest3 segfaults because of bad index to tnl->vtx.tabfv
Alias: None
Product: Mesa
Classification: Unclassified
Component: Mesa core (show other bugs)
Version: git
Hardware: x86 (IA32) Linux (All)
: high normal
Assignee: mesa-dev
QA Contact:
Keywords: patch
Depends on:
Reported: 2006-04-19 22:28 UTC by Tilman Sauerbeck
Modified: 2009-08-24 12:23 UTC (History)
0 users

See Also:
i915 platform:
i915 features:

Don't add VERT_ATTRIB_GENERIC0 to the indices (2.85 KB, patch)
2006-04-19 22:30 UTC, Tilman Sauerbeck
Details | Splinter Review

Description Tilman Sauerbeck 2006-04-19 22:28:22 UTC
0x00000000 in ?? ()
(gdb) f 1
#1  0xb7960627 in _tnl_VertexAttrib3fARB (index=19, x=1, y=0.5, z=0.25)
    at tnl/t_vtx_generic.c:472
472	   tnl->vtx.tabfv[index][3-1]( &z );
(gdb) p index
$1 = 19

_tnl_VertexAttrib3fARB (and other functions in t_vtx_generic.) have the
following code snippet:

   if (index >= MAX_VERTEX_ATTRIBS)
      index = ERROR_ATTRIB;
      index += VERT_ATTRIB_GENERIC0;

MAX_VERTEX_ATTRIBS == VERT_ATTRIB_GENERIC0 == 16, and tabfv only has 17 slots,
so this doesn't make sense.

The segfault happened with the r300 driver, but it doesn't seem to be driver
Comment 1 Tilman Sauerbeck 2006-04-19 22:30:04 UTC
Created attachment 5376 [details] [review]
Don't add VERT_ATTRIB_GENERIC0 to the indices

I'm guessing the fix doesn't need to be applied to _tnl_VertexAttrib3fARB only.
Comment 2 Brian Paul 2006-04-20 00:50:11 UTC
We're kind of mid-way through some vertex attrib changes.  Previously the
generic vertex attribs aliased the conventional attribs.  With OpenGL 2.0,
however, the generic attribs are separate from the conventional attribs (no
aliasing).  I'll have to examine some other code before making these changes.
Comment 3 Tilman Sauerbeck 2006-04-29 05:31:43 UTC
Works for me now.
Comment 4 Adam Jackson 2009-08-24 12:23:48 UTC
Mass version move, cvs -> git

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.