[compiler-rt] r304699 - Revert "[sanitizer-coverage] test for -fsanitize-coverage=inline-8bit-counters"

Renato Golin via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 5 00:36:02 PDT 2017


Author: rengolin
Date: Mon Jun  5 02:36:02 2017
New Revision: 304699

URL: http://llvm.org/viewvc/llvm-project?rev=304699&view=rev
Log:
Revert "[sanitizer-coverage] test for -fsanitize-coverage=inline-8bit-counters"

Revert "Mark sancov test as unsupported on Darwin"
Revert "[LSan] Detect dynamic loader by its base address."

This reverts commit r304633.
This reverts commit r304673.
This reverts commit r304632.

Those commit have broken LOTS of ARM/AArch64 bots for two days.

Removed:
    compiler-rt/trunk/test/sanitizer_common/TestCases/sanitizer_coverage_inline8bit_counter.cc
Modified:
    compiler-rt/trunk/lib/lsan/lsan_common.cc
    compiler-rt/trunk/lib/lsan/lsan_common_linux.cc
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform.h

Modified: compiler-rt/trunk/lib/lsan/lsan_common.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/lsan/lsan_common.cc?rev=304699&r1=304698&r2=304699&view=diff
==============================================================================
--- compiler-rt/trunk/lib/lsan/lsan_common.cc (original)
+++ compiler-rt/trunk/lib/lsan/lsan_common.cc Mon Jun  5 02:36:02 2017
@@ -408,9 +408,6 @@ static void MarkInvalidPCCb(uptr chunk,
 
 // On Linux, handles dynamically allocated TLS blocks by treating all chunks
 // allocated from ld-linux.so as reachable.
-// On Linux, treats all chunks allocated from ld-linux.so as reachable, which
-// covers dynamically allocated TLS blocks, internal dynamic loader's loaded
-// modules accounting etc.
 // Dynamic TLS blocks contain the TLS variables of dynamically loaded modules.
 // They are allocated with a __libc_memalign() call in allocate_and_init()
 // (elf/dl-tls.c). Glibc won't tell us the address ranges occupied by those

Modified: compiler-rt/trunk/lib/lsan/lsan_common_linux.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/lsan/lsan_common_linux.cc?rev=304699&r1=304698&r2=304699&view=diff
==============================================================================
--- compiler-rt/trunk/lib/lsan/lsan_common_linux.cc (original)
+++ compiler-rt/trunk/lib/lsan/lsan_common_linux.cc Mon Jun  5 02:36:02 2017
@@ -23,10 +23,6 @@
 #include "sanitizer_common/sanitizer_linux.h"
 #include "sanitizer_common/sanitizer_stackdepot.h"
 
-#if SANITIZER_USE_GETAUXVAL
-#include <sys/auxv.h>
-#endif  // SANITIZER_USE_GETAUXVAL
-
 namespace __lsan {
 
 static const char kLinkerName[] = "ld";
@@ -34,12 +30,8 @@ static const char kLinkerName[] = "ld";
 static char linker_placeholder[sizeof(LoadedModule)] ALIGNED(64);
 static LoadedModule *linker = nullptr;
 
-static bool IsLinker(const LoadedModule& module) {
-#if SANITIZER_USE_GETAUXVAL
-  return module.base_address() == getauxval(AT_BASE);
-#else
-  return LibraryNameIs(module.full_name(), kLinkerName);
-#endif  // SANITIZER_USE_GETAUXVAL
+static bool IsLinker(const char* full_name) {
+  return LibraryNameIs(full_name, kLinkerName);
 }
 
 __attribute__((tls_model("initial-exec")))
@@ -57,25 +49,22 @@ void InitializePlatformSpecificModules()
   ListOfModules modules;
   modules.init();
   for (LoadedModule &module : modules) {
-    if (!IsLinker(module))
-      continue;
+    if (!IsLinker(module.full_name())) continue;
     if (linker == nullptr) {
       linker = reinterpret_cast<LoadedModule *>(linker_placeholder);
       *linker = module;
       module = LoadedModule();
     } else {
       VReport(1, "LeakSanitizer: Multiple modules match \"%s\". "
-                 "TLS and other allocations originating from linker might be "
-                 "falsely reported as leaks.\n", kLinkerName);
+              "TLS will not be handled correctly.\n", kLinkerName);
       linker->clear();
       linker = nullptr;
       return;
     }
   }
   if (linker == nullptr) {
-    VReport(1, "LeakSanitizer: Dynamic linker not found. TLS and other "
-               "allocations originating from linker might be falsely reported "
-                "as leaks.\n");
+    VReport(1, "LeakSanitizer: Dynamic linker not found. "
+               "TLS will not be handled correctly.\n");
   }
 }
 

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc?rev=304699&r1=304698&r2=304699&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc Mon Jun  5 02:36:02 2017
@@ -75,6 +75,16 @@ extern char **environ;  // provided by c
 #include <sys/signal.h>
 #endif
 
+#ifndef __GLIBC_PREREQ
+#define __GLIBC_PREREQ(x, y) 0
+#endif
+
+#if SANITIZER_LINUX && __GLIBC_PREREQ(2, 16)
+# define SANITIZER_USE_GETAUXVAL 1
+#else
+# define SANITIZER_USE_GETAUXVAL 0
+#endif
+
 #if SANITIZER_USE_GETAUXVAL
 #include <sys/auxv.h>
 #endif

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform.h?rev=304699&r1=304698&r2=304699&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform.h (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform.h Mon Jun  5 02:36:02 2017
@@ -269,14 +269,5 @@
 # define SANITIZER_SUPPRESS_LEAK_ON_PTHREAD_EXIT 0
 #endif
 
-#ifndef __GLIBC_PREREQ
-#define __GLIBC_PREREQ(x, y) 0
-#endif
-
-#if SANITIZER_LINUX && __GLIBC_PREREQ(2, 16)
-# define SANITIZER_USE_GETAUXVAL 1
-#else
-# define SANITIZER_USE_GETAUXVAL 0
-#endif
 
 #endif // SANITIZER_PLATFORM_H

Removed: compiler-rt/trunk/test/sanitizer_common/TestCases/sanitizer_coverage_inline8bit_counter.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/sanitizer_common/TestCases/sanitizer_coverage_inline8bit_counter.cc?rev=304698&view=auto
==============================================================================
--- compiler-rt/trunk/test/sanitizer_common/TestCases/sanitizer_coverage_inline8bit_counter.cc (original)
+++ compiler-rt/trunk/test/sanitizer_common/TestCases/sanitizer_coverage_inline8bit_counter.cc (removed)
@@ -1,23 +0,0 @@
-// Tests -fsanitize-coverage=inline-8bit-counters
-//
-// REQUIRES: has_sancovcc,stable-runtime
-// UNSUPPORTED: i386-darwin, x86_64-darwin
-//
-// RUN: %clangxx -O0 %s -fsanitize-coverage=inline-8bit-counters 2>&1
-
-#include <stdio.h>
-#include <assert.h>
-
-const char *first_counter;
-
-extern "C"
-void __sanitizer_cov_8bit_counters_init(const char *start, const char *end) {
-  printf("INIT: %p %p\n", start, end);
-  assert(end - start > 1);
-  first_counter = start;
-}
-
-int main() {
-  assert(first_counter);
-  assert(*first_counter == 1);
-}




More information about the llvm-commits mailing list