[compiler-rt] cdf71d2 - Revert ""Reland "[hwasan] Provide aliases for c allocation functions for Fuchsia""

Leonard Chan via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 14 15:33:18 PDT 2023


Author: Leonard Chan
Date: 2023-04-14T22:31:09Z
New Revision: cdf71d2ccd84ed7b8891924b04d1603f344038e9

URL: https://github.com/llvm/llvm-project/commit/cdf71d2ccd84ed7b8891924b04d1603f344038e9
DIFF: https://github.com/llvm/llvm-project/commit/cdf71d2ccd84ed7b8891924b04d1603f344038e9.diff

LOG: Revert ""Reland "[hwasan] Provide aliases for c allocation functions for Fuchsia""

This reverts commit 39ece7583a784976dea786d59e6564649b13d92d.

Reverting because I suspect this is leading to the failures we see in
fxbug.dev/125426. We're seeing unexpected OOMs and I suspect it's
because this change makes c-style allocation functions use hwasan's
allocator which might be worse than the default one (scudo). Reverting
for now to see if this unblocks the clang roll.

Added: 
    

Modified: 
    compiler-rt/lib/hwasan/hwasan_allocation_functions.cpp

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/hwasan/hwasan_allocation_functions.cpp b/compiler-rt/lib/hwasan/hwasan_allocation_functions.cpp
index 59ad633879bd5..ad359b12904b3 100644
--- a/compiler-rt/lib/hwasan/hwasan_allocation_functions.cpp
+++ b/compiler-rt/lib/hwasan/hwasan_allocation_functions.cpp
@@ -16,9 +16,10 @@
 #include "interception/interception.h"
 #include "sanitizer_common/sanitizer_allocator_dlsym.h"
 #include "sanitizer_common/sanitizer_allocator_interface.h"
-#include "sanitizer_common/sanitizer_mallinfo.h"
 #include "sanitizer_common/sanitizer_tls_get_addr.h"
 
+#if !SANITIZER_FUCHSIA
+
 using namespace __hwasan;
 
 struct DlsymAlloc : public DlSymAllocator<DlsymAlloc> {
@@ -154,19 +155,12 @@ void *__sanitizer_malloc(uptr size) {
 
 }  // extern "C"
 
-#if HWASAN_WITH_INTERCEPTORS || SANITIZER_FUCHSIA
-#if SANITIZER_FUCHSIA
-// Fuchsia does not use WRAP/wrappers used for the interceptor infrastructure.
-#  define INTERCEPTOR_ALIAS(RET, FN, ARGS...)                                 \
-    extern "C" SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE RET FN( \
-        ARGS) ALIAS("__sanitizer_" #FN)
-#else
+#if HWASAN_WITH_INTERCEPTORS
 #  define INTERCEPTOR_ALIAS(RET, FN, ARGS...)                                 \
     extern "C" SANITIZER_INTERFACE_ATTRIBUTE RET WRAP(FN)(ARGS)               \
         ALIAS("__sanitizer_" #FN);                                            \
     extern "C" SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE RET FN( \
         ARGS) ALIAS("__sanitizer_" #FN)
-#endif
 
 INTERCEPTOR_ALIAS(int, posix_memalign, void **memptr, SIZE_T alignment,
                   SIZE_T size);
@@ -189,3 +183,5 @@ INTERCEPTOR_ALIAS(int, mallopt, int cmd, int value);
 INTERCEPTOR_ALIAS(void, malloc_stats, void);
 #  endif
 #endif  // #if HWASAN_WITH_INTERCEPTORS
+
+#endif  // SANITIZER_FUCHSIA


        


More information about the llvm-commits mailing list