MPS issue job000550

TitleBufferEmpty on AMS in mid-collection can break
Statusclosed
Priorityoptional
Assigned userNick Barnes
OrganizationRavenbrook
DescriptionPekka says, "In the two-table configuration (i.e. shareAllocTable is on), BufferEmpty can start using the allocTable as an alloc table in the middle of a collection. This can't be done, but turning the returned buffer area white will cause it to be reclaimed, and the code was already doing that, anyway."
AnalysisFound by Pekka, who says "[make BufferEmpty] keep its hands off the allocTable, when it's being used for colour.". Here's his patch, from [1]:

------------------------------
989,998c989,994
< } else { /* Start using allocTable, if possible. */
< /* If allocTable is being used as white table, we can't touch it,
< * but the whiten below will cause this area to be reclaimed. */
< if (!(amsseg->colourTablesInUse && ams->shareAllocTable)) {
< amsseg->allocTableInUse = TRUE;
< BTSetRange(amsseg->allocTable, 0, amsseg->firstFree);
< if (amsseg->firstFree < amsseg->grains)
< BTResRange(amsseg->allocTable, amsseg->firstFree, amsseg->grains);
< BTResRange(amsseg->allocTable, initIndex, limitIndex);
< }
---
> } else { /* start using allocTable */
> amsseg->allocTableInUse = TRUE;
> BTSetRange(amsseg->allocTable, 0, amsseg->firstFree);
> if (amsseg->firstFree < amsseg->grains)
> BTResRange(amsseg->allocTable, amsseg->firstFree, amsseg->grains);
> BTResRange(amsseg->allocTable, initIndex, limitIndex);
------------------------------
How foundautomated_test
Evidence[1] <http://info.ravenbrook.com/mail/2002/06/21/13-06-18/0.txt>
Observed in1.100.1
Introduced in1.100.0
Created byNick Barnes
Created on2002-06-21 17:14:16
Last modified byGareth Rees
Last modified on2014-04-12 21:08:22
History2002-06-21 NB Created

Fixes

Change Effect Date User Description
185434 closed 2014-04-10 18:16:29 Gareth Rees Don't turn on the allocTable in AMSBufferEmpty when it's shared with nonwhiteTable and the colour tables are in use -- this will turn any grey grains in the segment invalid.
Add more checking to AMS, including the table use invariant.