MPS issue job004086

TitleAssertion failure in amssshe
Statusclosed
Priorityessential
Assigned userGareth Rees
OrganizationRavenbrook
DescriptionSee for example [1]:

amssshe failed: log follows
--------------------------------------------------------------------------------
lii6gc/cool/amssshe: randomize(): choosing initial state (v3): 303772349.
........trace.c:417: MPS ASSERTION FAILED: !TraceSetIsMember(SegWhite(seg), trace)
AnalysisThe issue is that AMSWhiten adds the segment to the white set for the trace, even if there were no objects in the segment and so nothing was added to trace->condemned. If this is the case for all AMS segments in the condemned set, then trace->condemned will be zero, and so TraceIsEmpty() will return TRUE, and so TraceCondemnZones or traceCondemnAll will return ResFAIL, and the trace will be destroyed via TraceDestroyInit without going through reclaim. But this leaves the AMS segments white even though the trace is finished.

The same issue is present in AWL and LO.

AMC is safe because if the segment is unbuffered then the whole segment is accounted as condemned; if the segment is buffered and there is nothing in the buffer then the segment is not condemned; otherwise there is something in the buffer and the condemned bytes are given by SegSize(seg) - AddrOffset(BufferScanLimit(buffer), BufferLimit(buffer)).

AMS and AWL were accidentally fixed by RB in change 190607. LO was accidentally fixed by GDR in change 192195.
How foundautomated_test
Evidence[1] https://travis-ci.org/Ravenbrook/mps/jobs/400813949
Created byGareth Rees
Created on2018-07-06 13:08:40
Last modified byGareth Rees
Last modified on2018-07-06 14:26:54
History2018-07-06 GDR Created.

Fixes

Change Effect Date User Description
194475 closed 2018-07-06 14:26:54 Gareth Rees Check that traces with no condemned objects can be started and finished without error in each automatic pool class. Regression test for job004086.
192195 open 2016-09-05 16:23:15 Gareth Rees Merge branch/2016-04-13/mortality.
190607 open 2016-03-31 23:43:21 Richard Brooksby Don't allow pools to whiten segments without condemning objects, so that a condemned size of zero implies no white segments, allowing quick trace destruction.

Imported from Git
 Author: Richard Brooksby <rb@ravenbrook.com> 1459464106 +0100
 Committer: Richard Brooksby <rb@ravenbrook.com> 1459464106 +0100
 sha1: f8f87f053ba174f9fd2bcf58831312fbe7db145d
 push-state: complete
 parent-changes: 0c4e6bef63ad2da89e93de328f1b824cf6a87912=[190579]