[PATCH] D88457: [scudo][standalone] Fix Primary's ReleaseToOS test

Kostya Kortchinsky via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 28 17:21:42 PDT 2020


cryptoad created this revision.
cryptoad added reviewers: pcc, cferris, mcgrathr, eugenis, hctim.
Herald added a project: Sanitizers.
Herald added a subscriber: Sanitizers.
cryptoad requested review of this revision.

Said test was flaking on Fuchsia for non-obvious reasons, and only
for ASan variants (the release was returning 0).

It turned out that the templating was off, `true` being promoted to
a `s32` and used as the minimum interval argument. This meant that in
some circumstances, the normal release would occur, and the forced
release would have nothing to release, hence the 0 byte released.

The symbols are giving it away (note the 1):

  scudo::SizeClassAllocator64<scudo::FixedSizeClassMap<scudo::DefaultSizeClassConfig>,24ul,1,2147483647,false>::releaseToOS(void)

This also probably means that there was no MTE version of that test!


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D88457

Files:
  compiler-rt/lib/scudo/standalone/tests/primary_test.cpp


Index: compiler-rt/lib/scudo/standalone/tests/primary_test.cpp
===================================================================
--- compiler-rt/lib/scudo/standalone/tests/primary_test.cpp
+++ compiler-rt/lib/scudo/standalone/tests/primary_test.cpp
@@ -236,5 +236,6 @@
   testReleaseToOS<scudo::SizeClassAllocator32<SizeClassMap, 18U>>();
 #endif
   testReleaseToOS<scudo::SizeClassAllocator64<SizeClassMap, 24U>>();
-  testReleaseToOS<scudo::SizeClassAllocator64<SizeClassMap, 24U, true>>();
+  testReleaseToOS<scudo::SizeClassAllocator64<SizeClassMap, 24U, INT32_MIN,
+                                              INT32_MAX, true>>();
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D88457.294840.patch
Type: text/x-patch
Size: 643 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200929/e8588398/attachment.bin>


More information about the llvm-commits mailing list