From 5ab96bf57c55f7559f32e3dabb00b9db12ff2203 Mon Sep 17 00:00:00 2001 From: Dan Liew Date: Fri, 7 Dec 2018 22:14:20 +0000 Subject: [PATCH] Fix IOError exception being raised in `asan_symbolize.py`crash 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 --- compiler-rt/lib/asan/scripts/asan_symbolize.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/compiler-rt/lib/asan/scripts/asan_symbolize.py b/compiler-rt/lib/asan/scripts/asan_symbolize.py index 68b6f093b533..13e5f0cd46db 100755 --- a/compiler-rt/lib/asan/scripts/asan_symbolize.py +++ b/compiler-rt/lib/asan/scripts/asan_symbolize.py @@ -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()