[net.bugs.4bsd] deficiency in franz gc

alfred@ctvax.UUCP (12/05/83)

#N:ctvax:33500001:000:1646
ctvax!alfred    Dec  3 12:01:00 1983


This really isn't a bug so much as a deficiency
in the code.  We are running Opus 38.26 and recently
had need to increase the constant TTSIZE (in config.h)
above the default 10216.  It turns out that this
breaks the garbage collector which will fail
to completely clear the array bitmapi
if given a TTSIZE greater 10216 (during the
clearing out of bit maps).  The offending code
is in Talloc.c (or alloc.c, depending on your Opus).
The old code is:

	/* try the movc5 to clear the bit maps */
	/* the maximum number of bytes we can clear in one sweep is
	 * 2^16 (or 1<<16 in the C lingo)
	 */
	bytestoclear = ((((int)datalim)-((int)beginsweep)) >> 9) * 16; 
	if(bytestoclear > MAXCLEAR)
	{ 
	   blzero(((int) &bitmapi[((int)beginsweep>>7)]) + MAXCLEAR, 
			    bytestoclear - MAXCLEAR);
	   bytestoclear = MAXCLEAR;
	}
	blzero((int)&bitmapi[((int)beginsweep)>>7],bytestoclear);

and the fixed version that we have been running for several weeks
now is:

	/* try the movc5 to clear the bit maps */
	/* the maximum number of bytes we can clear in one sweep is
	 * 2^16 (or 1<<16 in the C lingo)
	 */
	bytestoclear = ((((int)datalim)-((int)beginsweep)) >> 9) * 16;
	{int count = 0; 
    	while (bytestoclear > 0) {
	    if(bytestoclear > MAXCLEAR)
	    { 
	   	blzero(((int) &bitmapi[((int)beginsweep>>7)])+count*MAXCLEAR, 
			    MAXCLEAR);
	   	++count;
	    }
	    else
	    	blzero(((int)&bitmapi[((int)beginsweep)>>7]+count*MAXCLEAR),
			bytestoclear);
   	    bytestoclear -= MAXCLEAR;
	    }
	}

The old code was still present in Opus 38.56.

Alfred Correira
Paul Robertson
...ucbvax!nbires!ctvax!alfred (UUCP)
alfred.ct@Rand-Relay (CSNET)