[PATCH] D56141: [asan] Support running without /proc
Evgenii Stepanov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 7 16:50:23 PST 2019
eugenis marked 2 inline comments as done.
eugenis added inline comments.
================
Comment at: compiler-rt/lib/sanitizer_common/sanitizer_posix.cc:342
+bool ShouldMockFailureToOpen(const char *path) {
+ return common_flags()->test_only_emulate_no_procfs &&
----------------
vitalybuka wrote:
> 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
this would conflict with @krytarowski request for emulating E2BIG on *bsd
================
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;
----------------
vitalybuka wrote:
> why it's CHECK here and "return false;" on linux
That's because ReadProcMaps for *bsd never sets data to nullptr, it aborts instead.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D56141/new/
https://reviews.llvm.org/D56141
More information about the llvm-commits
mailing list