[PATCH] D27239: [sanitizer] Make atos stdin a non-tty pipe to make sure it's not stuck waiting for user input

Kuba (Brecka) Mracek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 29 16:31:01 PST 2016


kubabrecka created this revision.
kubabrecka added reviewers: zaks.anna, filcab, kcc, dvyukov, eugenis.
kubabrecka added a subscriber: llvm-commits.
kubabrecka set the repository for this revision to rL LLVM.
kubabrecka added a project: Sanitizers.

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.

I'm not adding a testcase, because to reproduce the problem you have to disable Developer Mode on your machine, which is not something that can be done as a lit test.  But if your machine has Developer Mode disabled, you will already get test failures of other tests.


Repository:
  rL LLVM

https://reviews.llvm.org/D27239

Files:
  lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D27239.79669.patch
Type: text/x-patch
Size: 4841 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161130/55dde18f/attachment.bin>


More information about the llvm-commits mailing list