[PATCH] D55801: [sanitizer] Support running without fd 0,1,2.

Evgenii Stepanov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 17 18:01:48 PST 2018


eugenis created this revision.
eugenis added reviewers: pcc, vitalybuka.
Herald added a subscriber: kubamracek.

Support running with no open file descriptors (as may happen to
"init" process on linux).

- Remove a check that writing to stderr succeeds.
- When opening a file (ex. for log_path option), dup the new fd out of

[0, 2] range to avoid confusing the program.


https://reviews.llvm.org/D55801

Files:
  compiler-rt/lib/sanitizer_common/sanitizer_linux.cc
  compiler-rt/lib/sanitizer_common/sanitizer_mac.cc
  compiler-rt/lib/sanitizer_common/sanitizer_netbsd.cc
  compiler-rt/lib/sanitizer_common/sanitizer_posix.cc
  compiler-rt/lib/sanitizer_common/sanitizer_posix.h
  compiler-rt/lib/sanitizer_common/sanitizer_rtems.cc
  compiler-rt/lib/sanitizer_common/sanitizer_solaris.cc
  compiler-rt/test/asan/TestCases/Posix/no-fd.cc

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D55801.178576.patch
Type: text/x-patch
Size: 5766 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181218/30cfd2b0/attachment.bin>


More information about the llvm-commits mailing list