[asan] Be more careful and verbose when allocating dynamic shadow memory
authorKuba Mracek <mracek@apple.com>
Mon, 26 Feb 2018 18:33:21 +0000 (18:33 +0000)
committerKuba Mracek <mracek@apple.com>
Mon, 26 Feb 2018 18:33:21 +0000 (18:33 +0000)
commit061f3589ccae489989c4a501dab733b9605cb0e4
tree11be68fd09016ae2511518ff79d00ac7bc6074e4
parent4b30a4261f887a151670c1d2db40fc712571fb02
[asan] Be more careful and verbose when allocating dynamic shadow memory

FindAvailableMemoryRange can currently overwrite existing memory (by restricting the VM below addresses that are already used). This patch adds a check to make sure we don't restrict the VM space too much. We are also now more explicit about why the lookup failed and print out verbose values.

Differential Revision: https://reviews.llvm.org/D43318

llvm-svn: 326106
compiler-rt/lib/asan/asan_mac.cc
compiler-rt/lib/sanitizer_common/sanitizer_common.h
compiler-rt/lib/sanitizer_common/sanitizer_linux.cc
compiler-rt/lib/sanitizer_common/sanitizer_mac.cc
compiler-rt/lib/sanitizer_common/sanitizer_win.cc