[compiler-rt] r366472 - Revert "Fix asan infinite loop on undefined symbol"

Matthew Voss via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 18 10:43:44 PDT 2019


Author: ormris
Date: Thu Jul 18 10:43:44 2019
New Revision: 366472

URL: http://llvm.org/viewvc/llvm-project?rev=366472&view=rev
Log:
Revert "Fix asan infinite loop on undefined symbol"

This reverts commit 63719119c78ca965b5d80e5c20fcfe81ba28f896.

The tests in this commit were failing on a Linux sanitizer bot
and our internal CI.

http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/builds/22401/steps/test%20standalone%20compiler-rt%20with%20symbolizer/logs/stdio

Modified:
    compiler-rt/trunk/lib/interception/interception_linux.cc

Modified: compiler-rt/trunk/lib/interception/interception_linux.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/interception/interception_linux.cc?rev=366472&r1=366471&r2=366472&view=diff
==============================================================================
--- compiler-rt/trunk/lib/interception/interception_linux.cc (original)
+++ compiler-rt/trunk/lib/interception/interception_linux.cc Thu Jul 18 10:43:44 2019
@@ -33,7 +33,7 @@ static int StrCmp(const char *s1, const
 }
 #endif
 
-static void *GetFuncAddr(const char *name, uptr wrapper_addr) {
+static void *GetFuncAddr(const char *name) {
 #if SANITIZER_NETBSD
   // FIXME: Find a better way to handle renames
   if (StrCmp(name, "sigaction"))
@@ -47,18 +47,13 @@ static void *GetFuncAddr(const char *nam
     // want the address of the real definition, though, so look it up using
     // RTLD_DEFAULT.
     addr = dlsym(RTLD_DEFAULT, name);
-
-    // In case `name' is not loaded, dlsym ends up finding the actual wrapper.
-    // We don't want to intercept the wrapper and have it point to itself.
-    if ((uptr)addr == wrapper_addr)
-      addr = nullptr;
   }
   return addr;
 }
 
 bool InterceptFunction(const char *name, uptr *ptr_to_real, uptr func,
                        uptr wrapper) {
-  void *addr = GetFuncAddr(name, wrapper);
+  void *addr = GetFuncAddr(name);
   *ptr_to_real = (uptr)addr;
   return addr && (func == wrapper);
 }




More information about the llvm-commits mailing list