diff --git a/compiler-rt/lib/asan/scripts/asan_symbolize.py b/compiler-rt/lib/asan/scripts/asan_symbolize.py --- a/compiler-rt/lib/asan/scripts/asan_symbolize.py +++ b/compiler-rt/lib/asan/scripts/asan_symbolize.py @@ -208,7 +208,12 @@ # EPIPE happens if addr2line exits early (which some implementations do # if an invalid file is passed). if e.errno == errno.EPIPE: - logging.debug("addr2line exited early (broken pipe), returncode=%d" % self.pipe.poll()) + logging.debug("addr2line exited early (broken pipe)") + returncode = self.pipe.poll() + if returncode is not None: + logging.debug("returncode=%d" % self.pipe.poll()) + else: + logging.debug("couldn't get returncode") else: logging.debug("unexpected I/O exception communicating with addr2line", exc_info=e) lines.append(('??', '??:0'))