diff --git a/compiler-rt/lib/asan/asan_errors.cpp b/compiler-rt/lib/asan/asan_errors.cpp --- a/compiler-rt/lib/asan/asan_errors.cpp +++ b/compiler-rt/lib/asan/asan_errors.cpp @@ -413,6 +413,7 @@ is_write(is_write_), shadow_val(0) { scariness.Clear(); + bug_descr = "unknown-crash"; if (access_size) { if (access_size <= 9) { char desr[] = "?-byte"; @@ -424,7 +425,6 @@ is_write ? scariness.Scare(20, "write") : scariness.Scare(1, "read"); // Determine the error type. - bug_descr = "unknown-crash"; if (AddrIsInMem(addr)) { u8 *shadow_addr = (u8 *)MemToShadow(addr); // If we are accessing 16 bytes, look at the second shadow byte. diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_procmaps.h b/compiler-rt/lib/sanitizer_common/sanitizer_procmaps.h --- a/compiler-rt/lib/sanitizer_common/sanitizer_procmaps.h +++ b/compiler-rt/lib/sanitizer_common/sanitizer_procmaps.h @@ -39,7 +39,14 @@ class MemoryMappedSegment { public: explicit MemoryMappedSegment(char *buff = nullptr, uptr size = 0) - : filename(buff), filename_size(size), data_(nullptr) {} + : filename(buff), + filename_size(size), + data_(nullptr), + start(0), + end(0), + offset(0), + protection(0), + arch(kModuleArchUnknown) {} ~MemoryMappedSegment() {} bool IsReadable() const { return protection & kProtectionRead; } diff --git a/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp b/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp --- a/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp +++ b/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp @@ -206,7 +206,7 @@ // The object is 64-byte aligned, because we want hot data to be located // in a single cache line if possible (it's accessed in every interceptor). ALIGNED(64) LibIgnore libignore; - __sanitizer_sigaction sigactions[kSigCount]; + __sanitizer_sigaction sigactions[kSigCount] = {}; #if !SANITIZER_APPLE && !SANITIZER_NETBSD unsigned finalize_key; #endif diff --git a/compiler-rt/lib/tsan/rtl/tsan_interface_ann.cpp b/compiler-rt/lib/tsan/rtl/tsan_interface_ann.cpp --- a/compiler-rt/lib/tsan/rtl/tsan_interface_ann.cpp +++ b/compiler-rt/lib/tsan/rtl/tsan_interface_ann.cpp @@ -70,7 +70,7 @@ struct DynamicAnnContext { Mutex mtx; - ExpectRace benign; + ExpectRace benign = {}; DynamicAnnContext() : mtx(MutexTypeAnnotations) {} }; diff --git a/compiler-rt/lib/tsan/rtl/tsan_report.cpp b/compiler-rt/lib/tsan/rtl/tsan_report.cpp --- a/compiler-rt/lib/tsan/rtl/tsan_report.cpp +++ b/compiler-rt/lib/tsan/rtl/tsan_report.cpp @@ -42,7 +42,14 @@ } ReportMop::ReportMop() - : mset() { + : mset() + , tid() + , addr() + , size() + , write() + , atomic() + , external_tag() + , stack() { } ReportDesc::~ReportDesc() { diff --git a/compiler-rt/lib/ubsan/ubsan_diag.h b/compiler-rt/lib/ubsan/ubsan_diag.h --- a/compiler-rt/lib/ubsan/ubsan_diag.h +++ b/compiler-rt/lib/ubsan/ubsan_diag.h @@ -63,14 +63,16 @@ const SymbolizedStack *SymbolizedLoc; // Not owned. public: - Location() : Kind(LK_Null) {} - Location(SourceLocation Loc) : - Kind(LK_Source), SourceLoc(Loc) {} - Location(MemoryLocation Loc) : - Kind(LK_Memory), MemoryLoc(Loc) {} + Location() + : Kind(LK_Null), SourceLoc(), MemoryLoc(), SymbolizedLoc(nullptr) {} + Location(SourceLocation Loc) + : Kind(LK_Source), SourceLoc(Loc), MemoryLoc(), SymbolizedLoc(nullptr) {} + Location(MemoryLocation Loc) + : Kind(LK_Memory), MemoryLoc(Loc), SourceLoc(), SymbolizedLoc(nullptr) {} // SymbolizedStackHolder must outlive Location object. - Location(const SymbolizedStackHolder &Stack) : - Kind(LK_Symbolized), SymbolizedLoc(Stack.get()) {} + Location(const SymbolizedStackHolder &Stack) + : Kind(LK_Symbolized), SymbolizedLoc(Stack.get()), SourceLoc(), + MemoryLoc() {} LocationKind getKind() const { return Kind; }