MPS issue job004030

TitleFailed shield assertion in finalization tests with deep checking
Assigned userGareth Rees
DescriptionIf you run any test case that uses finalization with deep checking turned on, for example:

    make -f xci6ll.gmk clean && make -f xci6ll.gmk VARIETY=cool "CFLAGS=-DCHECKLEVEL=CheckLevelDEEP" finalcv && ./xci6ll/cool/finalcv

then you get the assertion failure:

    shield->unsynced == 0 || shield->suspended
AnalysisThe backtrace shows the following call sequence:


There are two problems here:

1. Memory managed by the MRG pool class is not available to the mutator: it is only used internally, to contain finalization guardians. This means that it does not need to use the hardware write barrier: the MPS could ensure that it is used correctly. So there is needless work being done here fiddling with the write protection on MRG segments.

This is because MRG's segments inherit from GCSeg (so that they can be condemned, scanned, etc.). But GCSeg implements collectable segments that might be handed out to the mutator and so need to have write protection to maintain the remembered set. If we had a finer-grained segment hierarchy, so that there were GCSeg implementing collection, and MutatorGCSeg inheriting from GCSeg and adding write protection, then MRG could use the plain GCSeg and maintain the summary "by hand" using ArenaPoke. See job004072.

2. The MPS is in MRGRefSegInit and so the segment is fresh and so we know statically that the mutator does not have a reference to the segment and so knows that it is fine to call ShieldRaise without suspending the mutator. But the shield has no representation of the concept of "segment is protected because its address has never been given to the mutator", and so the checks cannot take this into account.
How foundautomated_test
EvidenceNone as yet.
Created byGareth Rees
Created on2016-05-03 17:40:47
Last modified byGareth Rees
Last modified on2018-07-05 16:29:17
History2016-05-03 GDR Created.


Change Effect Date User Description
194453 closed 2018-07-05 16:28:15 Gareth Rees Merge branch/2018-06-18/mrgseg into the master sources.