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

Leonard Chan via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 29 18:38:48 PDT 2023


Author: Leonard Chan
Date: 2023-03-30T01:38:05Z
New Revision: c5c6781428a70d1fffd00a256a237cbf5a3ccfd3

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

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

This reverts commit 5bb826d569ccd80e28aedd682db39b8cddd44e53.

We suspect this is leading to the segfaults for tests run on
aarch64+android+hwasan:
https://lab.llvm.org/buildbot/#/builders/77/builds/26025/steps/21/logs/stdio

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 6807691f435e0..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,9 +155,12 @@ void *__sanitizer_malloc(uptr size) {
 
 }  // extern "C"
 
-#define INTERCEPTOR_ALIAS(RET, FN, ARGS...)                                 \
-  extern "C" SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE RET FN( \
-      ARGS) ALIAS("__sanitizer_" #FN)
+#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)
 
 INTERCEPTOR_ALIAS(int, posix_memalign, void **memptr, SIZE_T alignment,
                   SIZE_T size);
@@ -178,3 +182,6 @@ INTERCEPTOR_ALIAS(__sanitizer_struct_mallinfo, mallinfo);
 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