Fix IOError exception being raised in asan_symbolize.pycrash when

using `atos` symbolizer on Darwin when the binaries don't exist.

For now we just produce an unsymbolicated stackframe when the binary
doesn't exist.

llvm-svn: 348659
This commit is contained in:
Dan Liew 2018-12-07 22:14:20 +00:00
parent b5613ecf17
commit 5ab96bf57c

View File

@ -231,6 +231,10 @@ class DarwinSymbolizer(Symbolizer):
"""Overrides Symbolizer.symbolize."""
if self.binary != binary:
return None
if not os.path.exists(binary):
# If the binary doesn't exist atos will exit which will lead to IOError
# exceptions being raised later on so just don't try to symbolize.
return ['{} ({}:{}+{})'.format(addr, binary, self.arch, offset)]
atos_line = self.atos.convert('0x%x' % int(offset, 16))
while "got symbolicator for" in atos_line:
atos_line = self.atos.readline()