[scudo][standalone] Reduce Android region sizes to 128MB

Summary:
Unity is making irresponsible assumptions as to how clumped up memory
should be. With larger regions, we break those, resulting in errors
like:

"Using memoryadresses from more that 16GB of memory"

This is unfortunately one of those situations where we have to bend to
existing code because we doubt it's going to change any time soon.

128MB should be enough, but we could be flirting with OOMs in the
higher class sizes.

Reviewers: cferris, eugenis, hctim, morehouse, pcc

Subscribers: #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

Differential Revision: https://reviews.llvm.org/D73143
This commit is contained in:
Kostya Kortchinsky 2020-01-21 14:38:30 -08:00
parent dfe9f130e0
commit 990acd450c
1 changed files with 4 additions and 4 deletions

View File

@ -39,8 +39,8 @@ struct DefaultConfig {
struct AndroidConfig {
using SizeClassMap = AndroidSizeClassMap;
#if SCUDO_CAN_USE_PRIMARY64
// 1GB regions
typedef SizeClassAllocator64<SizeClassMap, 30U,
// 128MB regions
typedef SizeClassAllocator64<SizeClassMap, 27U,
/*MaySupportMemoryTagging=*/true>
Primary;
#else
@ -55,8 +55,8 @@ struct AndroidConfig {
struct AndroidSvelteConfig {
using SizeClassMap = SvelteSizeClassMap;
#if SCUDO_CAN_USE_PRIMARY64
// 512MB regions
typedef SizeClassAllocator64<SizeClassMap, 29U> Primary;
// 128MB regions
typedef SizeClassAllocator64<SizeClassMap, 27U> Primary;
#else
// 64KB regions
typedef SizeClassAllocator32<SizeClassMap, 16U> Primary;