[scudo][standalone] Workaround for full regions on Android
authorKostya Kortchinsky <kostyak@google.com>
Thu, 13 Feb 2020 17:27:18 +0000 (09:27 -0800)
committerKostya Kortchinsky <kostyak@google.com>
Thu, 13 Feb 2020 20:54:25 +0000 (12:54 -0800)
commit21695710cfa9a36256e9547155e2b9e0139f5c6a
tree2fee46d4f6f87b0a47de4f396f1d96ae7d6a9fa4
parent5810ed5186dcad03d4ae53abc103638462519f11
[scudo][standalone] Workaround for full regions on Android

Summary:
Due to Unity, we had to reduce our region sizes, but in some rare
situations, some programs (mostly tests AFAICT) manage to fill up
a region for a given size class.

So this adds a workaround for that attempts to allocate the block
from the immediately larger size class, wasting some memory but
allowing the application to keep going.

Reviewers: pcc, eugenis, cferris, hctim, morehouse

Subscribers: #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

Differential Revision: https://reviews.llvm.org/D74567
compiler-rt/lib/scudo/standalone/combined.h
compiler-rt/lib/scudo/standalone/tests/combined_test.cpp