[compiler-rt] r294303 - asan_symbolize.py: [Py3] Use text mode with universal_newlines=True for Popen.
NAKAMURA Takumi via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 7 06:06:01 PST 2017
Author: chapuni
Date: Tue Feb 7 08:06:01 2017
New Revision: 294303
URL: http://llvm.org/viewvc/llvm-project?rev=294303&view=rev
Log:
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()
Modified:
compiler-rt/trunk/lib/asan/scripts/asan_symbolize.py
Modified: compiler-rt/trunk/lib/asan/scripts/asan_symbolize.py
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/scripts/asan_symbolize.py?rev=294303&r1=294302&r2=294303&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/scripts/asan_symbolize.py (original)
+++ compiler-rt/trunk/lib/asan/scripts/asan_symbolize.py Tue Feb 7 08:06:01 2017
@@ -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."""
More information about the llvm-commits
mailing list