llvm-project/compiler-rt/test/scudo
Kostya Kortchinsky 58f2656d7e [scudo] Soft and hard RSS limit checks
Summary:
This implements an opportunistic check for the RSS limit.

For ASan, this was implemented thanks to a background thread checking the
current RSS vs the set limit every 100ms. This was deemed problematic for Scudo
due to potential Android concerns (Zygote as pointed out by Aleksey) as well as
the general inconvenience of having a permanent background thread.

If a limit (soft or hard) is specified, we will attempt to update the RSS limit
status (exceeded or not) every 100ms. This is done in an opportunistic way: if
we can update it, we do it, if not we return the current status, mostly because
we don't need it to be fully consistent (it's done every 100ms anyway). If the
limit is exceeded `allocate` will act as if OOM for a soft limit, or just die
for a hard limit.

We use the `common_flags()`'s `hard_rss_limit_mb` & `soft_rss_limit_mb` for
configuration of the limits.

Reviewers: alekseyshl

Reviewed By: alekseyshl

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D40038

llvm-svn: 318301
2017-11-15 16:40:27 +00:00
..
CMakeLists.txt [scudo] Android build support 2017-09-18 15:40:53 +00:00
alignment.c [scudo] Implement stricter separation of C vs C++ 2017-11-01 15:28:20 +00:00
double-free.cpp [scudo] Implement stricter separation of C vs C++ 2017-11-01 15:28:20 +00:00
interface.cpp [scudo] Implement stricter separation of C vs C++ 2017-11-01 15:28:20 +00:00
lit.cfg [scudo] Fix standlone build -lrt requirement 2017-11-01 17:00:26 +00:00
lit.site.cfg.in [scudo] Additional modifications for Android tests support 2017-09-18 20:31:57 +00:00
malloc.cpp [scudo] Implement stricter separation of C vs C++ 2017-11-01 15:28:20 +00:00
memalign.c [scudo] Implement stricter separation of C vs C++ 2017-11-01 15:28:20 +00:00
mismatch.cpp [scudo] Implement stricter separation of C vs C++ 2017-11-01 15:28:20 +00:00
options.cpp [scudo] Implement stricter separation of C vs C++ 2017-11-01 15:28:20 +00:00
overflow.c [scudo] Implement stricter separation of C vs C++ 2017-11-01 15:28:20 +00:00
preinit.c [scudo] Implement stricter separation of C vs C++ 2017-11-01 15:28:20 +00:00
preload.cpp [scudo] Implement stricter separation of C vs C++ 2017-11-01 15:28:20 +00:00
quarantine.c [scudo] Implement stricter separation of C vs C++ 2017-11-01 15:28:20 +00:00
random_shuffle.cpp [scudo] Implement stricter separation of C vs C++ 2017-11-01 15:28:20 +00:00
realloc.cpp [scudo] Implement stricter separation of C vs C++ 2017-11-01 15:28:20 +00:00
rss.c [scudo] Soft and hard RSS limit checks 2017-11-15 16:40:27 +00:00
secondary.c [scudo] Implement stricter separation of C vs C++ 2017-11-01 15:28:20 +00:00
sized-delete.cpp [scudo] Implement stricter separation of C vs C++ 2017-11-01 15:28:20 +00:00
sizes.cpp [scudo] Implement stricter separation of C vs C++ 2017-11-01 15:28:20 +00:00
threads.c [scudo] Implement stricter separation of C vs C++ 2017-11-01 15:28:20 +00:00
tsd_destruction.c [scudo] Implement stricter separation of C vs C++ 2017-11-01 15:28:20 +00:00
valloc.c [scudo] Implement stricter separation of C vs C++ 2017-11-01 15:28:20 +00:00