From be90d33797f402ad836b38dd450d34edecaa5e59 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Mon, 6 Jan 2020 05:15:31 +0300 Subject: [PATCH 1/2] Avoid MSan report for data from libunwind --- dbms/src/Common/StackTrace.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dbms/src/Common/StackTrace.cpp b/dbms/src/Common/StackTrace.cpp index d0d051790be..f5dd12ce1fb 100644 --- a/dbms/src/Common/StackTrace.cpp +++ b/dbms/src/Common/StackTrace.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #include #include #include @@ -226,6 +227,7 @@ void StackTrace::tryCapture() size = 0; #if USE_UNWIND size = unw_backtrace(frames.data(), capacity); + __msan_unpoison(frames, size * sizeof(*frames)); #endif } @@ -331,6 +333,8 @@ std::string StackTrace::toString() const std::string StackTrace::toString(void ** frames_, size_t offset, size_t size) { + __msan_unpoison(frames_, size * sizeof(*frames_)); + StackTrace::Frames frames_copy{}; for (size_t i = 0; i < size; ++i) frames_copy[i] = frames_[i]; From 16f9628513e3fafcd7960cbe6eba27bd2d430671 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Mon, 6 Jan 2020 09:19:12 +0300 Subject: [PATCH 2/2] Fixed error --- dbms/src/Common/StackTrace.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dbms/src/Common/StackTrace.cpp b/dbms/src/Common/StackTrace.cpp index f5dd12ce1fb..e43bc4c287e 100644 --- a/dbms/src/Common/StackTrace.cpp +++ b/dbms/src/Common/StackTrace.cpp @@ -227,7 +227,7 @@ void StackTrace::tryCapture() size = 0; #if USE_UNWIND size = unw_backtrace(frames.data(), capacity); - __msan_unpoison(frames, size * sizeof(*frames)); + __msan_unpoison(frames.data(), size * sizeof(frames[0])); #endif }