[PATCH] D90400: [sanitizer] Disable ASLR for release_shadow_space

Adhemerval Zanella via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 29 08:16:37 PDT 2020


zatrazz created this revision.
zatrazz added reviewers: morehouse, stephan.yichao.zhao, eugenis.
zatrazz added a project: Sanitizers.
Herald added subscribers: Sanitizers, kristof.beyls.
zatrazz requested review of this revision.

On aarch64 with kernel 4.12.13 the test sporadically fails with

RSS at start: 1564, after mmap: 103964, after mmap+set label: 308768, \
after fixed map: 206368, after another mmap+set label: 308768, after \
munmap: 206368
release_shadow_space.c.tmp: [...]/release_shadow_space.c:80: int \
main(int, char **): Assertion `after_fixed_mmap <= before + delta' failed.

It seems on some executions the memory is not fully released, even
after munmap.  And it also seems that ASLR is hurting it by adding
some fragmentation, by disabling it I could not reproduce the issue
in multiple runs.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D90400

Files:
  compiler-rt/test/dfsan/release_shadow_space.c


Index: compiler-rt/test/dfsan/release_shadow_space.c
===================================================================
--- compiler-rt/test/dfsan/release_shadow_space.c
+++ compiler-rt/test/dfsan/release_shadow_space.c
@@ -1,5 +1,5 @@
-// DFSAN_OPTIONS=no_huge_pages_for_shadow=false RUN: %clang_dfsan %s -o %t && %run %t
-// DFSAN_OPTIONS=no_huge_pages_for_shadow=true RUN: %clang_dfsan %s -o %t && %run %t
+// DFSAN_OPTIONS=no_huge_pages_for_shadow=false RUN: %clang_dfsan %s -o %t && setarch `uname -m` -R %run %t
+// DFSAN_OPTIONS=no_huge_pages_for_shadow=true RUN: %clang_dfsan %s -o %t && setarch `uname -m` -R %run %t
 
 #include <assert.h>
 #include <sanitizer/dfsan_interface.h>


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D90400.301628.patch
Type: text/x-patch
Size: 690 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201029/c86f3654/attachment.bin>


More information about the llvm-commits mailing list