def modules(self):
return set(self._module_name_to_description_map.values())
- def get_module_path_for_symbolication(self, module_name, proxy):
+ def get_module_path_for_symbolication(self, module_name, proxy, validate_uuid):
module_desc = self.find_module_by_name(module_name)
if module_desc is None:
return None
module_desc = proxy.filter_module_desc(module_desc)
if module_desc is None:
return None
- try:
- uuid = get_uuid_from_binary(module_desc.module_path_for_symbolization, arch = module_desc.arch)
- if uuid != module_desc.uuid:
- logging.warning("Detected UUID mismatch {} != {}".format(uuid, module_desc.uuid))
- # UUIDs don't match. Tell client to not symbolize this.
+ if validate_uuid:
+ logging.debug('Validating UUID of {}'.format(module_desc.module_path_for_symbolization))
+ try:
+ uuid = get_uuid_from_binary(module_desc.module_path_for_symbolization, arch = module_desc.arch)
+ if uuid != module_desc.uuid:
+ logging.warning("Detected UUID mismatch {} != {}".format(uuid, module_desc.uuid))
+ # UUIDs don't match. Tell client to not symbolize this.
+ return None
+ except GetUUIDFromBinaryException as e:
+ logging.error('Failed to get binary from UUID: %s', str(e))
return None
- except GetUUIDFromBinaryException as e:
- logging.error('Failed to binary from UUID: %s', str(e))
- return None
+ else:
+ logging.warning('Skipping validation of UUID of {}'.format(module_desc.module_path_for_symbolization))
return module_desc.module_path_for_symbolization
@staticmethod
class ModuleMapPlugIn(AsanSymbolizerPlugIn):
def __init__(self):
self._module_map = None
+ self._uuid_validation = True
def register_cmdline_args(self, parser):
parser.add_argument('--module-map',
help='Path to text file containing module map'
'output. See print_module_map ASan option.')
+ parser.add_argument('--skip-uuid-validation',
+ default=False,
+ action='store_true',
+ help='Skips validating UUID of modules using otool.')
+
def process_cmdline_args(self, pargs):
if not pargs.module_map:
return False
msg = 'Failed to find module map'
logging.error(msg)
raise Exception(msg)
+ self._uuid_validation = not pargs.skip_uuid_validation
return True
+
def filter_binary_path(self, binary_path):
if os.path.isabs(binary_path):
# This is a binary path so transform into
module_name = os.path.basename(binary_path)
else:
module_name = binary_path
- return self._module_map.get_module_path_for_symbolication(module_name, self.proxy)
+ return self._module_map.get_module_path_for_symbolication(
+ module_name,
+ self.proxy,
+ self._uuid_validation
+ )
def add_logging_args(parser):
parser.add_argument('--log-dest',