From 6cb709b83a0bcbc9c945383bb1efe59369eb3836 Mon Sep 17 00:00:00 2001 From: guzhihao4 Date: Tue, 11 Jun 2024 16:49:46 +0800 Subject: [PATCH] [Sanitizer] Fix asan test: rlimit_mmap_test.cpp Add log message only in print_module_map to avoid dead lock Issue: https://gitee.com/openharmony/third_party_llvm-project/issues/IA4F4W Signed-off-by: guzhihao4 Change-Id: I64d5ceb0f6b1da303416697aad65e52df512216a --- compiler-rt/lib/asan/asan_rtl.cpp | 5 +++-- compiler-rt/lib/ubsan/ubsan_init.cpp | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/compiler-rt/lib/asan/asan_rtl.cpp b/compiler-rt/lib/asan/asan_rtl.cpp index cbbdcf7914b0..c677280f48d3 100644 --- a/compiler-rt/lib/asan/asan_rtl.cpp +++ b/compiler-rt/lib/asan/asan_rtl.cpp @@ -49,8 +49,10 @@ static void AsanDie() { internal_sched_yield(); } } - if (common_flags()->print_module_map >= 1) + if (common_flags()->print_module_map >= 1) { DumpProcessMap(); + Report("End Asan report (AsanDie)\n"); // OHOS_LOCAL + } WaitForDebugger(flags()->sleep_before_dying, "before dying"); @@ -63,7 +65,6 @@ static void AsanDie() { UnmapOrDie((void*)kLowShadowBeg, kHighShadowEnd - kLowShadowBeg); } } - Report("End Asan report (AsanDie)\n"); // OHOS_LOCAL } static void CheckUnwind() { diff --git a/compiler-rt/lib/ubsan/ubsan_init.cpp b/compiler-rt/lib/ubsan/ubsan_init.cpp index 54ff2b450519..ed87ea7cdc56 100644 --- a/compiler-rt/lib/ubsan/ubsan_init.cpp +++ b/compiler-rt/lib/ubsan/ubsan_init.cpp @@ -35,9 +35,10 @@ static void CommonInit() { } static void UbsanDie() { - if (common_flags()->print_module_map >= 1) + if (common_flags()->print_module_map >= 1) { DumpProcessMap(); - Report("End CFI report (UbsanDie)\n"); // OHOS_LOCAL + Report("End CFI report (UbsanDie)\n"); // OHOS_LOCAL + } } static void CommonStandaloneInit() { -- Gitee