[compiler-rt] 1694646 - Revert "[Sanitizers][Darwin] In DlAddrSymbolizer, return only the module file name instead of the comlpete module path during symbolication."

usama hameed via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 8 16:04:29 PDT 2023


Author: usama hameed
Date: 2023-06-08T16:02:54-07:00
New Revision: 16946466fd5334c97735cae052cca7173a52df84

URL: https://github.com/llvm/llvm-project/commit/16946466fd5334c97735cae052cca7173a52df84
DIFF: https://github.com/llvm/llvm-project/commit/16946466fd5334c97735cae052cca7173a52df84.diff

LOG: Revert "[Sanitizers][Darwin] In DlAddrSymbolizer, return only the module file name instead of the comlpete module path during symbolication."

The commit broke asan_symbolize.py script on Darwin which depended on
using the complete module path to symolize crash traces offline.

This reverts commit f6ea869f7c043c70722b8db6be94d9ad4cc9eb92.

rdar://110487521

Added: 
    

Modified: 
    compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_mac.cpp

Removed: 
    compiler-rt/test/sanitizer_common/TestCases/Darwin/symbolizer-file-name-dladdr.cpp


################################################################################
diff  --git a/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_mac.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_mac.cpp
index f17c54ba37b01..a9c958b2d1001 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_mac.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_mac.cpp
@@ -41,12 +41,6 @@ bool DlAddrSymbolizer::SymbolizePC(uptr addr, SymbolizedStack *stack) {
     stack->info.function_offset = addr - sym_addr;
   }
 
-  if (info.dli_fname) {
-    if (auto *last_occurence = internal_strrchr(info.dli_fname, '/')) {
-      stack->info.module = internal_strdup(last_occurence + 1);
-    }
-  }
-
   const char *demangled = DemangleSwiftAndCXX(info.dli_sname);
   if (!demangled) return false;
   stack->info.function = internal_strdup(demangled);

diff  --git a/compiler-rt/test/sanitizer_common/TestCases/Darwin/symbolizer-file-name-dladdr.cpp b/compiler-rt/test/sanitizer_common/TestCases/Darwin/symbolizer-file-name-dladdr.cpp
deleted file mode 100644
index 802bd666361f4..0000000000000
--- a/compiler-rt/test/sanitizer_common/TestCases/Darwin/symbolizer-file-name-dladdr.cpp
+++ /dev/null
@@ -1,11 +0,0 @@
-// RUN: %clangxx %s -O0 -o %t
-// RUN: %env_tool_opts=external_symbolizer_path= %run %t 2>&1 | FileCheck %s
-#include <sanitizer/common_interface_defs.h>
-#include <stdio.h>
-
-int main() {
-  //CHECK: #0{{.*}}
-  //CHECK: #1{{.*}}(symbolizer-file-name-dladdr.cpp.tmp
-  __sanitizer_print_stack_trace();
-  return 0;
-}


        


More information about the llvm-commits mailing list