From c52f394f7d77a798fd58d633fb8e6183c04a364f Mon Sep 17 00:00:00 2001 From: NAKAMURA Takumi Date: Tue, 7 Feb 2017 14:06:01 +0000 Subject: 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() git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@294303 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/asan/scripts/asan_symbolize.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'lib/asan/scripts') diff --git a/lib/asan/scripts/asan_symbolize.py b/lib/asan/scripts/asan_symbolize.py index d82c6773e..a827618c6 100755 --- a/lib/asan/scripts/asan_symbolize.py +++ b/lib/asan/scripts/asan_symbolize.py @@ -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.""" -- cgit v1.2.3