This is an archive of the discontinued LLVM Phabricator instance.

[scudo] Change region size from 1 MB to 2 MB in tests
ClosedPublic

Authored by Chia-hungDuan on Oct 15 2022, 2:01 PM.

Details

Summary

In SizeClassAllocator64, the RegionBeg is determined by RegionBase +
random offset. The offset is n pages, where n is a random number less or
equal to 16. However, on certain platforms which have large page size,
it may end up immediately OOM without mapping any block pages. For
example,

PageSize = 64 KB, RegionSize = 1 MB

Suppose the random number n is 16, then the random offset will be
64 * 16 = 1024 KB which is equal to the RegionSize.

On most platforms we don't have such large page size and we have
different PRNG(pseudo random number generator) behaviors, thus we didn't
hit any failures before. Given that this now only affects the tests,
only increase the region size is enough.

Will revisit the logic of calculating the random offset.

Diff Detail

Event Timeline

Chia-hungDuan created this revision.Oct 15 2022, 2:01 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 15 2022, 2:01 PM
Chia-hungDuan requested review of this revision.Oct 15 2022, 2:01 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 15 2022, 2:01 PM
Herald added a subscriber: Restricted Project. · View Herald Transcript

Add more contexts to this. After landing D133897, the BatchClass started bumping into the problem on PPC and BatchClass is the most important size class so that it's allocation failure will result in a different test failure. Given that D133897 doesn't change the logic of calculating the random offset, I can only guess that the impact comes from the implementation of pseudo random number generator. Somehow D133897 was reverted. To get it back, we need to ensure the BatchClass won't OOM in these tests.

cryptoad accepted this revision.Oct 17 2022, 10:24 AM
This revision is now accepted and ready to land.Oct 17 2022, 10:24 AM