if (LIKELY(asan_inited)) return;
SanitizerToolName = "AddressSanitizer";
Printf("INIT ASAN\n");
+ Printf("MayBeMountProcfs\n");
MaybeMountProcFS();
+ Printf("MabeDisableUlimit\n");
MaybeDisableUlimit();
CHECK(!asan_init_is_running && "ASan init calls itself!");
asan_init_is_running = true;
+ Printf("Cache Binary Name\n");
CacheBinaryName();
// Initialize flags. This must be done early, because most of the
// initialization steps look at flags().
+ Printf("Init flags\n");
InitializeFlags();
+ Printf("Asan Incompatible RT\n");
AsanCheckIncompatibleRT();
+ Printf("Asan Check dynamic PTR\n");
AsanCheckDynamicRTPrereqs();
+ Printf("AvoidCVE\n");
AvoidCVE_2016_2143();
+ Printf("SetCanPoisonMemory\n");
SetCanPoisonMemory(flags()->poison_heap);
+ Printf("SetMallocontextSize \n");
SetMallocContextSize(common_flags()->malloc_context_size);
+ Printf("InitializePlatrformExceptions\n");
InitializePlatformExceptionHandlers();
+ Printf("InitHighMem\n");
InitializeHighMemEnd();
// Make sure we are not statically linked.
AsanDoesNotSupportStaticLinkage();
// Install tool-specific callbacks in sanitizer_common.
+ Printf("Add die callback\n");
AddDieCallback(AsanDie);
+ Printf("SetcheckFailedCallback\n");
SetCheckFailedCallback(AsanCheckFailed);
+ Printf("SetPrintfAndReportCallback\n");
SetPrintfAndReportCallback(AppendToErrorMessageBuffer);
+ Printf("SetReport path\n");
__sanitizer_set_report_path(common_flags()->log_path);
+ Printf("stack usage after return\n");
__asan_option_detect_stack_use_after_return =
flags()->detect_stack_use_after_return;
// Re-exec ourselves if we need to set additional env or command line args.
+ Printf("Maybe Reexec\n");
MaybeReexec();
+
+ Printf("Slow allocate\n");
// Setup internal allocator callback.
SetLowLevelAllocateCallback(OnLowLevelAllocate);
+ Printf("Init interceptors\n");
InitializeAsanInterceptors();
// Enable system log ("adb logcat") on Android.
// AsanInitInternal -> android_log_write -> __interceptor_strcmp
AndroidLogInit();
+ Printf("Replace system malloc \n");
ReplaceSystemMalloc();
// Set the shadow memory address to uninitialized.
} else {
Symbolizer::LateInitialize();
}
+ Printf("ASan INIT done\n");
VReport(1, "AddressSanitizer Init done\n");
}