[PATCH] D73823: hwasan_symbolize: allow 0x in the address field

Evgenii Stepanov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 31 18:15:06 PST 2020


eugenis created this revision.
eugenis added a reviewer: vitalybuka.
Herald added projects: Sanitizers, LLVM.
Herald added a subscriber: Sanitizers.

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


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D73823

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


Index: compiler-rt/lib/hwasan/scripts/hwasan_symbolize
===================================================================
--- compiler-rt/lib/hwasan/scripts/hwasan_symbolize
+++ compiler-rt/lib/hwasan/scripts/hwasan_symbolize
@@ -119,7 +119,7 @@
 
 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 @@
   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)
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D73823.241857.patch
Type: text/x-patch
Size: 1102 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200201/ee6e1ad5/attachment.bin>


More information about the llvm-commits mailing list