This is an archive of the discontinued LLVM Phabricator instance.

[sanitizer] Support running without fd 0,1,2.
ClosedPublic

Authored by eugenis on Dec 17 2018, 6:01 PM.

Details

Summary

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.

Diff Detail

Event Timeline

eugenis created this revision.Dec 17 2018, 6:01 PM
eugenis updated this revision to Diff 178825.Dec 18 2018, 6:17 PM

Gave AdjustFd a more descriptive name.

pcc accepted this revision.Dec 18 2018, 7:58 PM

LGTM

This revision is now accepted and ready to land.Dec 18 2018, 7:58 PM
This revision was automatically updated to reflect the committed changes.
Herald added a subscriber: Restricted Project. · View Herald TranscriptDec 19 2018, 3:48 PM