[PATCH] D57241: [scudo] Delay allocations in the RSS check test

Kostya Kortchinsky via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 25 08:32:47 PST 2019


cryptoad created this revision.
cryptoad added reviewers: eugenis, yroux.
Herald added subscribers: Sanitizers, delcypher, kristof.beyls, javed.absar.

D57116 <https://reviews.llvm.org/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.


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D57241

Files:
  test/scudo/rss.c


Index: test/scudo/rss.c
===================================================================
--- test/scudo/rss.c
+++ test/scudo/rss.c
@@ -30,7 +30,8 @@
 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])


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D57241.183550.patch
Type: text/x-patch
Size: 477 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190125/ea9ca3db/attachment.bin>


More information about the llvm-commits mailing list