MPS issue job003638

TitleIncorrect accounting in MVT
Statusclosed
Prioritynice
Assigned userGareth Rees
OrganizationRavenbrook
DescriptionIf you add the following line near the beginning of MVTSegFree:

    AVER(mvt->available >= size);

then the assertion goes off in some test cases, for example on OS X, mv2test fails in the cool variety with seed 143235344.

It seems that the accounting information is not being kept up to date.
AnalysisThis was discovered by compiling with Clang/LLVM 3.4's -fsanitize=undefined option and then running the test suite.

GDB shows that this only happens in MVTFinish. In MVTFinish, we free all the remaining segments, but there's no way of discovering at this point which segments had fragmented (unavailable) space due to containing a single (big) object.

So we mustn't call MVTSegFree from MVTFinish: we can't do the accounting correctly. We should call SegFree directly.
How foundautomated_test
EvidenceNone as yet.
Created byGareth Rees
Created on2013-10-26 19:40:52
Last modified byGareth Rees
Last modified on2013-10-30 13:15:09
History2013-10-26 GDR Created.

Fixes

Change Effect Date User Description
183610 closed 2013-10-30 13:15:09 Gareth Rees Don't call MVTSegFree from MVTFinish: we don't know whether or not there was any fragmented (unavailable) space in this segment, and so we can't keep the accounting correct. Add assertion in MVTSegFree that detects incorrect accounting.