asan_symbolize.py: [Py3] Use text mode with universal_newlines=True for Popen.

With universal_newlines, readline() stalls to fill the buffer. Therefore, let the pipe unbuffered.

This is part of https://reviews.llvm.org/D27404

FIXME: Use Popen.communicate()
llvm-svn: 294303
This commit is contained in:
NAKAMURA Takumi 2017-02-07 14:06:01 +00:00
parent 1027fb8a06
commit ce43bdb3d0
1 changed files with 6 additions and 2 deletions

View File

@ -92,7 +92,9 @@ class LLVMSymbolizer(Symbolizer):
print ' '.join(cmd)
try:
result = subprocess.Popen(cmd, stdin=subprocess.PIPE,
stdout=subprocess.PIPE)
stdout=subprocess.PIPE,
bufsize=0,
universal_newlines=True)
except OSError:
result = None
return result
@ -153,7 +155,9 @@ class Addr2LineSymbolizer(Symbolizer):
if DEBUG:
print ' '.join(cmd)
return subprocess.Popen(cmd,
stdin=subprocess.PIPE, stdout=subprocess.PIPE)
stdin=subprocess.PIPE, stdout=subprocess.PIPE,
bufsize=0,
universal_newlines=True)
def symbolize(self, addr, binary, offset):
"""Overrides Symbolizer.symbolize."""