From 4809b1dca1985124e516ef70940c110bdee05f50 Mon Sep 17 00:00:00 2001 From: Kuba Brecka Date: Mon, 30 Nov 2015 14:12:47 +0000 Subject: [PATCH] [sanitizer] Detect an invalid answer in AtosSymbolizer On OS X, in AtosSymbolizer, if the answer from atos doesn't contain module name, let's bail and return false. There are some cases where this is beneficial, because we'll try DlAddrSymbolizer next (it's next in the symbolizer chain), which might be able to symbolize something that atos couldn't. Differential Revision: http://reviews.llvm.org/D15071 llvm-svn: 254301 --- .../lib/sanitizer_common/sanitizer_symbolizer_mac.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_mac.cc b/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_mac.cc index 6de7fe0b716c..64048fa7e58e 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_mac.cc +++ b/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_mac.cc @@ -121,6 +121,12 @@ static bool ParseCommandOutput(const char *str, uptr addr, char **out_name, const char *rest = trim; char *symbol_name; rest = ExtractTokenUpToDelimiter(rest, " (in ", &symbol_name); + if (rest[0] == '\0') { + InternalFree(symbol_name); + InternalFree(trim); + return false; + } + if (internal_strncmp(symbol_name, "0x", 2) != 0) *out_name = symbol_name; else