[PATCH] D56141: [asan] Support running without /proc

Vitaly Buka via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 7 16:25:27 PST 2019


vitalybuka accepted this revision.
vitalybuka added a comment.
This revision is now accepted and ready to land.

LGTM



================
Comment at: compiler-rt/lib/sanitizer_common/sanitizer_posix.cc:342
 
+bool ShouldMockFailureToOpen(const char *path) {
+  return common_flags()->test_only_emulate_no_procfs &&
----------------
eugenis wrote:
> vitalybuka wrote:
> > what if instead of this we add
> > common_flags()->procfs_path and set it to /proc/ by defaut?
> Not sure about that. It would take a mock flag, and disguise it as a user flag. Unless there are actual practical cases where procfs is mounted somewhere other than /proc, all this would do is confuse people, IMHO.
add tests into name e.g. test_only_procfs_path
this will be more generic, maybe let some one add useful tests with about the same complexity of the flag implementation


================
Comment at: compiler-rt/lib/sanitizer_common/sanitizer_procmaps_bsd.cc:102
 bool MemoryMappingLayout::Next(MemoryMappedSegment *segment) {
+  CHECK(!Error()); // can not fail
   char *last = data_.proc_self_maps.data + data_.proc_self_maps.len;
----------------
why it's CHECK here and "return false;" on linux


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D56141/new/

https://reviews.llvm.org/D56141





More information about the llvm-commits mailing list