diff options
author | Kostya Kortchinsky <kostyak@google.com> | 2019-01-25 17:23:29 +0000 |
---|---|---|
committer | Kostya Kortchinsky <kostyak@google.com> | 2019-01-25 17:23:29 +0000 |
commit | a04584b095c9fda0730b1f24466e4d5e3e4d2f14 (patch) | |
tree | edfe01dd6df521aa26af1414534d0c1c85e9e41f | |
parent | 3e7fda229d3f82034f43c12bcb5c91f8ba08db94 (diff) | |
download | bcm5719-llvm-a04584b095c9fda0730b1f24466e4d5e3e4d2f14.tar.gz bcm5719-llvm-a04584b095c9fda0730b1f24466e4d5e3e4d2f14.zip |
[scudo] Delay allocations in the RSS check test
Summary:
D57116 fails on the armv7 bots, which is I assume due to the timing of
the RSS check on the platform. While I don't have a platform to test
that change on, I assume this would do.
The test could be made more reliable by either delaying more the
allocations, or allocating more large-chunks, but both those options
have a somewhat non negligible impact (more memory used, longer test).
Hence me trying to keep the additional sleeping/allocating to a
minimum.
Reviewers: eugenis, yroux
Reviewed By: yroux
Subscribers: javed.absar, kristof.beyls, delcypher, #sanitizers, llvm-commits
Differential Revision: https://reviews.llvm.org/D57241
llvm-svn: 352220
-rw-r--r-- | compiler-rt/test/scudo/rss.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler-rt/test/scudo/rss.c b/compiler-rt/test/scudo/rss.c index f98bf9536ea..0b76857b9a4 100644 --- a/compiler-rt/test/scudo/rss.c +++ b/compiler-rt/test/scudo/rss.c @@ -30,7 +30,8 @@ static void *allocs[kNumAllocs]; int main(int argc, char *argv[]) { int returned_null = 0; for (int i = 0; i < kNumAllocs; i++) { - if ((i & 0xf) == 0) + // sleep for 100ms every 8 allocations, to allow the RSS check to catch up. + if (i != 0 && (i & 0x7) == 0) usleep(100000); allocs[i] = malloc(kAllocSize); if (allocs[i]) |