[compiler-rt] r264150 - Revert "[tsan] Disable randomized address space on linux aarch64."

Renato Golin via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 23 04:24:31 PDT 2016


Author: rengolin
Date: Wed Mar 23 06:24:30 2016
New Revision: 264150

URL: http://llvm.org/viewvc/llvm-project?rev=264150&view=rev
Log:
Revert "[tsan] Disable randomized address space on linux aarch64."

This reverts commits r264068 and r264079, and they were breaking the build and
weren't reverted in time, nor they exhibited expected behaviour from the
reviewers. There is more to discuss than just a test fix.

Modified:
    compiler-rt/trunk/lib/tsan/rtl/tsan_platform_linux.cc

Modified: compiler-rt/trunk/lib/tsan/rtl/tsan_platform_linux.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_platform_linux.cc?rev=264150&r1=264149&r2=264150&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/rtl/tsan_platform_linux.cc (original)
+++ compiler-rt/trunk/lib/tsan/rtl/tsan_platform_linux.cc Wed Mar 23 06:24:30 2016
@@ -36,7 +36,6 @@
 #include <string.h>
 #include <stdarg.h>
 #include <sys/mman.h>
-#include <sys/personality.h>
 #include <sys/syscall.h>
 #include <sys/socket.h>
 #include <sys/time.h>
@@ -292,20 +291,6 @@ void InitializePlatform() {
       SetAddressSpaceUnlimited();
       reexec = true;
     }
-    // After patch "arm64: mm: support ARCH_MMAP_RND_BITS." is introduced in
-    // linux kernel, the random gap between stack and mapped area is increased
-    // from 128M to 36G on 39-bit aarch64. As it is almost impossible to cover
-    // this big range, we should disable randomized virtual space on aarch64.
-#if defined(__aarch64__)
-    int old_personality = personality(0xffffffff);
-    if (old_personality != -1 && (old_personality & ADDR_NO_RANDOMIZE) == 0) {
-      Report("WARNING: Program is run with randomized virtual address space,"
-             " which wouldn't work with ThreadSanitizer.\n");
-      Report("Re-execing with fixed virtual address space.\n");
-      CHECK_NE(-1, personality(old_personality | ADDR_NO_RANDOMIZE));
-      reexec = true;
-    }
-#endif
     if (reexec)
       ReExec();
   }




More information about the llvm-commits mailing list