From 3e93131dd292800fd9f56c93a81d85fb86e3116f Mon Sep 17 00:00:00 2001 From: Matthew Voss Date: Thu, 18 Jul 2019 17:43:44 +0000 Subject: [PATCH] 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 llvm-svn: 366472 --- compiler-rt/lib/interception/interception_linux.cc | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/compiler-rt/lib/interception/interception_linux.cc b/compiler-rt/lib/interception/interception_linux.cc index 4b27102..d07f060 100644 --- a/compiler-rt/lib/interception/interception_linux.cc +++ b/compiler-rt/lib/interception/interception_linux.cc @@ -33,7 +33,7 @@ static int StrCmp(const char *s1, const char *s2) { } #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 *name, uptr wrapper_addr) { // 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); } -- 2.7.4