[compiler-rt] 6da6153 - hwasan_symbolize: allow 0x in the address field

Evgenii Stepanov via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 3 18:24:50 PST 2020


Author: Evgenii Stepanov
Date: 2020-02-03T18:23:48-08:00
New Revision: 6da6153759a1cb77a65084d86de813bd9134c2a1

URL: https://github.com/llvm/llvm-project/commit/6da6153759a1cb77a65084d86de813bd9134c2a1
DIFF: https://github.com/llvm/llvm-project/commit/6da6153759a1cb77a65084d86de813bd9134c2a1.diff

LOG: hwasan_symbolize: allow 0x in the address field

Summary:
Fix parsing of mangled stack trace lines where the address has been
replaced with "0x", literally.

Reviewers: vitalybuka

Subscribers: #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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

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 e845786f34bc..dd5f859561e1 100755
--- a/compiler-rt/lib/hwasan/scripts/hwasan_symbolize
+++ b/compiler-rt/lib/hwasan/scripts/hwasan_symbolize
@@ -119,7 +119,7 @@ class Symbolizer:
 
 def symbolize_line(line, symbolizer_path):
   #0 0x7f6e35cf2e45  (/blah/foo.so+0x11fe45)
-  match = re.match(r'^(.*?)#([0-9]+)( *)(0x[0-9a-f]+) *\((.*)\+(0x[0-9a-f]+)\)', line, re.UNICODE)
+  match = re.match(r'^(.*?)#([0-9]+)( *)(0x[0-9a-f]*) *\((.*)\+(0x[0-9a-f]+)\)', line, re.UNICODE)
   if match:
     frameno = match.group(2)
     binary = match.group(5)
@@ -144,7 +144,7 @@ def save_access_address(line):
   match = re.match(r'^(.*?)HWAddressSanitizer: tag-mismatch on address (0x[0-9a-f]+) ', line, re.UNICODE)
   if match:
     last_access_address = int(match.group(2), 16)
-  match = re.match(r'^(.*?) of size [0-9]+ at 0x[0-9a-f]+ tags: ([0-9a-f]+)/[0-9a-f]+ \(ptr/mem\)', line, re.UNICODE)
+  match = re.match(r'^(.*?) of size [0-9]+ at 0x[0-9a-f]* tags: ([0-9a-f]+)/[0-9a-f]+ \(ptr/mem\)', line, re.UNICODE)
   if match:
     last_access_tag = int(match.group(2), 16)
 


        


More information about the llvm-commits mailing list