From a8437e8092ce32e7f961ea97ac11ba3c62acae69 Mon Sep 17 00:00:00 2001 From: Elfgo Date: Wed, 20 Aug 2025 07:37:49 +0000 Subject: [PATCH] [GWP_ASan] Add errno print when mprotect/mmap/munmap failed Add errno print when mprotect/mmap/munmap failed Change-Id: Ia22a52341c218bba12435667a16fe6ac47ed33c8 Signed-off-by: Elfgo --- .../lib/gwp_asan/platform_specific/utilities_posix.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/compiler-rt/lib/gwp_asan/platform_specific/utilities_posix.cpp b/compiler-rt/lib/gwp_asan/platform_specific/utilities_posix.cpp index 8b196563115c..e47de4b56df8 100644 --- a/compiler-rt/lib/gwp_asan/platform_specific/utilities_posix.cpp +++ b/compiler-rt/lib/gwp_asan/platform_specific/utilities_posix.cpp @@ -7,7 +7,9 @@ //===----------------------------------------------------------------------===// // OHOS_LOCAL begin +#include "gwp_asan/guarded_pool_allocator.h" #include "gwp_asan/optional/printf.h" +#include // OHOS_LOCAL end #include // IWYU pragma: keep (for __BIONIC__ macro) @@ -28,8 +30,9 @@ void die(const char *Message) { #else // __BIONIC__ // OHOS_LOCAL begin #if defined(__OHOS__) + MUSL_LOG("[gwp_asan] ErrMsg: %{public}s, Errno: %{public}d\n", Message, errno); Printf("GWP-ASan has a check error\n"); - Printf("%s\n", Message); + Printf("ErrMsg: %s, Errno: %d\n", Message, errno); Printf("*** End GWP-ASan report ***\n"); #endif // OHOS_LOCAL end -- Gitee