Disable calling memory checking functions temporarily in case of asan build 21/175121/3 submit/tizen/20180409.075025
authorSangchul Lee <sc11.lee@samsung.com>
Mon, 9 Apr 2018 04:12:02 +0000 (13:12 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Mon, 9 Apr 2018 07:12:28 +0000 (16:12 +0900)
Change-Id: I3642a96c6ccab3c6c772f14ee369643166a8fbd8
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
packaging/murphy.spec
src/common/mm.c

index faaa2127a38e1f41d0bd72024e74f357c33d6ca9..b58e7c38b3a1bacf8dcab8cfa336388d2233849e 100644 (file)
@@ -189,6 +189,7 @@ cp %{SOURCE1001} .
 %build
 %if "%{asan}" == "1"
 %restore_fcommon
+export CFLAGS="-DTIZEN_DISABLE_MEMORY_CHECK"
 %endif
 %if %{with debug}
 export CFLAGS="-O0 -g3"
index a1a98a208e4abf430a22ee5e45c50fdea2cee960..d6e595dd95a00a9981d142a1f4475b5afe7c515c 100644 (file)
@@ -523,10 +523,12 @@ static int __passthru_memalign(void **ptr, size_t align, size_t size,
     return posix_memalign(ptr, align, size);
 }
 
+#ifndef TIZEN_DISABLE_MEMORY_CHECK
 MRP_INIT static void menory_check_init()
 {
     mcheck(NULL);
 }
+#endif
 
 static void __passthru_free(void *ptr, const char *file, int line,
                             const char *func)
@@ -536,12 +538,15 @@ static void __passthru_free(void *ptr, const char *file, int line,
     MRP_UNUSED(func);
     if (ptr == NULL)
         return;
-
+#ifdef TIZEN_DISABLE_MEMORY_CHECK
+    free(ptr);
+#else
     if (mprobe(ptr) == MCHECK_OK)
         free(ptr);
     else {
         mrp_log_warning("Invalid pointer passed to fuction free");
     }
+#endif
 }