[compiler-rt] 572a072 - [HWASan] Try 'google' prefixed apex directories in symbolizer.

Mitch Phillips via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 3 10:35:57 PST 2021


Author: Mitch Phillips
Date: 2021-12-03T10:35:03-08:00
New Revision: 572a0721a022e992648bf55c80b5defb53aa892f

URL: https://github.com/llvm/llvm-project/commit/572a0721a022e992648bf55c80b5defb53aa892f
DIFF: https://github.com/llvm/llvm-project/commit/572a0721a022e992648bf55c80b5defb53aa892f.diff

LOG: [HWASan] Try 'google' prefixed apex directories in symbolizer.

Google-signed apexes appear on Android build servers' symbol files as
being under /apex/com.google.android.<foo>/. In reality, the apexes are
always installed as /apex/com.android.<foo>/ (note the lack of
'google'). In order for local symbolization under hwasan_symbolize to
work correctly, we also try the 'google' directory.

Reviewed By: eugenis

Differential Revision: https://reviews.llvm.org/D114919

Added: 
    

Modified: 
    compiler-rt/lib/hwasan/scripts/hwasan_symbolize

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/hwasan/scripts/hwasan_symbolize b/compiler-rt/lib/hwasan/scripts/hwasan_symbolize
index e0a6554705417..f73ea1783d758 100755
--- a/compiler-rt/lib/hwasan/scripts/hwasan_symbolize
+++ b/compiler-rt/lib/hwasan/scripts/hwasan_symbolize
@@ -84,6 +84,11 @@ class Symbolizer:
       full_path = os.path.join(p, name)
       if os.path.exists(full_path):
         return full_path
+      apex_prefix = "apex/com.android."
+      if name.startswith(apex_prefix):
+        full_path = os.path.join(p, "apex/com.google.android." + name[len(apex_prefix):])
+        if os.path.exists(full_path):
+          return full_path
     # Try stripping extra path components as the last resort.
     for p in self.__binary_prefixes:
       full_path = os.path.join(p, os.path.basename(name))


        


More information about the llvm-commits mailing list