[sanitizer] Make atos stdin a non-tty pipe to make sure it's not stuck waiting for...
authorKuba Mracek <mracek@apple.com>
Sun, 4 Dec 2016 21:52:21 +0000 (21:52 +0000)
committerKuba Mracek <mracek@apple.com>
Sun, 4 Dec 2016 21:52:21 +0000 (21:52 +0000)
commit8f342333187464b810d289971002d1003949cded
treeba7d986a931562ebae0b3be1660f0460ce2873ca
parent02460bac8bc2c8c84ef1813fb30f22a64352a6ef
[sanitizer] Make atos stdin a non-tty pipe to make sure it's not stuck waiting for user input

On macOS, we often symbolicate using atos (when llvm-symbolizer is not found). The current way we invoke atos involves creating a pseudo-terminal to make sure atos doesn't buffer its output. This however also makes atos think that it's stdin is interactive and in some error situations it will ask the user to enter some input instead of just printing out an error message. For example, when Developer Mode isn't enabled on a machine, atos cannot examine processes, and it will ask the user to enter an administrator's password, which will make the sanitized process get stuck. This patch only connects the pseudo-terminal to the stdout of atos, and uses a regular pipe as its stdin.

Differential Revision: https://reviews.llvm.org/D27239

llvm-svn: 288624
compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc