[compiler-rt] Handle None value when polling addr2line pipe
authorDavid Spickett <david.spickett@linaro.org>
Wed, 5 May 2021 10:49:35 +0000 (11:49 +0100)
committerDavid Spickett <david.spickett@linaro.org>
Mon, 10 May 2021 08:46:06 +0000 (09:46 +0100)
commit831cf15ca6892e2044447f8dc516d76b8a827f1e
tree11c13e9b1b98ba89a3da6c69c9aa34588f962af8
parenta81e45b8bcb8eb274ad73357e10e2cdf8a314a8c
[compiler-rt] Handle None value when polling addr2line pipe

According to:
https://docs.python.org/3/library/subprocess.html#subprocess.Popen.poll

poll can return None if the process hasn't terminated.

I'm not quite sure how addr2line could end up closing the pipe without
terminating but we did see this happen on one of our bots:
```
<...>scripts/asan_symbolize.py",
line 211, in symbolize
    logging.debug("addr2line exited early (broken pipe), returncode=%d"
% self.pipe.poll())
TypeError: %d format: a number is required, not NoneType
```

Handle None by printing a message that we couldn't get the return
code.

Reviewed By: delcypher

Differential Revision: https://reviews.llvm.org/D101891
compiler-rt/lib/asan/scripts/asan_symbolize.py