summaryrefslogtreecommitdiff
path: root/libc/malloc_debug/malloc_debug.cpp
diff options
context:
space:
mode:
authorChristopher Ferris <cferris@google.com>2019-05-24 20:25:36 -0700
committerandroid-build-merger <android-build-merger@google.com>2019-05-24 20:25:36 -0700
commitdfc1ffd0c5ef99948ea13b0a10daf72e4b5adbf5 (patch)
treeb13f308ba7ff641e1c8c8a39d8746e3c2b000176 /libc/malloc_debug/malloc_debug.cpp
parent9689b471648a84eaa9267564fa2c07bd32d234d9 (diff)
parent0c26c9efd73461e43a857f2841927830487024ba (diff)
Merge "Disable malloc debug when asan enabled." am: 497d7169d4 am: 39677eae59 am: b7bf3abf7d
am: 0c26c9efd7 Change-Id: I4101fa2de01a9104cf3bf5f4fe78a45c079e5f69
Diffstat (limited to 'libc/malloc_debug/malloc_debug.cpp')
-rw-r--r--libc/malloc_debug/malloc_debug.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/libc/malloc_debug/malloc_debug.cpp b/libc/malloc_debug/malloc_debug.cpp
index 53fcead01..c030d5429 100644
--- a/libc/malloc_debug/malloc_debug.cpp
+++ b/libc/malloc_debug/malloc_debug.cpp
@@ -252,12 +252,19 @@ static void* InitHeader(Header* header, void* orig_pointer, size_t size) {
return g_debug->GetPointer(header);
}
+extern "C" void __asan_init() __attribute__((weak));
+
bool debug_initialize(const MallocDispatch* malloc_dispatch, bool* zygote_child,
const char* options) {
if (zygote_child == nullptr || options == nullptr) {
return false;
}
+ if (__asan_init != 0) {
+ error_log("malloc debug cannot be enabled alongside ASAN");
+ return false;
+ }
+
InitAtfork();
g_zygote_child = zygote_child;