[Gtkradiant] [Bug 288] q3map barfs if more than 3 root shaders are specified for terrain

gtkradiant@zerowing.idsoftware.com gtkradiant@zerowing.idsoftware.com
Mon, 07 Jan 2002 17:18:18 -0600


http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=288

rfm@redshift.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|INVALID                     |



------- Additional Comments From rfm@redshift.com  2002-01-07 17:18 -------
Your missing the point.
The error has nothing to do with the actual problem, aside from the fact that a
garbage value is passed to malloc. There is no reason that a modest terrain with
4 shaders should require over 900 megabytes of memory, and in fact, it doesn't.
In EmitTerrainVerts, the structure surf is almost all initalized
to 0xCDCDCDCD (-842150451 dec, 3452816845 unsigned)
>From the msdev watch window:
-
surf
0x07484ac4
+
shader
0x00e505b0
	x	3
	y	0
	maxVerts	-842150451
	numVerts	-842150451
+
verts
0xcdcdcdcd
	maxIndexes	-842150451
	numIndexes	-842150451
+
indexes
0xcdcdcdcd

The last 6 values are all the same, and MaxIndexes is passed to malloc as
maxindices * sizeof( *indices ), which comes out to 926365492 after overflow.

The error comes because the code uses a size from a structure that
does not have sensible values in it. No, nothing in my terrain has
3.4 billion verticies. The terrain has about 2000 verts, and compiles fine
on a 128 meg machine, as long as only 3 root shaders are used.  I'm willing to
bet  that if your machine can actually allocate 1 gig of memory, it will GPF
very soon after that point. 



------- You are receiving this mail because: -------
Whoops!  I have no idea!