diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_mac.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_mac.cpp --- a/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_mac.cpp +++ b/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_mac.cpp @@ -163,7 +163,7 @@ uptr start_address = AddressInfo::kUnknown; if (!ParseCommandOutput(buf, addr, &stack->info.function, &stack->info.module, &stack->info.file, &line, &start_address)) { - process_ = nullptr; + Report("WARNING: atos failed to symbolize address \"0x%zx\"\n", addr); return false; } stack->info.line = (int)line; diff --git a/compiler-rt/test/sanitizer_common/TestCases/Darwin/atos-symbolized-recover.cpp b/compiler-rt/test/sanitizer_common/TestCases/Darwin/atos-symbolized-recover.cpp new file mode 100644 --- /dev/null +++ b/compiler-rt/test/sanitizer_common/TestCases/Darwin/atos-symbolized-recover.cpp @@ -0,0 +1,18 @@ +// Check that there is a warning when atos fails to symbolize an address +// and that atos continues symbolicating correctly after. + +// RUN: %clangxx -O0 %s -o %t +// RUN: not %run %t 2>&1 | FileCheck %s + +void bar() { + void *invalid_addr = reinterpret_cast(0xDEADBEEF); + void (*func_ptr)() = reinterpret_cast(invalid_addr); + func_ptr(); +} + +int main() { + bar(); + return 0; + // CHECK: WARNING: atos failed to symbolize address{{.*}} + // CHECK: {{.*}}atos-symbolized-recover.cpp:[[@LINE-3]]{{.*}} +}