llvm-project/compiler-rt/test
Reid Kleckner ad04914a53 [Windows] Fix UnmapOrDie and MmapAlignedOrDie
Now ASan can return virtual memory to the underlying OS. Portable
sanitizer runtime code needs to be aware that UnmapOrDie cannot unmap
part of previous mapping.

In particular, this required changing how we implement MmapAlignedOrDie
on Windows, which is what Allocator32 uses.

The new code first attempts to allocate memory of the given size, and if
it is appropriately aligned, returns early. If not, it frees the memory
and attempts to reserve size + alignment bytes. In this region there
must be an aligned address. We then free the oversized mapping and
request a new mapping at the aligned address immediately after. However,
a thread could allocate that virtual address in between our free and
allocation, so we have to retry if that allocation fails. The existing
thread creation stress test managed to trigger this condition, so the
code isn't totally untested.

Reviewers: samsonov

Differential Revision: http://reviews.llvm.org/D17431

llvm-svn: 263160
2016-03-10 20:47:26 +00:00
..
BlocksRuntime Move tests for BlocksRuntime and builtins to corresponding directories under test/ 2014-02-14 09:47:31 +00:00
asan [Windows] Fix UnmapOrDie and MmapAlignedOrDie 2016-03-10 20:47:26 +00:00
builtins Add a generic version of __divtc3.c for long double complex division. 2015-11-22 19:13:49 +00:00
cfi [tests] Don't compile CFI C tests in C++ mode. 2016-02-24 00:16:57 +00:00
dfsan [DFSan] Fix test_inet_pton for big endian archs 2016-03-09 08:00:37 +00:00
lsan [LSan] Enable use_registers test for MIPS 2016-03-03 05:05:20 +00:00
msan [sanitizer_common tests] Make Darwin a Posix system and bring the stable-runtime definition from ASan tests. 2016-03-10 18:46:23 +00:00
profile Fix a minor bug in test 2016-03-09 17:13:18 +00:00
safestack Ensure safestack overflow test doesn't segfault 2016-01-07 22:19:12 +00:00
sanitizer_common [sanitizer_common tests] Make Darwin a Posix system and bring the stable-runtime definition from ASan tests. 2016-03-10 18:46:23 +00:00
tsan Follow-up fix for r263126. Apparently `printf("%p", NULL)` can output 0x0, (nil) or (null) on different platforms. 2016-03-10 18:09:57 +00:00
ubsan [ubsan/float-cast-overflow] Make the test also work with C++11 narrowing 2016-03-04 18:33:44 +00:00
CMakeLists.txt [CMake] Push the dependency on AddLLVM into the test and unites layers 2016-02-17 16:38:54 +00:00
lit.common.cfg [tests] Remove "supported-target" in favor of "target-arch" lit features. 2016-02-23 01:58:56 +00:00
lit.common.configured.in [tests] Remove "supported-target" in favor of "target-arch" lit features. 2016-02-23 01:58:56 +00:00